From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 7/7] btrfs-progs: tests/cli: add a test case for "btrfs tune" subcommand
Date: Tue, 5 Sep 2023 15:51:49 +0800 [thread overview]
Message-ID: <a6b13566318a0d002ca98e90b5494d22ecea4811.1693900169.git.wqu@suse.com> (raw)
In-Reply-To: <cover.1693900169.git.wqu@suse.com>
The new test case would test all supported features of both set and
clear subcommands.
Also test the error handling of unknown features.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
tests/cli-tests/018-btrfs-tune/test.sh | 40 ++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100755 tests/cli-tests/018-btrfs-tune/test.sh
diff --git a/tests/cli-tests/018-btrfs-tune/test.sh b/tests/cli-tests/018-btrfs-tune/test.sh
new file mode 100755
index 000000000000..3b2d1ebb3e59
--- /dev/null
+++ b/tests/cli-tests/018-btrfs-tune/test.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# test all command line options of btrfstune
+
+source "$TEST_TOP/common" || exit
+
+check_prereq btrfstune
+
+setup_root_helper
+prepare_test_dev
+
+run_mayfail "$TOP/btrfstune" || true
+run_check "$TOP/btrfstune" --help
+
+run_mustfail "must not work on non-existent device" \
+ "$TOP/btrfstune" -r file-does-not-exist
+
+run_check_mkfs_test_dev -O ^extref
+run_check "$TOP/btrfs" tune set extref "$TEST_DEV"
+run_check "$TOP/btrfs" check "$TEST_DEV"
+
+run_check_mkfs_test_dev -O ^skinny-metadata
+run_check "$TOP/btrfs" tune set skinny-metadata "$TEST_DEV"
+run_check "$TOP/btrfs" check "$TEST_DEV"
+
+run_check_mkfs_test_dev -O ^no-holes
+run_check "$TOP/btrfs" tune set no-holes "$TEST_DEV"
+run_check "$TOP/btrfs" check "$TEST_DEV"
+
+run_check_mkfs_test_dev -O ^block-group-tree
+run_check "$TOP/btrfs" tune set block-group-tree "$TEST_DEV"
+run_check "$TOP/btrfs" check "$TEST_DEV"
+run_check "$TOP/btrfs" tune clear block-group-tree "$TEST_DEV"
+run_check "$TOP/btrfs" check "$TEST_DEV"
+
+run_check_mkfs_test_dev
+run_check "$TOP/btrfs" tune set -f seed "$TEST_DEV"
+run_check "$TOP/btrfs" tune clear seed "$TEST_DEV"
+
+run_mustfail "Unknown features" "$TOP/btrfs" tune set unknown-feature "$TEST_DEV"
+run_mustfail "Unknown features" "$TOP/btrfs" tune clear unknown-feature "$TEST_DEV"
--
2.42.0
next prev parent reply other threads:[~2023-09-05 16:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 7:51 [PATCH 0/7] btrfs-progs: cmds/tune: add set/clear features Qu Wenruo
2023-09-05 7:51 ` [PATCH 1/7] btrfs-progs: export btrfs_feature structure Qu Wenruo
2023-09-21 0:32 ` Anand Jain
2023-09-21 21:35 ` Qu Wenruo
2023-09-05 7:51 ` [PATCH 2/7] btrfs-progs: cmds: add "btrfs tune set" subcommand group Qu Wenruo
2023-09-21 0:53 ` Anand Jain
2023-09-21 2:13 ` Qu Wenruo
2023-10-13 17:47 ` David Sterba
2023-10-30 8:26 ` Anand Jain
2023-09-05 7:51 ` [PATCH 3/7] btrfs-progs: cmds/tune: add set support for free-space-tree feature Qu Wenruo
2023-09-05 7:51 ` [PATCH 4/7] btrfs-progs: cmds/tune: add set support for block-group-tree feature Qu Wenruo
2023-09-05 7:51 ` [PATCH 5/7] btrfs-progs: cmds/tune: add set support for seeding device Qu Wenruo
2023-09-05 7:51 ` [PATCH 6/7] btrfs-progs: cmds/tune: add "btrfs tune clear" subcommand Qu Wenruo
2023-09-05 7:51 ` Qu Wenruo [this message]
2023-09-20 23:03 ` [PATCH 0/7] btrfs-progs: cmds/tune: add set/clear features Qu Wenruo
2023-09-21 22:33 ` waxhead
2023-09-21 22:53 ` Qu Wenruo
2023-10-13 17:55 ` David Sterba
2023-10-13 18:50 ` David Sterba
2023-10-13 20:53 ` Qu Wenruo
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=a6b13566318a0d002ca98e90b5494d22ecea4811.1693900169.git.wqu@suse.com \
--to=wqu@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 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).