aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2024-01-22 16:14:08 -0800
committerGitHub <[email protected]>2024-01-22 16:14:08 -0800
commit435b173fd9728baf8168611f9fc57fef44f56adc (patch)
tree5eba4798ba5993d96cc5ec160f614f38d97c374c
parentd9cb42da999e77a2ea3ee5488a5ca0f4c27db2fe (diff)
ZTS: Apply zfs_bclone_enabled to bclone tests
If block cloning is disabled by default then enable it when running the bclone tests. Follow up to #15529. Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #15796
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/cleanup.ksh9
-rwxr-xr-xtests/zfs-tests/tests/functional/bclone/setup.ksh5
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/bclone/cleanup.ksh b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh
index df6d9c08f..0021ccb57 100755
--- a/tests/zfs-tests/tests/functional/bclone/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh
@@ -34,4 +34,11 @@
log_must zfs destroy $TESTSRCFS
log_must zfs destroy $TESTDSTFS
-default_cleanup
+
+default_cleanup_noexit
+
+if tunable_exists BCLONE_ENABLED ; then
+ log_must restore_tunable BCLONE_ENABLED
+fi
+
+log_pass
diff --git a/tests/zfs-tests/tests/functional/bclone/setup.ksh b/tests/zfs-tests/tests/functional/bclone/setup.ksh
index c68719ee7..9d26088c5 100755
--- a/tests/zfs-tests/tests/functional/bclone/setup.ksh
+++ b/tests/zfs-tests/tests/functional/bclone/setup.ksh
@@ -36,6 +36,11 @@ if ! command -v clonefile > /dev/null ; then
log_unsupported "clonefile program required to test block cloning"
fi
+if tunable_exists BCLONE_ENABLED ; then
+ log_must save_tunable BCLONE_ENABLED
+ log_must set_tunable32 BCLONE_ENABLED 1
+fi
+
DISK=${DISKS%% *}
default_setup_noexit $DISK "true"