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 <nbori...@suse.com>
---
 tests/cli-tests/003-fi-resize-args/test.sh | 7 +++++++
 1 file changed, 7 insertions(+)

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
--
2.25.1

Reply via email to