Message ID | 20210125104358.817072-1-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] btrfs-progs: tests: Extend cli/003 | expand |
On Mon, Jan 25, 2021 at 12:43:57PM +0200, Nikolay Borisov wrote: > Add a test 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> Added to devel with some fixups, thanks.
diff --git a/tests/cli-tests/003-fi-resize-args/test.sh b/tests/cli-tests/003-fi-resize-args/test.sh index 2e03725bb91a..0d2263f4b97f 100755 --- a/tests/cli-tests/003-fi-resize-args/test.sh +++ b/tests/cli-tests/003-fi-resize-args/test.sh @@ -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" | + 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
Add a test 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> --- tests/cli-tests/003-fi-resize-args/test.sh | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.25.1