Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_008_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_008_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_008_pos.ksh (nonexistent) @@ -1,123 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_008_pos.ksh 1.5 09/06/22 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_008_pos -# -# DESCRIPTION: -# Newfs will interfere with devices and spare devices that are in use -# by exported pool. -# -# STRATEGY: -# 1. Create a regular|mirror|raidz|raidz2 pool with the given disk -# 2. Export the pool -# 3. Try to newfs against the disk, verify it succeeds as expect. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-07-11) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1 - - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - # - # Tidy up the disks we used. - # - cleanup_devices $vdisks $sdisks -} - -function verify_assertion #slices -{ - typeset targets=$1 - - for t in $targets; do - $ECHO "y" | $NEWFS $t > /dev/null 2>&1 - (( $? !=0 )) && \ - log_fail "newfs over exported pool "\ - "fails unexpected." - done - - return 0 -} - -log_assert "Verify newfs over exported pool succeed." - -log_onexit cleanup - -set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" - -typeset -i i=0 - -wipe_partition_table $disk -for num in 0 1 2 3 ; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition -done - -while (( i < ${#vdevs[*]} )); do - if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices - log_must $ZPOOL export $TESTPOOL1 - verify_assertion "$rawtargets" - cleanup_devices $vslices $sslices - - (( i = i + 1 )) -done - -log_pass "Newfs over exported pool succeed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_009_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_009_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_009_pos.ksh (nonexistent) @@ -1,134 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_009_pos.ksh 1.4 09/06/22 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_009_pos -# -# DESCRIPTION: -# format command will interfere with devices and spare devices that are in use -# by exported pool. -# -# STRATEGY: -# 1. Create a regular|mirror|raidz|raidz2 pool with the given disk -# 2. Export the pool -# 3. Try to format against the disk, verify it succeeds as expect. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-05) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1 - - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - # - # Tidy up the disks we used. - # - cleanup_devices $vdisks $sdisks -} - -function verify_assertion #disks -{ - typeset targets=$1 - - for t in $targets; do - log_must wipe_partition_table $t - done - - return 0 -} - -log_assert "Verify format over exported pool succeed." - -log_onexit cleanup - -set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" - -typeset -i i=0 - -wipe_partition_table ${vdisks} -while (( i < ${#vdevs[*]} )); do - - for num in 0 1 2 3 ; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition - done - - if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices - log_must $ZPOOL export $TESTPOOL1 - verify_assertion "$vdisks $sdisks" - - if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - if [[ ( $FS_DISK0 == $FS_DISK3 ) && ( ${vdevs[i]} == "raidz2" ) ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks - log_must $ZPOOL export $TESTPOOL1 - verify_assertion "$vdisks $sdisks" - - (( i = i + 1 )) -done - -log_pass "Format over exported pool succeed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_001_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_001_pos.ksh (nonexistent) @@ -1,101 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_001_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_001_pos -# -# DESCRIPTION: -# ZFS will not interfere with devices that are in use by dumpadm. -# -# STRATEGY: -# 1. Create crash dump device using 'dumpadm' -# 2. Try to create a ZFS pool using the 'dumpadm' crash dump device. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-07-04) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - - -function cleanup -{ - # - # Remove dump device. - # - if [[ -n $PREVDUMPDEV ]]; then - log_must $DUMPADM -u -d $PREVDUMPDEV > /dev/null - fi - - destroy_pool $TESTPOOL -} - -log_assert "Ensure ZFS cannot use a device designated as a dump device" -if [[ -z $DUMPADM ]]; then - log_unsupported "This test requires the dumpadm command" -fi - -log_onexit cleanup - -typeset dumpdev="" -typeset diskslice="" - -PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'` - -log_note "Zero $FS_DISK0 and place free space into partition 1" -log_must cleanup_devices $FS_DISK0 - -diskslice="/dev/dsk/${FS_DISK0}p1" - -log_note "Configuring $diskslice as dump device" -log_must $DUMPADM -d $diskslice > /dev/null - -log_note "Confirm that dump device has been setup" -dumpdev=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'` -[[ -z "$dumpdev" ]] && log_untested "No dump device has been configured" - -[[ "$dumpdev" != "$diskslice" ]] && \ - log_untested "Dump device has not been been configured to $diskslice" - -log_note "Attempt to zpool the dump device" -log_mustnot $ZPOOL create $TESTPOOL "$diskslice" -log_mustnot poolexists $TESTPOOL - -log_pass "Unable to zpool a device in use by dumpadm" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_002_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_002_pos.ksh (nonexistent) @@ -1,122 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_002_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_002_pos -# -# DESCRIPTION: -# ZFS will not interfere with devices that are in use by SVM -# -# STRATEGY: -# 1. Create SVM device d99 with a disk -# 2. Try to create a ZFS pool with same disk -# 3. Try a use the same disk as a spare device -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-07-04) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2 - - $METASTAT d99 > /dev/null 2>&1 - (( $? == 0 )) && $METACLEAR -f d99 - - typeset metadb="" - typeset i="" - - metadb=`$METADB | $CUT -f6 | $GREP dev | $UNIQ` - for i in $metadb; do - $METADB -fd $i > /dev/null 2>&1 - done - - # - # Tidy up the disks we used. - # - wipe_partition_table $vdisks $sdisks -} - -log_assert "Ensure ZFS does not interfere with devices in use by SVM" - -log_onexit cleanup - -for num in 0 1 2; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition -done - -log_note "Configuring metadb with $FS_SIDE1" -log_must $METADB -a -f -c 3 $FS_SIDE1 - -log_note "Configure d99 with $FS_SIDE0" -log_must $METAINIT d99 1 1 $FS_SIDE0 - -log_note "Attempt to zpool the device in use by SVM" -log_mustnot $ZPOOL create $TESTPOOL1 $FS_SIDE0 -log_mustnot poolexists $TESTPOOL1 - -log_note "Attempt to take device in use by SVM as spare device" -log_mustnot $ZPOOL create $TESTPOOL1 $FS_SIDE2 spare $FS_SIDE0 -log_mustnot poolexists $TESTPOOL1 - -log_note "Attempt to zpool a metadb device in use by SVM" -log_mustnot $ZPOOL create $TESTPOOL2 $FS_SIDE1 -log_mustnot poolexists $TESTPOOL2 - -log_note "Attempt to take device in use by SVM as spare device" -log_mustnot $ZPOOL create $TESTPOOL2 $FS_SIDE2 spare $FS_SIDE1 -log_mustnot poolexists $TESTPOOL2 - -log_pass "Unable to zpool a device in use by SVM" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_003_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_003_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_003_pos.ksh (nonexistent) @@ -1,199 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_003_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_003_pos -# -# DESCRIPTION: -# ZFS will not interfere with devices that are in use by ufsdump or -# ufsrestore. -# -# STRATEGY: -# 1. newfs a disk -# 2. mount the disk -# 3. create files and dirs on disk -# 4. umount the disk -# 5. ufsdump this disk to a backup disk -# 6. Try to create a ZFS pool with same disk (also as a spare device) -# 7. ufsrestore the disk from backup -# 8. try to create a zpool during the ufsrestore -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-07-04) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2 - - log_note "Kill off ufsdump process if still running" - $PS -p $PIDUFSDUMP > /dev/null 2>&1 - (( $? == 0 )) && log_must $KILL -9 $PIDUFSDUMP > /dev/null 2>&1 - # - # Note: It would appear that ufsdump spawns a number of processes - # which are not killed when the $PIDUFSDUMP is whacked. So best bet - # is to find the rest of the them and deal with them individually. - # - for all in `$PGREP ufsdump` - do - $KILL -9 $all > /dev/null 2>&1 - done - - log_note "Kill off ufsrestore process if still running" - $PS -p $PIDUFSRESTORE > /dev/null 2>&1 - (( $? == 0 )) && log_must $KILL -9 $PIDUFSRESTORE > /dev/null 2>&1 - - ismounted $UFSMP ufs - (( $? == 0 )) && log_must $UMOUNT $UFSMP - - $RM -rf $UFSMP - $RM -rf $TESTDIR - - # - # Tidy up the disks we used. - # - log_must cleanup_devices $vdisks $sdisks -} - -log_assert "Ensure ZFS does not interfere with devices that are in use by " \ - "ufsdump or ufsrestore" - -log_onexit cleanup - -typeset bigdir="${UFSMP}/bigdirectory" -typeset restored_files="${UFSMP}/restored_files" -typeset -i dirnum=0 -typeset -i filenum=0 -typeset cwd="" - -for num in 0 1 2; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition -done - -log_note "Make a ufs filesystem on $rawdisk0" -$ECHO "y" | $NEWFS $rawdisk0 > /dev/null 2>&1 -(( $? !=0 )) && log_untested "Unable to create ufs filesystem on $rawdisk0" - -log_note "Make a ufs filesystem on $rawdisk1" -$ECHO "y" | $NEWFS $rawdisk1 > /dev/null 2>&1 -(( $? !=0 )) && log_untested "Unable to create ufs filesystem on $rawdisk1" - -log_must $MKDIR -p $UFSMP - -log_note "mount $disk1 on $UFSMP" -log_must $MOUNT $disk1 $UFSMP - -log_note "Now create some directories and files to be ufsdump'ed" -while (( $dirnum <= 2 )); do - log_must $MKDIR $bigdir${dirnum} - while (( $filenum <= 2 )); do - $FILE_WRITE -o create -f $bigdir${dirnum}/file${filenum} \ - -b $BLOCK_SIZE -c $BLOCK_COUNT - if [[ $? -ne 0 ]]; then - if [[ $dirnum -lt 3 ]]; then - log_fail "$FILE_WRITE only wrote \ - <(( $dirnum * 3 + $filenum ))> \ - files, this is not enough" - fi - fi - (( filenum = filenum + 1 )) - done - filenum=0 - (( dirnum = dirnum + 1 )) -done - -log_must $UMOUNT $UFSMP - -log_note "Start ufsdump in the background" -log_note "$UFSDUMP 0bf 512 $rawdisk0 $disk1" -$UFSDUMP 0bf 512 $rawdisk0 $disk1 & -PIDUFSDUMP=$! - -log_note "Attempt to zpool a device in use by ufsdump" -log_mustnot $ZPOOL create -f $TESTPOOL1 "$disk0" -log_mustnot poolexists $TESTPOOL1 - -log_note "Attempt to take device in use by ufsdump as spare device" -log_mustnot $ZPOOL create -f $TESTPOOL1 "$FS_SIDE2" spare "$disk0" -log_mustnot poolexists $TESTPOOL1 - -wait $PIDUFSDUMP -typeset -i retval=$? -(( $retval != 0 )) && log_fail "$UFSDUMP failed with error code $ret_val" - -log_must $MOUNT $disk1 $UFSMP - -log_must $RM -rf $UFSMP/* -log_must $MKDIR $restored_files - -cwd=$PWD -log_must cd $restored_files -log_note "Start ufsrestore in the background" -log_note "$UFSRESTORE rbf 512 $rawdisk0" -$UFSRESTORE rbf 512 $rawdisk0 & -PIDUFSRESTORE=$! - - -log_must cd $cwd - -log_note "Attempt to zpool a device in use by ufsrestore" -log_mustnot $ZPOOL create -f $TESTPOOL2 "$disk1" -log_mustnot poolexists $TESTPOOL2 - -log_note "Attempt to take device in use by ufsrestore as spare device" -log_mustnot $ZPOOL create -f $TESTPOOL2 "$FS_SIDE2" spare "$disk1" -log_mustnot poolexists $TESTPOOL2 - -log_pass "Unable to zpool over a device in use by ufsdump or ufsrestore" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_004_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_004_pos.ksh (nonexistent) @@ -1,105 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_004_pos.ksh 1.4 09/06/22 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_004_pos -# -# DESCRIPTION: -# format will disallow modification of a mounted zfs disk partition or a spare -# device -# -# STRATEGY: -# 1. Create a ZFS filesystem -# 2. Add a spare device to the ZFS pool -# 3. Attempt to format the disk and the spare device. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-07-04) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - # - # Essentailly this is the default_cleanup rountine but I cannot get it - # to work correctly. So its reproduced below. Still need to full - # understand why default_cleanup does not work correctly from here. - # - log_must $ZFS umount $TESTPOOL/$TESTFS - - $RM -rf $TESTDIR || \ - log_unresolved Could not remove $TESTDIR - - log_must $ZFS destroy $TESTPOOL/$TESTFS - destroy_pool $TESTPOOL -} -# -# Currently, if a ZFS disk gets formatted things go horribly wrong, hence the -# mini_format function. If the modify option is reached, then we know format -# would happily continue - best to not go further. -# -function mini_format -{ - typeset disk=$1 - - typeset format_file=$TMPDIR/format_in.${TESTCASE_ID}.1 - $ECHO "partition" > $format_file - $ECHO "modify" >> $format_file - - $FORMAT -e -s -d $disk -f $format_file - typeset -i retval=$? - $RM -rf $format_file - return $retval -} - -log_assert "format will disallow modification of a mounted zfs disk partition"\ - " or a spare device" - -log_onexit cleanup -log_must default_setup_noexit $FS_DISK0 -log_must $ZPOOL add $TESTPOOL spare $FS_DISK1 - -log_note "Attempt to format a ZFS disk" -log_mustnot mini_format $FS_DISK0 -log_note "Attempt to format a ZFS spare device" -log_mustnot mini_format $FS_DISK1 - -log_pass "Unable to format a disk in use by ZFS" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_006_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_006_pos.ksh (nonexistent) @@ -1,139 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_006_pos.ksh 1.4 09/06/22 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_006_pos -# -# DESCRIPTION: -# dumpadm will not interfere with devices and spare devices that are in use -# by active pool. -# -# STRATEGY: -# 1. Create a regular|mirror|raidz|raidz2 pool with the given disk -# 2. Try to dumpadm against the disk, verify it fails as expect. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-12-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - if [[ -n $PREVDUMPDEV ]]; then - log_must $DUMPADM -u -d $PREVDUMPDEV - fi - - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - # - # Tidy up the disks we used. - # - cleanup_devices $vdisks $sdisks -} - -function verify_assertion #slices -{ - typeset targets=$1 - - for t in $targets; do - log_mustnot $DUMPADM -d $t - done - - return 0 -} - -log_assert "Verify dumpadm over active pool fails." -if [[ -z $DUMPADM ]]; then - log_unsupported "This test requires the dumpadm command" -fi - -log_onexit cleanup - -set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" - -typeset -i i=0 - -PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'` - -while (( i < ${#vdevs[*]} )); do - - for num in 0 1 2 3 ; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition - done - - if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices - verify_assertion "$disktargets" - destroy_pool $TESTPOOL1 - - if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - if [[ ( $FS_DISK0 == $FS_DISK3 ) && ( ${vdevs[i]} == "raidz2" ) ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks - verify_assertion "$disktargets" - destroy_pool $TESTPOOL1 - - (( i = i + 1 )) -done - -log_pass "Dumpadm over active pool fails." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_007_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_007_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_007_pos.ksh (nonexistent) @@ -1,148 +0,0 @@ -#!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)inuse_007_pos.ksh 1.4 09/06/22 SMI" -# - -. $STF_SUITE/include/libtest.kshlib - -################################################################################ -# -# __stc_assertion_start -# -# ID: inuse_007_pos -# -# DESCRIPTION: -# dumpadm will interfere with devices and spare devices that are in use -# by exported pool. -# -# STRATEGY: -# 1. Create a regular|mirror|raidz|raidz2 pool with the given disk -# 2. Export the pool -# 3. Try to dumpadm against the disk, verify it succeeds as expect. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2005-12-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - if [[ -n $PREVDUMPDEV ]]; then - log_must $DUMPADM -u -d $PREVDUMPDEV - fi - - poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1 - - poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - # - # Tidy up the disks we used. - # - cleanup_devices $vdisks $sdisks -} - -function verify_assertion #slices -{ - typeset targets=$1 - - for t in $targets; do - log_must $DUMPADM -u -d $t - - log_must $DUMPADM -u -d $PREVDUMPDEV - done - - return 0 -} - -log_assert "Verify dumpadm over exported pool succeed." -if [[ -z $DUMPADM ]]; then - log_unsupported "This test requires the dumpadm command" -fi - -log_onexit cleanup - -set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" - -typeset -i i=0 - -PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'` - -while (( i < ${#vdevs[*]} )); do - - for num in 0 1 2 3 ; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_partition}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_partition=$partition - done - - if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices - log_must $ZPOOL export $TESTPOOL1 - verify_assertion "$disktargets" - log_must $ZPOOL import $TESTPOOL1 - destroy_pool $TESTPOOL1 - - if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - if [[ ( $FS_DISK0 == $FS_DISK3 ) && ( ${vdevs[i]} == "raidz2" ) ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks - log_must $ZPOOL export $TESTPOOL1 - verify_assertion "$disktargets" - log_must $ZPOOL import $TESTPOOL1 - destroy_pool $TESTPOOL1 - - (( i = i + 1 )) -done - -log_pass "Dumpadm over exported pool succeed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/Makefile (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/Makefile (revision 323442) @@ -1,23 +1,16 @@ # $FreeBSD$ .include PACKAGE=tests TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/inuse FILESDIR=${TESTSDIR} ATF_TESTS_KSH93+= inuse_test -${PACKAGE}FILES+= inuse_002_pos.ksh -${PACKAGE}FILES+= inuse_006_pos.ksh -${PACKAGE}FILES+= inuse_003_pos.ksh -${PACKAGE}FILES+= inuse_007_pos.ksh -${PACKAGE}FILES+= inuse_009_pos.ksh -${PACKAGE}FILES+= inuse_001_pos.ksh -${PACKAGE}FILES+= inuse_005_pos.ksh ${PACKAGE}FILES+= inuse.cfg +${PACKAGE}FILES+= inuse_005_pos.ksh +${PACKAGE}FILES+= inuse_010_neg.ksh ${PACKAGE}FILES+= setup.ksh -${PACKAGE}FILES+= inuse_004_pos.ksh -${PACKAGE}FILES+= inuse_008_pos.ksh .include Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_005_pos.ksh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_005_pos.ksh (revision 323442) @@ -1,133 +1,72 @@ #!/usr/local/bin/ksh93 -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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)inuse_005_pos.ksh 1.4 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib ################################################################################ # # __stc_assertion_start # # ID: inuse_005_pos # # DESCRIPTION: # newfs will not interfere with devices and spare devices that are in use # by active pool. # # STRATEGY: -# 1. Create a regular|mirror|raidz|raidz2 pool with the given disk +# 1. Create a with the given disk # 2. Try to newfs against the disk, verify it fails as expect. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-12-30) # # __stc_assertion_end # ################################################################################ verify_runnable "global" +set_disks function cleanup { poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 - - # - # Tidy up the disks we used. - # - cleanup_devices $vdisks $sdisks } -function verify_assertion #slices -{ - typeset targets=$1 - - for t in $targets; do - log_mustnot eval "$ECHO y | $NEWFS $t" - done - - return 0 -} - log_assert "Verify newfs over active pool fails." log_onexit cleanup -set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" - -typeset -i i=0 - -while (( i < ${#vdevs[*]} )); do - - for num in 0 1 2 3 ; do - eval typeset partition=\${FS_SIDE$num} - disk=${partition%p*} - partition=${partition##*p} - if [[ $WRAPPER == *"smi"* && \ - $disk == ${saved_disk} ]]; then - cyl=$(get_endslice $disk ${saved_slice}) - log_must set_partition $partition "$cyl" $FS_SIZE $disk - else - log_must set_partition $partition "" $FS_SIZE $disk - fi - saved_disk=$disk - saved_slice=$partition - done - - if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices - $ZPOOL status $TESTPOOL1 - log_note "Running newfs on $rawtargets ..." - verify_assertion "$rawtargets" - destroy_pool $TESTPOOL1 - wipe_partition_table $vdisks $sdisks - - if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then - (( i = i + 1 )) - continue - fi - - if [[ ( $FS_DISK0 == $FS_DISK3 ) && ( ${vdevs[i]} == "raidz2" ) ]]; then - (( i = i + 1 )) - continue - fi - - create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks - verify_assertion "$rawtargets" - destroy_pool $TESTPOOL1 - - (( i = i + 1 )) -done +create_pool $TESTPOOL1 $DISK0 +log_mustnot $NEWFS -s 1024 "$DISK0" +destroy_pool $TESTPOOL1 log_pass "Newfs over active pool fails." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_010_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_010_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_010_neg.ksh (revision 323442) @@ -0,0 +1,52 @@ +#!/usr/local/bin/ksh93 -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 2017 Spectra Logic Corp. All rights reserved. +# Use is subject to license terms. +# +# $FreeBSD$ + +. $STF_SUITE/include/libtest.kshlib +set_disks + +FSSIZE=1024 #reduce filesystem size, just to speed up newfs +MOUNTPOINT=$TMPDIR/inuse_010_neg_mp + +function cleanup +{ + poolexists $TESTPOOL && destroy_pool $TESTPOOL + $UMOUNT $MOUNTPOINT + cleanup_devices $DISK0 + $RMDIR $MOUNTPOINT +} + +log_onexit cleanup + +log_assert "ZFS shouldn't be able to use a disk with a mounted filesystem" + +log_must $NEWFS -s $FSSIZE $DISK0 +log_must $MKDIR $MOUNTPOINT +log_must $MOUNT $DISK0 $MOUNTPOINT +log_mustnot $ZPOOL create $TESTPOOL $DISK0 + +log_pass "ZFS cannot use a disk with a mounted filesystem" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_test.sh (revision 323441) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/inuse/inuse_test.sh (revision 323442) @@ -1,201 +1,64 @@ # 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 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # -atf_test_case inuse_001_pos -inuse_001_pos_head() -{ - atf_set "descr" "Ensure ZFS cannot use a device designated as a dump device" - atf_set "require.progs" dumpadm zpool - atf_set "timeout" 1200 -} -inuse_001_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_001_pos.ksh || atf_fail "Testcase failed" -} - - - -atf_test_case inuse_002_pos -inuse_002_pos_head() -{ - atf_set "descr" "Ensure ZFS does not interfere with devices in use by SVM" - atf_set "require.progs" metainit metadb metastat zpool metaclear - atf_set "timeout" 1200 -} -inuse_002_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_002_pos.ksh || atf_fail "Testcase failed" -} - - - -atf_test_case inuse_003_pos -inuse_003_pos_head() -{ - atf_set "descr" "Ensure ZFS does not interfere with devices that are in use byufsdump or ufsrestore" - atf_set "require.progs" zpool ufsrestore ufsdump - atf_set "timeout" 1200 -} -inuse_003_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_003_pos.ksh || atf_fail "Testcase failed" -} - - - -atf_test_case inuse_004_pos -inuse_004_pos_head() -{ - atf_set "descr" "format will disallow modification of a mounted zfs disk partition or a spare device" - atf_set "require.progs" zfs zpool format - atf_set "timeout" 1200 -} -inuse_004_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_004_pos.ksh || atf_fail "Testcase failed" -} - - - atf_test_case inuse_005_pos inuse_005_pos_head() { atf_set "descr" "Verify newfs over active pool fails." - atf_set "timeout" 1200 + atf_set "require.progs" newfs zpool + atf_set "require.user" root } inuse_005_pos_body() { - atf_expect_fail "REQ25571 ZFS does not open geoms in exclusive mode" . $(atf_get_srcdir)/../../include/default.cfg . $(atf_get_srcdir)/inuse.cfg - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/inuse_005_pos.ksh || atf_fail "Testcase failed" } - -atf_test_case inuse_006_pos -inuse_006_pos_head() +atf_test_case inuse_010_neg +inuse_010_neg_head() { - atf_set "descr" "Verify dumpadm over active pool fails." - atf_set "require.progs" dumpadm - atf_set "timeout" 1200 + atf_set "descr" "ZFS shouldn't be able to use a disk with a mounted filesystem" + atf_set "require.progs" newfs zpool + atf_set "require.user" root } -inuse_006_pos_body() +inuse_010_neg_body() { . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_006_pos.ksh || atf_fail "Testcase failed" + verify_disk_count "$DISKS" 1 + ksh93 $(atf_get_srcdir)/inuse_010_neg.ksh || atf_fail "Testcase failed" } - -atf_test_case inuse_007_pos -inuse_007_pos_head() -{ - atf_set "descr" "Verify dumpadm over exported pool succeed." - atf_set "require.progs" dumpadm zpool - atf_set "timeout" 1200 -} -inuse_007_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_007_pos.ksh || atf_fail "Testcase failed" -} - - - -atf_test_case inuse_008_pos -inuse_008_pos_head() -{ - atf_set "descr" "Verify newfs over exported pool succeed." - atf_set "require.progs" zpool - atf_set "timeout" 1200 -} -inuse_008_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_008_pos.ksh || atf_fail "Testcase failed" -} - - - -atf_test_case inuse_009_pos -inuse_009_pos_head() -{ - atf_set "descr" "Verify format over exported pool succeed." - atf_set "require.progs" zpool - atf_set "timeout" 1200 -} -inuse_009_pos_body() -{ - . $(atf_get_srcdir)/../../include/default.cfg - . $(atf_get_srcdir)/inuse.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/inuse_009_pos.ksh || atf_fail "Testcase failed" -} - - - atf_init_test_cases() { - - atf_add_test_case inuse_001_pos - atf_add_test_case inuse_002_pos - atf_add_test_case inuse_003_pos - atf_add_test_case inuse_004_pos atf_add_test_case inuse_005_pos - atf_add_test_case inuse_006_pos - atf_add_test_case inuse_007_pos - atf_add_test_case inuse_008_pos - atf_add_test_case inuse_009_pos + atf_add_test_case inuse_010_neg }