diff options
author | Qu Wenruo <wqu@suse.com> | 2017-11-29 16:26:02 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-08 18:15:18 +0100 |
commit | 0ca2f5a7241373c660946802b0d7f8305234c286 (patch) | |
tree | d05dccfff1fde91eddca8ffdac24041ba4eae5a5 /tests | |
parent | 0855a8cd43006c38441729ce950a086745deab16 (diff) |
btrfs-progs: tests/mkfs: Introduce test case to check if mkfs rootdir can create a new file
To test regression 460e93f25754 ("btrfs-progs: mkfs: check the status of
file at mkfs").
Signed-off-by: Qu Wenruo <wqu@suse.com>
[ update test to create a out of /tmp ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mkfs-tests/011-rootdir-create-file/test.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mkfs-tests/011-rootdir-create-file/test.sh b/tests/mkfs-tests/011-rootdir-create-file/test.sh new file mode 100755 index 00000000..c04f711d --- /dev/null +++ b/tests/mkfs-tests/011-rootdir-create-file/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Regression test for mkfs.btrfs --rootdir on non-existent file. +# Expected behavior: it should create a new file if destination doesn't exist +# Regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs") + +source "$TOP/tests/common" + +check_prereq mkfs.btrfs + +tmp=$(mktemp -d --tmpdir btrfs-progs-mkfs.rootdirXXXXXXX) +# we can't use TEST_DEV, a file is needed +img=$(mktemp btrfs-progs-mkfs.rootdirXXXXXXX) +run_check "$TOP/mkfs.btrfs" -f --rootdir "$TOP/Documentation/" "$img" + +rm -rf -- "$img" |