linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: tests: Extend cli/003
@ 2021-01-25 10:43 Nikolay Borisov
  2021-01-25 10:43 ` [PATCH 2/2] btrfs-progs: Remove duplicate checks from cmd_filesystem_resize Nikolay Borisov
  2021-02-19 12:06 ` [PATCH 1/2] btrfs-progs: tests: Extend cli/003 David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Borisov @ 2021-01-25 10:43 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

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(+)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-19 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 10:43 [PATCH 1/2] btrfs-progs: tests: Extend cli/003 Nikolay Borisov
2021-01-25 10:43 ` [PATCH 2/2] btrfs-progs: Remove duplicate checks from cmd_filesystem_resize Nikolay Borisov
2021-02-19 12:06 ` [PATCH 1/2] btrfs-progs: tests: Extend cli/003 David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).