btrfs-progs: tests: cli/003 verify that the path is not an image

Add a test case which ensures that when resize is tried on an image
instead of a directory appropriate warning is produced and the command
fails.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2021-01-25 12:43:57 +02:00 committed by David Sterba
parent 07b06ead7e
commit b39d02a0c0

View File

@ -54,4 +54,11 @@ for sep in '' '--'; do
run_check $SUDO_HELPER "$TOP/btrfs" filesystem resize $sep 1:max "$TEST_MNT"
done
# Test passing a file instead of a directory
run_mustfail_stdout "should fail for image" \
"$TOP/btrfs" filesystem resize 1:-128M "$TEST_DEV" |
_log_stdout |
grep -q "ERROR: resize works on mounted filesystems and accepts only" ||
_fail "no expected error message in the output 2"
run_check_umount_test_dev