Created
November 15, 2023 23:30
-
-
Save tonyhutter/c87f85d97c7b06b1a171a0c2df22b9dc to your computer and use it in GitHub Desktop.
zfs_bclone_disable_zts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib | |
index 844caa17d..d5d7bb6c8 100644 | |
--- a/tests/zfs-tests/include/libtest.shlib | |
+++ b/tests/zfs-tests/include/libtest.shlib | |
@@ -3334,6 +3334,21 @@ function set_tunable_impl | |
esac | |
} | |
+function save_tunable | |
+{ | |
+ [[ ! -d $TEST_BASE_DIR ]] && return 1 | |
+ [[ -e $TEST_BASE_DIR/tunable-$1 ]] && return 2 | |
+ echo "$(get_tunable """$1""")" > "$TEST_BASE_DIR"/tunable-"$1" | |
+} | |
+ | |
+function restore_tunable | |
+{ | |
+ [[ ! -e $TEST_BASE_DIR/tunable-$1 ]] && return 1 | |
+ val="$(cat $TEST_BASE_DIR/tunable-"""$1""")" | |
+ set_tunable64 "$1" "$val" | |
+ rm $TEST_BASE_DIR/tunable-$1 | |
+} | |
+ | |
# | |
# Get a global system tunable | |
# | |
diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg | |
index fb861f1a2..f5b6e108f 100644 | |
--- a/tests/zfs-tests/include/tunables.cfg | |
+++ b/tests/zfs-tests/include/tunables.cfg | |
@@ -93,6 +93,7 @@ VOL_INHIBIT_DEV UNSUPPORTED zvol_inhibit_dev | |
VOL_MODE vol.mode zvol_volmode | |
VOL_RECURSIVE vol.recursive UNSUPPORTED | |
VOL_USE_BLK_MQ UNSUPPORTED zvol_use_blk_mq | |
+BCLONE_ENABLED UNSUPPORTED zfs_bclone_enabled | |
XATTR_COMPAT xattr_compat zfs_xattr_compat | |
ZEVENT_LEN_MAX zevent.len_max zfs_zevent_len_max | |
ZEVENT_RETAIN_MAX zevent.retain_max zfs_zevent_retain_max | |
diff --git a/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh b/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh | |
index 7ac13adb6..b985445a5 100755 | |
--- a/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh | |
+++ b/tests/zfs-tests/tests/functional/block_cloning/cleanup.ksh | |
@@ -31,4 +31,8 @@ verify_runnable "global" | |
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/block_cloning/setup.ksh b/tests/zfs-tests/tests/functional/block_cloning/setup.ksh | |
index 512f5a064..58441bf8f 100755 | |
--- a/tests/zfs-tests/tests/functional/block_cloning/setup.ksh | |
+++ b/tests/zfs-tests/tests/functional/block_cloning/setup.ksh | |
@@ -33,4 +33,9 @@ fi | |
verify_runnable "global" | |
+if tunable_exists BCLONE_ENABLED ; then | |
+ log_must save_tunable BCLONE_ENABLED | |
+ log_must set_tunable32 BCLONE_ENABLED 1 | |
+fi | |
+ | |
log_pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment