diff --git a/tests/zfs-tests/tests/functional/bclone/cleanup.ksh b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh index df6d9c08fece..0021ccb57ae0 100755 --- a/tests/zfs-tests/tests/functional/bclone/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/bclone/cleanup.ksh @@ -1,37 +1,44 @@ #!/bin/ksh -p # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or https://opensource.org/licenses/CDDL-1.0. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # Copyright (c) 2013 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/bclone/bclone.cfg 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 c68719ee72a2..9d26088c5a8a 100755 --- a/tests/zfs-tests/tests/functional/bclone/setup.ksh +++ b/tests/zfs-tests/tests/functional/bclone/setup.ksh @@ -1,45 +1,50 @@ #!/bin/ksh -p # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or https://opensource.org/licenses/CDDL-1.0. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # Copyright (c) 2023 by Pawel Jakub Dawidek # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/bclone/bclone.cfg 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" log_must zpool set feature@block_cloning=enabled $TESTPOOL log_must zfs create $TESTSRCFS log_must zfs create $TESTDSTFS log_pass