@@ -392,6 +392,13 @@ check_experimental_build()
fi
}
+check_regular_build()
+{
+ if _test_config "EXPERIMENTAL"; then
+ _not_run "This test requires non-experimental build"
+ fi
+}
+
check_prereq()
{
# Internal tools for testing, not shipped with the package
new file mode 100755
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Verify mkfs for all currently supported profiles of zoned + raid-stripe-tree
+
+source "$TEST_TOP/common" || exit
+
+check_regular_build
+setup_root_helper
+setup_nullbdevs 4 128 4
+prepare_nullbdevs
+TEST_DEV=${nullb_devs[1]}
+
+profiles="dup raid1 raid1c3 raid1c4 raid10"
+
+# The existing supported profiles.
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d single -m single "${nullb_devs[@]}"
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d single -m DUP "${nullb_devs[@]}"
+
+# RST feature is rejected
+run_mustfail "RST feature created" \
+ $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned,raid-stripe-tree -d single -m DUP "${nullb_devs[@]}"
+
+for dprofile in $profiles; do
+ # make sure extra data profiles won't enable RST for non-experimental build
+ run_mustfail "unsupported profile created" \
+ $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d "$dprofile" -m DUP "${nullb_devs[@]}"
+done
+
+# The old unsupported profiles should fail no matter experimental build or not.
+run_mustfail "unsupported profile raid56 created" \
+ $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d raid5 -m raid5 "${nullb_devs[@]}"
+run_mustfail "unsupported profile raid56 created" \
+ $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d raid6 -m raid6 "${nullb_devs[@]}"
+
+cleanup_nullbdevs
This test case will check the following behaivors: - Regular zoned supported data/metadata profiles Should success - RST with zoned feature Should fail for non-experimental builds - zoned with data profiles that only RST supports Should fail for non-experimental builds. Meanwhile for experimental builds it should success and enable RST feature automatically (verified in mkfs/030) Signed-off-by: Qu Wenruo <wqu@suse.com> --- tests/common | 7 ++++ tests/mkfs-tests/033-zoned-reject-rst/test.sh | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 tests/mkfs-tests/033-zoned-reject-rst/test.sh