]> git.proxmox.com Git - mirror_zfs.git/commitdiff
OpenZFS 7260 - disable libdiskmgmt in zfstest unless it's required
authorJohn Wren Kennedy <john.kennedy@delphix.com>
Mon, 8 Aug 2016 16:41:07 +0000 (09:41 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 15 Feb 2017 19:09:33 +0000 (11:09 -0800)
Authored by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
OpenZFS-issue: https://www.illumos.org/issues/7260
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/447b1e1
Closes #5794

Porting notes:
- The library libdiskmgmt is specific to illumos so these changes
  currently have no impact under Linux.  This mechanism could be
  potentially leveraged in the future.

12 files changed:
tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_008_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_009_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_011_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_015_neg.ksh
tests/zfs-tests/tests/functional/inuse/inuse_001_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_003_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_005_pos.ksh
tests/zfs-tests/tests/functional/inuse/inuse_006_pos.ksh
tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh
zfs-script-config.sh.in

index 4cfc9041b0d53ead8b23234aaf7829b0a91a5a54..8af9215811a11240035902c9504ba56aa629067c 100755 (executable)
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+
+#
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
 
@@ -71,10 +76,10 @@ log_must poolexists "$TESTPOOL"
 
 create_pool "$TESTPOOL1" "${disk}${SLICE_PREFIX}${SLICE1}"
 log_must poolexists "$TESTPOOL1"
-log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}${SLICE_PREFIX}${SLICE1}
 
+unset NOINUSE_CHECK
+log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}s${SLICE1}
 log_mustnot $ZPOOL add -f "$TESTPOOL" $mnttab_dev
-
 log_mustnot $ZPOOL add -f "$TESTPOOL" $vfstab_dev
 
 log_must $ECHO "y" | $NEWFS ${DEV_DSKDIR}/$dump_dev > /dev/null 2>&1
index bba3d945df3f75ba4a87ac034fe623fe6766ac77..2dbd8738d8c881255e8820e2cefae759f7a58527 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -84,6 +84,7 @@ log_must $MKFILE $SIZE /var/tmp/$FILEDISK0
 log_must $MKFILE $SIZE /var/tmp/$FILEDISK1
 log_must $MKFILE $SIZE /var/tmp/$FILEDISK2
 
+unset NOINUSE_CHECK
 log_must $ZPOOL export $TESTPOOL
 log_note "'zpool create' without '-f' will fail " \
        "while device is belong to an exported pool."
index 27506a6986440981899fbf2ea5d401eb8f5d11c1..a672eb773d8c2a8b8a951592471171564a20617f 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -129,6 +129,7 @@ destroy_pool $TESTPOOL
 log_must labelvtoc $disk
 log_must create_overlap_slice $disk
 
+unset NOINUSE_CHECK
 log_mustnot $ZPOOL create $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
 log_must $ZPOOL create -f $TESTPOOL ${disk}${SLICE_PREFIX}${SLICE0}
 destroy_pool $TESTPOOL
index 089c47505a8ad23fbc69984e1fdd57b694e75aa9..09159c393356900f547f34602b8a1e5ea3e0ae34 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -66,6 +66,7 @@ log_assert "Create a pool with same devices twice or create two pools with " \
        "same devices, 'zpool create' should fail."
 log_onexit cleanup
 
+unset NOINUSE_CHECK
 typeset opt
 for opt in "" "mirror" "raidz" "raidz1"; do
        typeset disk="$DISKS"
index 6d8b26ce6f1e5c61d3c7cbff0c97c1ab5b211585..56849e8a290509c8a9b3d9a0569a8e044317f393 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -105,6 +105,7 @@ set -A arg "$TESTPOOL $pooldev2" \
         "$TESTPOOL1 ${disk}s10" \
        "$TESTPOOL1 spare $pooldev2"
 
+unset NOINUSE_CHECK
 typeset -i i=0
 while (( i < ${#arg[*]} )); do
         log_mustnot $ZPOOL create ${arg[i]}
index c866c4d9c1606277f76ee1b9ce272622f5ade7f6..516d4e43d40f207d87b44308951fb7915d7b2471 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -63,9 +63,9 @@ function cleanup
                        destroy_pool $pool
                fi
        done
-
 }
 
+unset NOINUSE_CHECK
 if [[ -n $DISK ]]; then
         disk=$DISK
 else
index 940ff0840854f8c41ebf5a297abfd825b5aa667f..b7d002003b33bfc9b717311178ca1d70b4b4d374 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -79,6 +79,7 @@ dumpdev=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
     log_untested "Dump device has not been been configured to $diskslice"
 
 log_note "Attempt to zpool the dump device"
+unset NOINUSE_CHECK
 log_mustnot $ZPOOL create $TESTPOOL "$diskslice"
 log_mustnot poolexists $TESTPOOL
 
index 2e75a33abe5b885874a0d661fff646fd7b27c7d6..d8ae35b75c32dcc34b5b5489c62485d9d22b4a77 100755 (executable)
 #
 
 #
-# Copyright (c) 2012 by Delphix. All rights reserved.
-#
-
-#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -141,6 +137,7 @@ log_note "$UFSDUMP 0bf 512 $rawdisk0 $disk1"
 $UFSDUMP 0bf 512 $rawdisk0 $disk1 &
 PIDUFSDUMP=$!
 
+unset NOINUSE_CHECK
 log_note "Attempt to zpool the source device in use by ufsdump"
 log_mustnot $ZPOOL create $TESTPOOL1 "$disk1"
 log_mustnot poolexists $TESTPOOL1
index 5330ab2bd9e2f84fe2a3bee21befbbc5cff4a7b6..9e506f279a6161c2c82713a120e6943046b8b8ba 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -76,6 +76,7 @@ set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2"
 
 typeset -i i=0
 
+unset NOINUSE_CHECK
 while (( i < ${#vdevs[*]} )); do
 
        for num in 0 1 2 3 ; do
index 3e1450e9c3a10ddd1cba07d93b18a6561d2d7b57..665b2c0d337c1608f4b06522c15568cea080a4a8 100755 (executable)
@@ -26,7 +26,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
 #
 
 . $STF_SUITE/include/libtest.shlib
@@ -79,6 +79,7 @@ typeset -i i=0
 
 PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
 
+unset NOINUSE_CHECK
 while (( i < ${#vdevs[*]} )); do
 
        for num in 0 1 2 3 ; do
index 04b30143de5e1c8a08b016a3b4b575123ab35000..3fd27002958dc84ab07d7dfec0d2817525116065 100755 (executable)
@@ -65,6 +65,7 @@ savedumpdev=$(get_dumpdevice)
 
 safe_dumpadm $voldev
 
+unset NOINUSE_CHECK
 $ECHO "y" | $NEWFS -v $voldev > /dev/null 2>&1
 if (( $? == 0 )) ; then
        log_fail "newfs on dump zvol succeeded unexpectedly"
index d1ba71d7641b45ee6c820e52bd6b44cf9d391423..663f8346d091aa2b57ffb676b98cfdc1847b0371 100644 (file)
@@ -40,6 +40,7 @@ export ZPIOS_SH=${SCRIPTDIR}/zpios.sh
 export ZPIOS_SURVEY_SH=${SCRIPTDIR}/zpios-survey.sh
 
 # Test Suite Specific Commands
+export NOINUSE_CHECK=1
 export TEST_RUNNER=${TESTSDIR}/test-runner/cmd/test-runner.py
 export STF_TOOLS=${TESTSDIR}/test-runner
 export STF_SUITE=${TESTSDIR}/zfs-tests