diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index a358b55785..9415edbe0c 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -184,11 +184,9 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos', 'zfs_set_002_neg', 'zfs_set_003_neg', 'property_alias_001_pos', 'mountpoint_003_pos', 'ro_props_001_pos'] -# DISABLED: -# zfs_share_005_pos - needs investigation, probably unsupported NFS share format [tests/functional/cli_root/zfs_share] tests = ['zfs_share_001_pos', 'zfs_share_002_pos', 'zfs_share_003_pos', - 'zfs_share_004_pos', 'zfs_share_006_pos', + 'zfs_share_004_pos', 'zfs_share_005_pos', 'zfs_share_006_pos', 'zfs_share_007_neg', 'zfs_share_008_neg', 'zfs_share_009_neg', 'zfs_share_010_neg', 'zfs_share_011_pos'] diff --git a/tests/zfs-tests/include/default.cfg b/tests/zfs-tests/include/default.cfg index 63104a8b76..83c3ec47c6 100644 --- a/tests/zfs-tests/include/default.cfg +++ b/tests/zfs-tests/include/default.cfg @@ -70,23 +70,28 @@ export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts # some test pool names -export TESTPOOL=testpool.$$ -export TESTPOOL1=testpool1.$$ -export TESTPOOL2=testpool2.$$ -export TESTPOOL3=testpool3.$$ +export TESTPOOL=testpool +export TESTPOOL1=testpool1 +export TESTPOOL2=testpool2 +export TESTPOOL3=testpool3 export PERFPOOL=perfpool # some test file system names -export TESTFS=testfs.$$ -export TESTFS1=testfs1.$$ -export TESTFS2=testfs2.$$ -export TESTFS3=testfs3.$$ +export TESTFS=testfs +export TESTFS1=testfs1 +export TESTFS2=testfs2 +export TESTFS3=testfs3 # some test directory names -export TESTDIR=${TEST_BASE_DIR%%/}/testdir$$ -export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$ -export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$ -export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$ +export TESTDIR=${TEST_BASE_DIR%%/}/testdir +export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0 +export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1 +export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2 + +# some test sub file system names +export TESTSUBFS=subfs +export TESTSUBFS1=subfs1 +export TESTSUBFS2=subfs2 # some temp files export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$ @@ -96,23 +101,23 @@ export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$ export ZFSROOT= -export TESTSNAP=testsnap$$ -export TESTSNAP1=testsnap1$$ -export TESTSNAP2=testsnap2$$ -export TESTCLONE=testclone$$ -export TESTCLONE1=testclone1$$ -export TESTCLONE2=testclone2$$ -export TESTCLCT=testclct$$ -export TESTCTR=testctr$$ -export TESTCTR1=testctr1$$ -export TESTCTR2=testctr2$$ -export TESTVOL=testvol$$ -export TESTVOL1=testvol1$$ -export TESTVOL2=testvol2$$ -export TESTFILE0=testfile0.$$ -export TESTFILE1=testfile1.$$ -export TESTFILE2=testfile2.$$ -export TESTBKMARK=testbkmark$$ +export TESTSNAP=testsnap +export TESTSNAP1=testsnap1 +export TESTSNAP2=testsnap2 +export TESTCLONE=testclone +export TESTCLONE1=testclone1 +export TESTCLONE2=testclone2 +export TESTCLCT=testclct +export TESTCTR=testctr +export TESTCTR1=testctr1 +export TESTCTR2=testctr2 +export TESTVOL=testvol +export TESTVOL1=testvol1 +export TESTVOL2=testvol2 +export TESTFILE0=testfile0 +export TESTFILE1=testfile1 +export TESTFILE2=testfile2 +export TESTBKMARK=testbkmark export LONGPNAME="poolname50charslong_012345678901234567890123456789" export LONGFSNAME="fsysname50charslong_012345678901234567890123456789" diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh index 3147a7a14a..8d2061b31c 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh @@ -42,7 +42,7 @@ function cleanup zfs destroy -rf $TESTPOOL/recvfs rm $streamfile rm $vdev - zpool destroy testpool + zpool destroy tmp_pool } @@ -88,12 +88,11 @@ test_pool () test_pool $TESTPOOL log_must truncate --size=1G $vdev -log_must zpool create -o version=1 testpool $vdev -test_pool testpool -log_must zpool destroy testpool -log_must zpool create -d testpool $vdev -test_pool testpool -log_must zpool destroy testpool - +log_must zpool create -o version=1 tmp_pool $vdev +test_pool tmp_pool +log_must zpool destroy tmp_pool +log_must zpool create -d tmp_pool $vdev +test_pool tmp_pool +log_must zpool destroy tmp_pool log_pass "'zfs send' drills appropriate holes" diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh index 7638660e3d..a2c06e0b38 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh @@ -47,9 +47,9 @@ verify_runnable "global" set -A fs \ - "$TESTDIR" "$TESTPOOL/$TESTFS" \ "$TESTDIR1" "$TESTPOOL/$TESTCTR/$TESTFS1" \ - "$TESTDIR2" "$TESTPOOL/$TESTFS-clone" + "$TESTDIR2" "$TESTPOOL/$TESTFS-clone" \ + "$TESTDIR" "$TESTPOOL/$TESTFS" function cleanup { diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh index 006517d01e..013e04ba31 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_005_pos.ksh @@ -50,12 +50,17 @@ function cleanup log_must unshare_fs $TESTPOOL/$TESTFS } -set -A shareopts \ - "ro" "ro=machine1" "ro=machine1:machine2" \ - "rw" "rw=machine1" "rw=machine1:machine2" \ - "ro=machine1:machine2,rw" "anon=0" "anon=0,sec=sys,rw" \ - "nosuid" "root=machine1:machine2" "rw=.mydomain.mycompany.com" \ - "rw=-terra:engineering" "log" "public" +if is_linux; then + set -A shareopts \ + "ro" "rw" "rw,insecure" "rw,async" "ro,crossmnt" +else + set -A shareopts \ + "ro" "ro=machine1" "ro=machine1:machine2" \ + "rw" "rw=machine1" "rw=machine1:machine2" \ + "ro=machine1:machine2,rw" "anon=0" "anon=0,sec=sys,rw" \ + "nosuid" "root=machine1:machine2" "rw=.mydomain.mycompany.com" \ + "rw=-terra:engineering" "log" "public" +fi log_assert "Verify that NFS share options are propagated correctly." log_onexit cleanup @@ -72,6 +77,11 @@ do log_fail "get sharenfs failed. ($option != ${shareopts[i]})" fi + # Verify the single option after the leading 'ro' or 'rw'. + if is_linux; then + option=`echo "$option" | cut -f2 -d','` + fi + showshares_nfs | grep $option > /dev/null 2>&1 if (( $? != 0 )); then log_fail "The '$option' option was not found in share output." diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh index ea4ea0caf8..6d8db3b674 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh @@ -164,10 +164,11 @@ done VDEV_FILE=$(mktemp /tmp/tmp.XXXXXX) log_must mkfile -n 128M $VDEV_FILE -log_must zpool create testpool $VDEV_FILE -log_must zfs create testpool/testfs -ID=$(zpool get -Ho value guid testpool) -log_must zpool export testpool -log_mustnot zpool import $(echo id) $(printf "%*s\n" 250 "" | tr ' ' 'c') +log_must zpool create overflow $VDEV_FILE +log_must zfs create overflow/testfs +ID=$(zpool get -Ho value guid overflow) +log_must zpool export overflow +log_mustnot zpool import -d /tmp $(echo id) \ + $(printf "%*s\n" 250 "" | tr ' ' 'c') log_pass "Successfully imported and renamed a ZPOOL" diff --git a/tests/zfs-tests/tests/functional/rsend/cleanup.ksh b/tests/zfs-tests/tests/functional/rsend/cleanup.ksh index 17a3e09a73..063fe9dd1f 100755 --- a/tests/zfs-tests/tests/functional/rsend/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/rsend/cleanup.ksh @@ -36,9 +36,11 @@ verify_runnable "both" if is_global_zone ; then destroy_pool $POOL destroy_pool $POOL2 + poolexists $POOL3 && destroy_pool $POOL3 else cleanup_pool $POOL cleanup_pool $POOL2 + poolexists $POOL3 && cleanup_pool $POOL3 fi log_must rm -rf $BACKDIR $TESTDIR diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.cfg b/tests/zfs-tests/tests/functional/rsend/rsend.cfg index 064a6e7caf..8984ee2a70 100644 --- a/tests/zfs-tests/tests/functional/rsend/rsend.cfg +++ b/tests/zfs-tests/tests/functional/rsend/rsend.cfg @@ -31,7 +31,9 @@ export BACKDIR=${TEST_BASE_DIR%%/}/backdir-rsend export DISK1=${DISKS%% *} export DISK2=$(echo $DISKS | awk '{print $2}') +export DISK3=$(echo $DISKS | awk '{print $3}') export POOL=$TESTPOOL export POOL2=$TESTPOOL1 +export POOL3=$TESTPOOL2 export FS=$TESTFS diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib index 784d0f75a4..ac07dcf90c 100644 --- a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib +++ b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib @@ -120,7 +120,7 @@ function cleanup_pool if is_global_zone ; then log_must zfs destroy -Rf $pool else - typeset list=$(zfs list -H -r -t filesystem,snapshot,volume -o name $pool) + typeset list=$(zfs list -H -r -t all -o name $pool) for ds in $list ; do if [[ $ds != $pool ]] ; then if datasetexists $ds ; then @@ -140,12 +140,18 @@ function cleanup_pool log_must zfs mount $pool fi if [[ -d $mntpnt ]]; then - log_must rm -rf $mntpnt/* + rm -rf $mntpnt/* fi return 0 } +function cleanup_pools +{ + cleanup_pool $POOL2 + destroy_pool $POOL3 +} + # # Detect if the given two filesystems have same sub-datasets # @@ -157,8 +163,8 @@ function cmp_ds_subs typeset src_fs=$1 typeset dst_fs=$2 - zfs list -r -H -t filesystem,snapshot,volume -o name $src_fs > $BACKDIR/src1 - zfs list -r -H -t filesystem,snapshot,volume -o name $dst_fs > $BACKDIR/dst1 + zfs list -r -H -t all -o name $src_fs > $BACKDIR/src1 + zfs list -r -H -t all -o name $dst_fs > $BACKDIR/dst1 eval sed -e 's:^$src_fs:PREFIX:g' < $BACKDIR/src1 > $BACKDIR/src eval sed -e 's:^$dst_fs:PREFIX:g' < $BACKDIR/dst1 > $BACKDIR/dst @@ -324,8 +330,7 @@ function getds_with_suffix typeset ds=$1 typeset suffix=$2 - typeset list=$(zfs list -r -H -t filesystem,snapshot,volume -o name $ds \ - | grep "$suffix$") + typeset list=$(zfs list -r -H -t all -o name $ds | grep "$suffix$") echo $list } @@ -487,7 +492,7 @@ function resume_test for ((i=0; i<2; i=i+1)); do mess_file /$streamfs/$stream_num - log_mustnot zfs recv -sv $recvfs