All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 1/2] btrfs-progs: tests: Extend cli/003
Date: Mon, 25 Jan 2021 12:43:57 +0200	[thread overview]
Message-ID: <20210125104358.817072-1-nborisov@suse.com> (raw)

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


             reply	other threads:[~2021-01-26 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 10:43 Nikolay Borisov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210125104358.817072-1-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.