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.
# 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
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
#
#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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."
#
#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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
#
#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
"same devices, 'zpool create' should fail."
log_onexit cleanup
+unset NOINUSE_CHECK
typeset opt
for opt in "" "mirror" "raidz" "raidz1"; do
typeset disk="$DISKS"
#
#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
"$TESTPOOL1 ${disk}s10" \
"$TESTPOOL1 spare $pooldev2"
+unset NOINUSE_CHECK
typeset -i i=0
while (( i < ${#arg[*]} )); do
log_mustnot $ZPOOL create ${arg[i]}
#
#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
destroy_pool $pool
fi
done
-
}
+unset NOINUSE_CHECK
if [[ -n $DISK ]]; then
disk=$DISK
else
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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
#
#
-# 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
$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
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
typeset -i i=0
+unset NOINUSE_CHECK
while (( i < ${#vdevs[*]} )); do
for num in 0 1 2 3 ; do
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'`
+unset NOINUSE_CHECK
while (( i < ${#vdevs[*]} )); do
for num in 0 1 2 3 ; do
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"
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