diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class.kshlib b/tests/zfs-tests/tests/functional/alloc_class/alloc_class.kshlib index e204f43b3bcd..795e71b26b5a 100644 --- a/tests/zfs-tests/tests/functional/alloc_class/alloc_class.kshlib +++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class.kshlib @@ -1,68 +1,68 @@ # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2017, Intel Corporation. # Copyright (c) 2018 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/alloc_class/alloc_class.cfg function disk_setup { truncate -s $ZPOOL_DEVSIZE $ZPOOL_DISKS truncate -s $CLASS_DEVSIZE $CLASS_DISKS } function disk_cleanup { rm -f $ZPOOL_DEVSIZE $ZPOOL_DISKS 2> /dev/null rm -f $CLASS_DEVSIZE $CLASS_DISKS 2> /dev/null } function cleanup { if datasetexists $TESTPOOL ; then zpool destroy -f $TESTPOOL 2> /dev/null fi disk_cleanup } # # Try zpool status/iostat for given pool # # $1 pool # function display_status { typeset pool=$1 typeset -i ret=0 zpool status -xv $pool > /dev/null 2>&1 ret=$? zpool iostat > /dev/null 2>&1 ((ret |= $?)) typeset mntpnt=$(get_prop mountpoint $pool) - dd if=/dev/random of=$mntpnt/testfile.$$ & + dd if=/dev/urandom of=$mntpnt/testfile.$$ & typeset pid=$! zpool iostat -v 1 3 > /dev/null ((ret |= $?)) kill -9 $pid wait $pid 2> /dev/null return $ret } diff --git a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_rlimit_fsize.ksh b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_rlimit_fsize.ksh index a8a64e52491a..3632fc9a4df0 100755 --- a/tests/zfs-tests/tests/functional/block_cloning/block_cloning_rlimit_fsize.ksh +++ b/tests/zfs-tests/tests/functional/block_cloning/block_cloning_rlimit_fsize.ksh @@ -1,64 +1,64 @@ #!/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 # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/block_cloning/block_cloning.kshlib # # DESCRIPTION: # When block cloning is used to implement copy_file_range(2), the # RLIMIT_FSIZE limit must be respected. # # STRATEGY: # 1. Create a pool. # 2. ??? # verify_runnable "global" VDIR=$TEST_BASE_DIR/disk-bclone VDEV="$VDIR/a" function cleanup { datasetexists $TESTPOOL && destroy_pool $TESTPOOL rm -rf $VDIR } log_onexit cleanup log_assert "Test for RLIMIT_FSIZE handling with block cloning enabled" log_must rm -rf $VDIR log_must mkdir -p $VDIR log_must truncate -s 1G $VDEV log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $VDEV -log_must dd if=/dev/random of=/$TESTPOOL/file1 bs=1 count=1000 +log_must dd if=/dev/urandom of=/$TESTPOOL/file1 bs=1 count=1000 ulimit -f 2 log_must clonefile -f /$TESTPOOL/file1 /$TESTPOOL/file2 0 0 all ulimit -f 1 log_mustnot clonefile -f /$TESTPOOL/file1 /$TESTPOOL/file3 0 0 all log_pass "copy_file_range(2) respects RLIMIT_FSIZE" diff --git a/tests/zfs-tests/tests/functional/fault/suspend_resume_single.ksh b/tests/zfs-tests/tests/functional/fault/suspend_resume_single.ksh index 041dadb1eadb..05f3ac708477 100755 --- a/tests/zfs-tests/tests/functional/fault/suspend_resume_single.ksh +++ b/tests/zfs-tests/tests/functional/fault/suspend_resume_single.ksh @@ -1,102 +1,102 @@ #!/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 (c) 2024, Klara Inc. # . $STF_SUITE/include/libtest.shlib set -x DATAFILE="$TMPDIR/datafile" function cleanup { destroy_pool $TESTPOOL unload_scsi_debug rm -f $DATA_FILE } log_onexit cleanup log_assert "ensure single-disk pool resumes properly after suspend and clear" # create a file, and take a checksum, so we can compare later -log_must dd if=/dev/random of=$DATAFILE bs=128K count=1 +log_must dd if=/dev/urandom of=$DATAFILE bs=128K count=1 typeset sum1=$(cat $DATAFILE | md5sum) # make a debug device that we can "unplug" load_scsi_debug 100 1 1 1 '512b' sd=$(get_debug_device) # create a single-device pool log_must zpool create $TESTPOOL $sd log_must zpool sync # "pull" the disk log_must eval "echo offline > /sys/block/$sd/device/state" # copy data onto the pool. it'll appear to succeed, but only be in memory log_must cp $DATAFILE /$TESTPOOL/file # wait until sync starts, and the pool suspends log_note "waiting for pool to suspend" typeset -i tries=10 until [[ $(cat /proc/spl/kstat/zfs/$TESTPOOL/state) == "SUSPENDED" ]] ; do if ((tries-- == 0)); then log_fail "pool didn't suspend" fi sleep 1 done # return the disk log_must eval "echo running > /sys/block/$sd/device/state" # clear the error states, which should reopen the vdev, get the pool back # online, and replay the failed IO log_must zpool clear $TESTPOOL # wait a while for everything to sync out. if something is going to go wrong, # this is where it will happen log_note "giving pool time to settle and complete txg" sleep 7 # if the pool suspended, then everything is bad if [[ $(cat /proc/spl/kstat/zfs/$TESTPOOL/state) == "SUSPENDED" ]] ; then log_fail "pool suspended" fi # export the pool, to make sure it exports clean, and also to clear the file # out of the cache log_must zpool export $TESTPOOL # import the pool log_must zpool import $TESTPOOL # sum the file we wrote earlier typeset sum2=$(cat /$TESTPOOL/file | md5sum) # make sure the checksums match log_must test "$sum1" = "$sum2" log_pass "single-disk pool resumes properly after disk suspend and clear"