diff options
Diffstat (limited to 'sys/contrib/openzfs/tests/zfs-tests/tests/functional')
61 files changed, 313 insertions, 165 deletions
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh index bb58a8cf2e7b..bb58a8cf2e7b 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/cleanup.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh index e6467b3470c8..e6467b3470c8 100644..120000 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_001_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh index 10140d0e87ec..10140d0e87ec 100644..120000 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_002_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh index 3f3db2807ddc..3f3db2807ddc 100644..120000 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_003_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh index 2c2bab4477bd..2c2bab4477bd 100644..120000 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/posix_004_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh index d8bf8a638e7b..d8bf8a638e7b 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/setup.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh index 6c6b592fbb9e..6c6b592fbb9e 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/Makefile.am index 18420efcb26a..d84a3dfc72a2 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/Makefile.am @@ -14,4 +14,6 @@ dist_pkgdata_SCRIPTS = \ zdb_object_range_neg.ksh \ zdb_object_range_pos.ksh \ zdb_display_block.ksh \ - zdb_objset_id.ksh + zdb_objset_id.ksh \ + zdb_recover.ksh \ + zdb_recover_2.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh index 1b0219780adc..ae948bb9b755 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_args_neg.ksh @@ -56,7 +56,7 @@ set -A args "create" "add" "destroy" "import fakepool" \ "add mirror fakepool" "add raidz fakepool" \ "add raidz1 fakepool" "add raidz2 fakepool" \ "setvprop" "blah blah" "-%" "--?" "-*" "-=" \ - "-a" "-f" "-g" "-j" "-n" "-o" "-p" "-p /tmp" "-r" \ + "-a" "-f" "-g" "-j" "-n" "-o" "-p" "-p /tmp" \ "-t" "-w" "-z" "-E" "-H" "-I" "-J" "-K" \ "-N" "-Q" "-R" "-T" "-W" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover.ksh new file mode 100755 index 000000000000..d51edf3763d4 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover.ksh @@ -0,0 +1,55 @@ +#!/bin/ksh + +# +# 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) 2021 by Allan Jude. +# + +. $STF_SUITE/include/libtest.shlib + +# +# Description: +# zdb -r <dataset> <path> <destination> +# Will extract <path> (relative to <dataset>) to the file <destination> +# Similar to -R, except it does the work for you to find each record +# +# Strategy: +# 1. Create a pool +# 2. Write some data to a file +# 3. Extract the file +# 4. Compare the file to the original +# + +function cleanup +{ + datasetexists $TESTPOOL && destroy_pool $TESTPOOL + rm $tmpfile +} + +log_assert "Verify zdb -r <dataset> <path> <dest> extract the correct data." +log_onexit cleanup +init_data=$TESTDIR/file1 +tmpfile="$TEST_BASE_DIR/zdb-recover" +write_count=8 +blksize=131072 +verify_runnable "global" +verify_disk_count "$DISKS" 2 + +default_mirror_setup_noexit $DISKS +file_write -o create -w -f $init_data -b $blksize -c $write_count +log_must zpool sync $TESTPOOL + +output=$(zdb -r $TESTPOOL/$TESTFS file1 $tmpfile) +log_must cmp $init_data $tmpfile + +log_pass "zdb -r <dataset> <path> <dest> extracts the correct data." diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover_2.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover_2.ksh new file mode 100755 index 000000000000..91f04c795638 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_recover_2.ksh @@ -0,0 +1,57 @@ +#!/bin/ksh + +# +# 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) 2021 by Allan Jude. +# + +. $STF_SUITE/include/libtest.shlib + +# +# Description: +# zdb -r <dataset> <path> <destination> +# Will extract <path> (relative to <dataset>) to the file <destination> +# Similar to -R, except it does the work for you to find each record +# +# Strategy: +# 1. Create a pool +# 2. Write some data to a file +# 3. Append to the file so it isn't an divisible by 2 +# 4. Extract the file +# 5. Compare the file to the original +# + +function cleanup +{ + datasetexists $TESTPOOL && destroy_pool $TESTPOOL + rm $tmpfile +} + +log_assert "Verify zdb -r <dataset> <path> <dest> extract the correct data." +log_onexit cleanup +init_data=$TESTDIR/file1 +tmpfile="$TEST_BASE_DIR/zdb-recover" +write_count=8 +blksize=131072 +verify_runnable "global" +verify_disk_count "$DISKS" 2 + +default_mirror_setup_noexit $DISKS +file_write -o create -w -f $init_data -b $blksize -c $write_count +log_must echo "zfs" >> $init_data +log_must zpool sync $TESTPOOL + +output=$(zdb -r $TESTPOOL/$TESTFS file1 $tmpfile) +log_must cmp $init_data $tmpfile + +log_pass "zdb -r <dataset> <path> <dest> extracts the correct data." diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_013_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_013_pos.ksh index 810a69470d34..e6a4be1577a3 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_013_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_013_pos.ksh @@ -32,7 +32,9 @@ typeset -r fs=$TESTPOOL/$TESTFS function cleanup { cd $STF_SUITE - [[ -d $TESTDIR/$$ ]] && (rm -rf $TESTDIR/$$ || log_fail) + if [[ -d $TESTDIR/$$ ]]; then + log_must rm -rf $TESTDIR/$$ + fi mounted && zfs $mountcmd $TESTPOOL return 0 } @@ -50,13 +52,25 @@ force_unmount $fs log_note "Verify mount(8) does not canonicalize before calling helper" # Canonicalization is confused by files in PWD matching [device|mountpoint] -mkdir -p $TESTDIR/$$/$TESTPOOL && cd $TESTDIR/$$ || log_fail +log_must mkdir -p $TESTDIR/$$/$TESTPOOL +log_must cd $TESTDIR/$$ # The env flag directs zfs to exec /bin/mount, which then calls helper log_must eval ZFS_MOUNT_HELPER=1 zfs $mountcmd -v $TESTPOOL # mount (2.35.2) still suffers from a cosmetic PWD prefix bug log_must mounted $TESTPOOL force_unmount $TESTPOOL +log_note "Verify CWD prefix filter <dataset> <path>" +log_must cd / +log_must zfs set mountpoint=legacy $TESTPOOL +log_must mkdir -p $mntpoint +log_must mount -t zfs $TESTPOOL $mntpoint +log_must ismounted $TESTPOOL +log_must umount $mntpoint +log_must zfs set mountpoint=$mntpoint $TESTPOOL +log_must cd - +force_unmount $TESTPOOL + log_note "Verify '-f <dataset> <path>' fakemount" log_must $helper -f $fs $mntpoint log_mustnot ismounted $fs @@ -75,4 +89,4 @@ log_note "Verify '<device> <path>'" log_must $helper ${vdevs[0]} $mntpoint log_must mounted $mntpoint -log_pass "zfs mount helper correctly handles both device and pool strings"
\ No newline at end of file +log_pass "zfs mount helper correctly handles both device and pool strings" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh index 4cbc7e339031..ce89c6835775 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh @@ -82,8 +82,8 @@ log_must zfs snapshot $init_snap log_must eval "zfs send $init_snap > $full_bkup" log_note "'zfs receive' fails with invalid send streams." -log_mustnot eval "zfs receive $rst_init_snap < /dev/zero" -log_mustnot eval "zfs receive -d $rst_root </dev/zero" +log_mustnot eval "cat </dev/zero | zfs receive $rst_init_snap" +log_mustnot eval "cat </dev/zero | zfs receive -d $rst_root" log_must eval "zfs receive $rst_init_snap < $full_bkup" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_014_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_014_pos.ksh index be04aed2b24c..989d31b9064d 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_014_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_014_pos.ksh @@ -55,31 +55,6 @@ function cleanup log_must zfs destroy -rf $dest } -# -# Verify property $2 is set from source $4 on dataset $1 and has value $3. -# -# $1 checked dataset -# $2 user property -# $3 property value -# $4 source -# -function check_prop_source -{ - typeset dataset=$1 - typeset prop=$2 - typeset value=$3 - typeset source=$4 - typeset chk_value=$(get_prop "$prop" "$dataset") - typeset chk_source=$(get_source "$prop" "$dataset") - if [[ "$chk_value" != "$value" || \ - "$chk_source" != "$4" ]] - then - return 1 - else - return 0 - fi -} - log_assert "ZFS successfully receive and restore properties." log_onexit cleanup diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh index 54f13355f5e8..54f13355f5e8 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh index 1c707762a72c..1c707762a72c 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh index 5511f6ad6db6..342c72e166a9 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_001_pos.ksh @@ -80,6 +80,7 @@ function test_n_check #opt num_snap_clone num_rollback if datasetexists $VOL; then if ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then log_must umount -f $TESTDIR1 + sleep 0.1 fi log_must zfs destroy -Rf $VOL diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh index 87997e76c245..2105bc4d23e4 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh @@ -58,13 +58,13 @@ log_must zfs set "org.openzfs:snapprop=val" "$SENDFS@s1" # 2. Verify command line options interact with '-b' correctly typeset opts=("" "p" "Rp" "cew" "nv" "D" "DLPRcenpvw") for opt in ${opts[@]}; do - log_must eval "zfs send -b$opt $SENDFS@s1 > /dev/null" - log_must eval "zfs send -b$opt -i $SENDFS@s1 $SENDFS@s2 > /dev/null" - log_must eval "zfs send -b$opt -I $SENDFS@s1 $SENDFS@s2 > /dev/null" + log_must eval "zfs send -b$opt $SENDFS@s1 >$TEST_BASE_DIR/devnull" + log_must eval "zfs send -b$opt -i $SENDFS@s1 $SENDFS@s2 >$TEST_BASE_DIR/devnull" + log_must eval "zfs send -b$opt -I $SENDFS@s1 $SENDFS@s2 >$TEST_BASE_DIR/devnull" done for opt in ${opts[@]}; do - log_mustnot eval "zfs send -b$opt $SENDFS > /dev/null" - log_mustnot eval "zfs send -b$opt $SENDFS#bm > /dev/null" + log_mustnot eval "zfs send -b$opt $SENDFS >$TEST_BASE_DIR/devnull" + log_mustnot eval "zfs send -b$opt $SENDFS#bm >$TEST_BASE_DIR/devnull" done # Do 3..6 in a loop to verify various combination of "zfs send" options diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh index 825a10d0f8a2..0b55254f75d6 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh @@ -61,7 +61,7 @@ log_must zfs snapshot $snap2 typeset -i i=0 while (( i < ${#args[*]} )); do - log_must eval "zfs send -i ${args[i]} > /dev/null" + log_must eval "zfs send -i ${args[i]} >$TEST_BASE_DIR/devnull" (( i += 1 )) done diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh index 4a9d29fce1cf..dfa9fc251d6b 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh @@ -96,7 +96,7 @@ log_must zfs snapshot $snap3 typeset -i i=0 while (( i < ${#badargs[*]} )) do - log_mustnot eval "zfs send ${badargs[i]} >/dev/null" + log_mustnot eval "zfs send ${badargs[i]} >$TEST_BASE_DIR/devnull" (( i = i + 1 )) done diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh index 9f369e372dee..c9e37cbbad8e 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh @@ -61,6 +61,6 @@ log_must zfs snapshot -r $TESTPOOL@snap log_must zpool export $TESTPOOL log_must zpool import -o readonly=on $TESTPOOL -log_must eval "zfs send -R $TESTPOOL@snap >/dev/null" +log_must eval "zfs send -R $TESTPOOL@snap >$TEST_BASE_DIR/devnull" log_pass "'zfs send -R' can send from read-only pools" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted.ksh index 490e146ba6f0..1e63b29ade1f 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted.ksh @@ -62,15 +62,15 @@ log_must eval "echo $passphrase1 | zfs create -o encryption=on" \ log_must zfs snapshot -r $snap -log_must eval "zfs send $snap > /dev/null" -log_mustnot eval "zfs send -p $snap > /dev/null" -log_mustnot eval "zfs send -R $snap > /dev/null" +log_must eval "zfs send $snap >$TEST_BASE_DIR/devnull" +log_mustnot eval "zfs send -p $snap >$TEST_BASE_DIR/devnull" +log_mustnot eval "zfs send -R $snap >$TEST_BASE_DIR/devnull" log_must zfs unmount $TESTPOOL/$TESTFS1 log_must zfs unload-key $TESTPOOL/$TESTFS1 -log_mustnot eval "zfs send $snap > /dev/null" -log_must eval "zfs send $TESTPOOL/$TESTFS1/child@snap > /dev/null" +log_mustnot eval "zfs send $snap >$TEST_BASE_DIR/devnull" +log_must eval "zfs send $TESTPOOL/$TESTFS1/child@snap >$TEST_BASE_DIR/devnull" log_pass "ZFS performs unencrypted sends of encrypted datasets, unless the" \ "'-p' or '-R' options are specified" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted_unloaded.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted_unloaded.ksh index 112ee1143d10..9d59494fc635 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted_unloaded.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted_unloaded.ksh @@ -53,7 +53,7 @@ log_must eval "echo $passphrase | zfs create -o encryption=on" \ log_must zfs snapshot $snap log_must zfs unmount $TESTPOOL/$TESTFS1 log_must zfs unload-key $TESTPOOL/$TESTFS1 -log_mustnot eval "zfs send $snap > /dev/null" +log_mustnot eval "zfs send $snap >$TEST_BASE_DIR/devnull" log_pass "ZFS does not perform unencrypted sends from encrypted datasets" \ "with unloaded keys." diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_raw.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_raw.ksh index 85cc7407e1a1..065eea3ebd86 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_raw.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_raw.ksh @@ -59,21 +59,21 @@ log_must eval "echo $passphrase | zfs create -o encryption=on" \ log_must zfs snapshot $snap log_must zfs snapshot $snap1 -log_must eval "zfs send -w $snap > /dev/null" -log_must eval "zfs send -w $snap1 > /dev/null" +log_must eval "zfs send -w $snap >$TEST_BASE_DIR/devnull" +log_must eval "zfs send -w $snap1 >$TEST_BASE_DIR/devnull" log_note "Verify ZFS can perform raw sends with properties" -log_must eval "zfs send -wp $snap > /dev/null" -log_must eval "zfs send -wp $snap1 > /dev/null" +log_must eval "zfs send -wp $snap >$TEST_BASE_DIR/devnull" +log_must eval "zfs send -wp $snap1 >$TEST_BASE_DIR/devnull" log_note "Verify ZFS can perform raw replication sends" -log_must eval "zfs send -wR $snap > /dev/null" -log_must eval "zfs send -wR $snap1 > /dev/null" +log_must eval "zfs send -wR $snap >$TEST_BASE_DIR/devnull" +log_must eval "zfs send -wR $snap1 >$TEST_BASE_DIR/devnull" log_note "Verify ZFS can perform a raw send of an encrypted datasets with" \ "its key unloaded" log_must zfs unmount $TESTPOOL/$TESTFS1 log_must zfs unload-key $TESTPOOL/$TESTFS1 -log_must eval "zfs send -w $snap1 > /dev/null" +log_must eval "zfs send -w $snap1 >$TEST_BASE_DIR/devnull" log_pass "ZFS performs raw sends of datasets" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib index 5e9f719dfcfe..12082076322c 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib @@ -287,12 +287,14 @@ function check_prop_source typeset chk_value=$(get_prop "$prop" "$dataset") typeset chk_source=$(get_source "$prop" "$dataset") - if [[ "$chk_value" != "$value" || "$chk_source" != "$4" ]] - then - return 1 - else - return 0 - fi + if [[ "$chk_value" != "$value" || "$chk_source" != "$source" ]] + then + log_note "expected (value '$value', source '$source'), got \ + (value '$chk_value', source '$chk_source')" + return 1 + else + return 0 + fi } # diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/draidcfg.gz b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/draidcfg.gz Binary files differnew file mode 100644 index 000000000000..b8c0a583c073 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/draidcfg.gz diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh index 1ba7b1b34496..1ba7b1b34496 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/Makefile.am index 86452e8acc6e..1c06d5b59e9b 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/Makefile.am @@ -8,4 +8,5 @@ dist_pkgdata_SCRIPTS = \ zpool_export_004_pos.ksh dist_pkgdata_DATA = \ - zpool_export.cfg + zpool_export.cfg \ + zpool_export.kshlib diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh index 664fb2ddd8ca..023920dae1e9 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/setup.ksh @@ -30,8 +30,4 @@ DISK=${DISKS%% *} -if ! is_physical_device $DISK; then - log_unsupported "Only partitionable physical disks can be used" -fi - default_setup $DISK diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg index 1501c0463015..8bfb067c7aac 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.cfg @@ -30,30 +30,15 @@ . $STF_SUITE/include/libtest.shlib -export DISK_ARRAY_NUM=0 -export DISK_ARRAY_LIMIT=4 -export DISKSARRAY="" -export VDEVS_NUM=32 +export DISK_ARRAY_NUM=$(echo ${DISKS} | nawk '{print NF}') +export DISK1=$(echo $DISKS | awk '{print $1}') +export DISK2=$(echo $DISKS | awk '{print $3}') -function set_disks -{ - typeset -a disk_array=($(find_disks $DISKS)) - - if (( ${#disk_array[*]} <= 1 )); then - export DISK=${DISKS%% *} - else - export DISK="" - typeset -i i=0 - while (( i < ${#disk_array[*]} )); do - export DISK${i}="${disk_array[$i]}" - DISKSARRAY="$DISKSARRAY ${disk_array[$i]}" - (( i = i + 1 )) - (( i>$DISK_ARRAY_LIMIT )) && break - done - export DISK_ARRAY_NUM=$i - export DISKSARRAY - fi -} - -set_disks -set_device_dir +if is_linux; then + set_slice_prefix + set_device_dir + devs_id[0]=$(get_persistent_disk_name $DISK1) + devs_id[1]=$(get_persistent_disk_name $DISK2) +else + DEV_DSKDIR="/dev" +fi diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib new file mode 100644 index 000000000000..5484f20674d5 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib @@ -0,0 +1,32 @@ +# +# 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 http://www.opensolaris.org/os/licensing. +# 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) 2020, Klara Systems, Inc. All rights reserved. +# + +. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.cfg + +function zpool_export_cleanup +{ + [[ -d $TESTDIR0 ]] && log_must rm -rf $TESTDIR0 + default_cleanup +} diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh index b6823553d727..111453c7a161 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_001_pos.ksh @@ -29,8 +29,7 @@ # Copyright (c) 2016 by Delphix. All rights reserved. # -. $STF_SUITE/include/libtest.shlib -. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.cfg +. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.kshlib # # DESCRIPTION: @@ -46,19 +45,7 @@ verify_runnable "global" -function cleanup -{ - typeset dir=$(get_device_dir $DISKS) - - datasetexists "$TESTPOOL/$TESTFS" || \ - log_must zpool import -d $dir $TESTPOOL - - ismounted "$TESTPOOL/$TESTFS" - (( $? != 0 )) && \ - log_must zfs mount $TESTPOOL/$TESTFS -} - -log_onexit cleanup +log_onexit zpool_export_cleanup log_assert "Verify a pool can be exported." diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh index 81473d903aa4..8040d12b92d2 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh @@ -29,7 +29,7 @@ # Copyright (c) 2016 by Delphix. All rights reserved. # -. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.kshlib # # DESCRIPTION: @@ -45,19 +45,10 @@ verify_runnable "global" function cleanup { - typeset dir=$(get_device_dir $DISKS) cd $olddir || \ log_fail "Couldn't cd back to $olddir" - datasetexists "$TESTPOOL/$TESTFS" || \ - log_must zpool import -d $dir $TESTPOOL - - ismounted "$TESTPOOL/$TESTFS" - (( $? != 0 )) && \ - log_must zfs mount $TESTPOOL/$TESTFS - - [[ -e $TESTDIR/$TESTFILE0 ]] && \ - log_must rm -rf $TESTDIR/$TESTFILE0 + zpool_export_cleanup } olddir=$PWD diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh index b188f9c3304a..a2ee7fbdf908 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_003_neg.ksh @@ -29,7 +29,7 @@ # Copyright (c) 2016 by Delphix. All rights reserved. # -. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.kshlib # # DESCRIPTION: @@ -43,18 +43,7 @@ verify_runnable "global" -function cleanup -{ - typeset dir=$(get_device_dir $DISKS) - datasetexists "$TESTPOOL/$TESTFS" || \ - log_must zpool import -d $dir $TESTPOOL - - ismounted "$TESTPOOL/$TESTFS" - (( $? != 0 )) && \ - log_must zfs mount $TESTPOOL/$TESTFS -} - -log_onexit cleanup +log_onexit zpool_export_cleanup set -A args "" "-f" "-? $TESTPOOL" "-QWERTYUIO $TESTPOOL" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh index 0f1a7c624df7..9be3f23c4fda 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_004_pos.ksh @@ -29,7 +29,7 @@ # Copyright (c) 2012, 2016 by Delphix. All rights reserved. # -. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.kshlib # # DESCRIPTION: @@ -50,25 +50,8 @@ verify_runnable "global" -function cleanup -{ - mntpnt=$TESTDIR0 - datasetexists $TESTPOOL1 || log_must zpool import -d $mntpnt $TESTPOOL1 - datasetexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - datasetexists $TESTPOOL2 && destroy_pool $TESTPOOL2 - typeset -i i=0 - while ((i < 5)); do - if [[ -e $mntpnt/vdev$i ]]; then - log_must rm -f $mntpnt/vdev$i - fi - ((i += 1)) - done - log_must rmdir $mntpnt -} - - log_assert "Verify zpool export succeed or fail with spare." -log_onexit cleanup +log_onexit zpool_export_cleanup mntpnt=$TESTDIR0 log_must mkdir -p $mntpnt diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/Makefile.am index 5253f08a0540..44c0d02d6efe 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/Makefile.am @@ -5,6 +5,7 @@ dist_pkgdata_SCRIPTS = \ sync.ksh \ psync.ksh \ libaio.ksh \ + io_uring.ksh \ posixaio.ksh \ mmap.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/io_uring.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/io_uring.ksh new file mode 100755 index 000000000000..2d2b18f8bb5b --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/io/io_uring.ksh @@ -0,0 +1,72 @@ +#! /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 http://www.opensolaris.org/os/licensing. +# 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) 2018 by Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/io/io.cfg + +# +# DESCRIPTION: +# Verify Linux io_uring. +# +# STRATEGY: +# 1. Use fio(1) in verify mode to perform write, read, +# random read, and random write workloads. +# 2. Repeat the test with additional fio(1) options. +# + +verify_runnable "global" + + +if [[ $(linux_version) -lt $(linux_version "5.1") ]]; then + log_unsupported "Requires io_uring support" +fi + +fio --ioengine=io_uring --parse-only || log_unsupported "io_uring support required" + +function cleanup +{ + log_must rm -f "$mntpnt/rw*" +} + +log_assert "Verify Linux io_uring" + +log_onexit cleanup + +ioengine="--ioengine=io_uring" +mntpnt=$(get_prop mountpoint $TESTPOOL/$TESTFS) +dir="--directory=$mntpnt" + +set -A fio_arg -- "--sync=0" "--sync=1" "--direct=0" "--direct=1" + +for arg in "${fio_arg[@]}"; do + log_must fio $dir $ioengine $arg $FIO_WRITE_ARGS + log_must fio $dir $ioengine $arg $FIO_READ_ARGS + log_must fio $dir $ioengine $arg $FIO_RANDWRITE_ARGS + log_must fio $dir $ioengine $arg $FIO_RANDREAD_ARGS + log_must rm -f "$mntpnt/rw*" +done + +log_pass "Verified Linux io_uring" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/Makefile.am index 9baf580eeadb..9baf580eeadb 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/Makefile.am diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/cleanup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/cleanup.ksh index c3d88e3ffc71..c3d88e3ffc71 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/cleanup.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc.cfg b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/l2arc.cfg index 0302392f4c7f..0302392f4c7f 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc.cfg +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/l2arc.cfg diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh index 0a9049490c71..0a9049490c71 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_001_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_002_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_002_pos.ksh index 93982e6c605b..93982e6c605b 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_002_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_003_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_003_neg.ksh index fe35c8fc4500..fe35c8fc4500 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_003_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_003_neg.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_004_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_004_pos.ksh index 544e9291de29..544e9291de29 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_004_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_004_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_005_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_005_pos.ksh index ee46e7b8cad6..ee46e7b8cad6 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_005_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_005_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_006_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_006_pos.ksh index 051773540233..051773540233 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_006_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_006_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_007_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_007_pos.ksh index 9208b81d4905..9208b81d4905 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_007_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_007_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_008_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_008_pos.ksh index 5a79ff31ba7e..5a79ff31ba7e 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/persist_l2arc_008_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/persist_l2arc_008_pos.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/setup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/setup.ksh index 0df61a9d2761..0df61a9d2761 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/persist_l2arc/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/l2arc/setup.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/procfs/pool_state.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/procfs/pool_state.ksh index f4df839be637..080fdddb2d8f 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/procfs/pool_state.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/procfs/pool_state.ksh @@ -61,16 +61,18 @@ function cleanup log_must rm -f $BACKUP fi - # Our disk is back. Now we can clear errors and destroy the - # pool cleanly. - log_must zpool clear $TESTPOOL2 + if poolexists $TESTPOOL2 ; then + # Our disk is back. Now we can clear errors and destroy the + # pool cleanly. + log_must zpool clear $TESTPOOL2 - # Now that the disk is back and errors cleared, wait for our - # hung 'zpool scrub' to finish. - wait + # Now that the disk is back and errors cleared, wait for our + # hung 'zpool scrub' to finish. + wait - destroy_pool $TESTPOOL2 - log_must rm $REALDISK + destroy_pool $TESTPOOL2 + fi + log_must rm -f $REALDISK unload_scsi_debug fi } diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh index 432460fa2fcd..e591cca0bbde 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh @@ -45,11 +45,11 @@ log_must zfs snapshot $clone2@snap # Incompatible flags log_must zfs redact $sendfs@snap2 book $clone1@snap -log_mustnot eval "zfs send -R --redact book $sendfs@snap2 >/dev/null" +log_mustnot eval "zfs send -R --redact book $sendfs@snap2 >$TEST_BASE_DIR/devnull" typeset arg for arg in "$sendfs" "$clone1#book"; do - log_mustnot eval "zfs send --redact book $arg >/dev/null" + log_mustnot eval "zfs send --redact book $arg >$TEST_BASE_DIR/devnull" done # Bad redaction list arguments @@ -58,7 +58,7 @@ log_mustnot zfs redact $sendfs@snap1 book log_mustnot zfs redact $sendfs#book1 book4 $clone1 log_mustnot zfs redact $sendfs@snap1 book snap2 snap3 log_mustnot zfs redact $sendfs@snap1 book @snap2 @snap3 -log_mustnot eval "zfs send --redact $sendfs#book $sendfs@snap >/dev/null" +log_mustnot eval "zfs send --redact $sendfs#book $sendfs@snap >$TEST_BASE_DIR/devnull" # Redaction snapshots not a descendant of tosnap log_mustnot zfs redact $sendfs@snap2 book $sendfs@snap2 @@ -66,7 +66,7 @@ log_must zfs redact $sendfs@snap2 book2 $clone1@snap $clone2@snap log_must eval "zfs send --redact book2 $sendfs@snap2 >$stream" log_must zfs redact $sendfs@snap2 book3 $clone1@snap $clone2@snap log_must eval "zfs send -i $sendfs@snap1 --redact book3 $sendfs@snap2 \ - >/dev/null" + >$TEST_BASE_DIR/devnull" log_mustnot zfs redact $sendfs@snap3 $sendfs@snap3 $clone1@snap # Full redacted sends of redacted datasets are not allowed. diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh index 8118ea59ec8b..4ab04a0e5730 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh @@ -81,7 +81,7 @@ log_must eval "zfs send --redact book1 $sendfs@snap >$stream" dd if=$stream bs=64k count=1 | log_mustnot zfs receive -s $recvfs [[ "-" = $(get_prop receive_resume_token $recvfs) ]] && \ log_fail "Receive token not found." -log_mustnot eval "zfs send --saved --redact book1 $recvfs > /dev/null" +log_mustnot eval "zfs send --saved --redact book1 $recvfs >$TEST_BASE_DIR/devnull" log_must zfs recv -A $recvfs log_must datasetnonexists $recvfs diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_003_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh index b7b791b248ee..b7b791b248ee 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_003_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_mirror.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh index a73890e4cc05..a73890e4cc05 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz1.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_002_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh index 94b9b8825154..94b9b8825154 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_raidz2.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_004_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh index 7ee51051ea1a..7ee51051ea1a 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_004_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_stripe.ksh diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/removal/removal_with_send.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/removal/removal_with_send.ksh index 59e66aca5256..a08247838105 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/removal/removal_with_send.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/removal/removal_with_send.ksh @@ -28,7 +28,7 @@ function callback { create_snapshot $TESTPOOL/$TESTFS $TESTSNAP log_must ksh -c \ - "zfs send $TESTPOOL/$TESTFS@$TESTSNAP >/dev/null" + "zfs send $TESTPOOL/$TESTFS@$TESTSNAP >$TEST_BASE_DIR/devnull" return 0 } diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh index a0abe64b4cca..2ce7ee4a082f 100644..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh @@ -44,7 +44,7 @@ log_must zfs snap $testfs@snap0 log_must zfs snap $testfs@snap1 # Test bad send with the CLI -log_mustnot eval "zfs send -i $testfs@snap1 $testfs@snap0 >/dev/null" +log_mustnot eval "zfs send -i $testfs@snap1 $testfs@snap0 >$TEST_BASE_DIR/devnull" # Test bad send with libzfs/libzfs_core log_must badsend $testfs@snap0 $testfs@snap1 diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_partial_dataset.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_partial_dataset.ksh index d5eb9a0edc11..c390327a5b57 100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_partial_dataset.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_partial_dataset.ksh @@ -103,7 +103,7 @@ set -A badargs \ while (( i < ${#badargs[*]} )) do - log_mustnot eval "zfs send --saved ${badargs[i]} >/dev/null" + log_mustnot eval "zfs send --saved ${badargs[i]} >$TEST_BASE_DIR/devnull" (( i = i + 1 )) done diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/userquota/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/userquota/Makefile.am index 9100e4adadca..2c94d3e1521c 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/userquota/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/userquota/Makefile.am @@ -21,7 +21,8 @@ dist_pkgdata_SCRIPTS = \ userspace_001_pos.ksh \ userspace_002_pos.ksh \ userspace_003_pos.ksh \ - userspace_encrypted.ksh + userspace_encrypted.ksh \ + userspace_send_encrypted.ksh dist_pkgdata_DATA = \ userquota.cfg \ diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg index 2ea8a4c72703..54ecc18b5585 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap.cfg @@ -35,6 +35,8 @@ # if is_linux; then SAVESWAPDEVS=$(swapon -s | nawk '(NR != 1) {print $1}') +elif is_freebsd; then + SAVESWAPDEVS=$(swapctl -l | nawk '(NR != 1) {print $1}') else SAVESWAPDEVS=$(swap -l | nawk '(NR != 1) {print $1}') fi |