c04f711d96f94dc3bed6680179f14c36868bb5e5
[platform/upstream/btrfs-progs.git] / tests / mkfs-tests / 011-rootdir-create-file / test.sh
1 #!/bin/bash
2 # Regression test for mkfs.btrfs --rootdir on non-existent file.
3 # Expected behavior: it should create a new file if destination doesn't exist
4 # Regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs")
5
6 source "$TOP/tests/common"
7
8 check_prereq mkfs.btrfs
9
10 tmp=$(mktemp -d --tmpdir btrfs-progs-mkfs.rootdirXXXXXXX)
11 # we can't use TEST_DEV, a file is needed
12 img=$(mktemp btrfs-progs-mkfs.rootdirXXXXXXX)
13 run_check "$TOP/mkfs.btrfs" -f --rootdir "$TOP/Documentation/" "$img"
14
15 rm -rf -- "$img"