Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh (revision 353379) @@ -1,37 +1,39 @@ #!/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 # # $FreeBSD$ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)cleanup.ksh 1.2 07/01/09 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib +poolexists $TESTPOOL && \ + destroy_pool $TESTPOOL cleanup_devices $DISKS log_pass Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh (revision 353379) @@ -1,52 +1,37 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)setup.ksh 1.3 09/01/12 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib verify_runnable "global" -if [[ -n $DISK ]]; then - # - # Use 'zpool create' to clean up the infomation in - # in the given disk to avoid slice overlapping. - # - cleanup_devices $DISK - - partition_disk $SIZE $DISK 7 -else - for disk in `$ECHO $DISKSARRAY`; do - cleanup_devices $disk - partition_disk $SIZE $disk 7 - done -fi - log_pass Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh (revision 353379) @@ -1,148 +1,127 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_001_pos.ksh 1.4 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_001_pos # # DESCRIPTION: # 'zpool add ...' can successfully add the specified # devices to the given pool # # STRATEGY: # 1. Create a storage pool # 2. Add spare devices to the pool # 3. Verify the devices are added to the pool successfully # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING STATUS: COMPLETED (2005-09-27) # # __stc_assertion_end # ############################################################################### verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add ...' can add devices to the pool." -log_onexit cleanup - set -A keywords "" "mirror" "raidz" "raidz1" "spare" -typeset diskname=${disk#/dev/} +set_disks + typeset diskname0=${DISK0#/dev/} typeset diskname1=${DISK1#/dev/} +typeset diskname2=${DISK2#/dev/} +typeset diskname3=${DISK3#/dev/} +typeset diskname4=${DISK4#/dev/} -case $DISK_ARRAY_NUM in -0|1) - pooldevs="${diskname}p1 \ - /dev/${diskname}p1 \ - \"${diskname}p1 ${diskname}p2\"" - mirrordevs="\"/dev/${diskname}p1 ${diskname}p2\"" - raidzdevs="\"/dev/${diskname}p1 ${diskname}p2\"" +pooldevs="${diskname0}\ + \"/dev/${diskname0} ${diskname1}\" \ + \"${diskname0} ${diskname1} ${diskname2}\"" +mirrordevs="\"/dev/${diskname0} ${diskname1}\"" +raidzdevs="\"/dev/${diskname0} ${diskname1}\"" - ;; -2|*) - pooldevs="${diskname0}p1\ - \"/dev/${diskname0}p1 ${diskname1}p1\" \ - \"${diskname0}p1 ${diskname0}p2 ${diskname1}p2\"\ - \"${diskname0}p1 ${diskname1}p1 ${diskname0}p2\ - ${diskname1}p2\"" - mirrordevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - raidzdevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - - ;; -esac - typeset -i i=0 typeset vdev eval set -A poolarray $pooldevs eval set -A mirrorarray $mirrordevs eval set -A raidzarray $raidzdevs while (( $i < ${#keywords[*]} )); do case ${keywords[i]} in ""|spare) for vdev in "${poolarray[@]}"; do - create_pool "$TESTPOOL" "${diskname}p6" + create_pool "$TESTPOOL" "${diskname3}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add -f "$TESTPOOL" ${keywords[i]} \ $vdev log_must iscontained "$TESTPOOL" "$vdev" destroy_pool "$TESTPOOL" done ;; mirror) for vdev in "${mirrorarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev log_must iscontained "$TESTPOOL" "$vdev" destroy_pool "$TESTPOOL" done ;; raidz|raidz1) for vdev in "${raidzarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev log_must iscontained "$TESTPOOL" "$vdev" destroy_pool "$TESTPOOL" done ;; esac (( i = i+1 )) done log_pass "'zpool add ...' executes successfully" Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh (revision 353379) @@ -1,85 +1,77 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_002_pos.ksh 1.5 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_002_pos # # DESCRIPTION: # 'zpool add -f ...' can successfully add the specified # devices to given pool in some cases. # # STRATEGY: # 1. Create a mirrored pool # 2. Without -f option to add 1-way device the mirrored pool will fail # 3. Use -f to override the errors to add 1-way device to the mirrored # pool # 4. Verify the device is added successfully # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ################################################################################ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup -} - log_assert "'zpool add -f ...' can successfully add" \ "devices to the pool in some cases." -log_onexit cleanup - -create_pool "$TESTPOOL" mirror "${disk}p1" "${disk}p2" +create_pool "$TESTPOOL" mirror "${DISK0}" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add "$TESTPOOL" ${disk}p3 -log_mustnot iscontained "$TESTPOOL" "${disk}p3" +log_mustnot $ZPOOL add "$TESTPOOL" ${DISK2} +log_mustnot iscontained "$TESTPOOL" "${DISK2}" -log_must $ZPOOL add -f "$TESTPOOL" ${disk}p3 -log_must iscontained "$TESTPOOL" "${disk}p3" +log_must $ZPOOL add -f "$TESTPOOL" ${DISK2} +log_must iscontained "$TESTPOOL" "${DISK2}" log_pass "'zpool add -f ...' executes successfully." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh (revision 353379) @@ -1,91 +1,80 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_003_pos.ksh 1.4 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_003_pos # # DESCRIPTION: # 'zpool add -n ...' can display the configuration without # adding the specified devices to given pool # # STRATEGY: # 1. Create a storage pool # 2. Use -n to add a device to the pool # 3. Verify the device is not added actually # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ################################################################################ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup - - [[ -e $tmpfile ]] && \ - log_must $RM -f $tmpfile -} - log_assert "'zpool add -n ...' can display the configuration" \ "without actually adding devices to the pool." -log_onexit cleanup +tmpfile="zpool_add_003.tmp${TESTCASE_ID}" -tmpfile="$TMPDIR/zpool_add_003.tmp${TESTCASE_ID}" - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -$ZPOOL add -n "$TESTPOOL" ${disk}p2 > $tmpfile +$ZPOOL add -n "$TESTPOOL" ${DISK1} > $tmpfile -log_mustnot iscontained "$TESTPOOL" "${disk}p2" +log_mustnot iscontained "$TESTPOOL" "${DISK1}" str="would update '$TESTPOOL' to the following configuration:" $CAT $tmpfile | $GREP "$str" >/dev/null 2>&1 (( $? != 0 )) && \ log_fail "'zpool add -n ...' is executed as unexpected" log_pass "'zpool add -n ...'executes successfully." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh (revision 353379) @@ -1,90 +1,89 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_004_pos.ksh 1.6 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_004_pos # # DESCRIPTION: # 'zpool add ...' can successfully add a zfs volume # to the given pool # # STRATEGY: # 1. Create a storage pool and a zfs volume # 2. Add the volume to the pool # 3. Verify the devices are added to the pool successfully # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ############################################################################### verify_runnable "global" +set_disks + function cleanup { poolexists $TESTPOOL && \ destroy_pool "$TESTPOOL" datasetexists $TESTPOOL1/$TESTVOL && \ log_must $ZFS destroy -f $TESTPOOL1/$TESTVOL poolexists $TESTPOOL1 && \ destroy_pool "$TESTPOOL1" - - partition_cleanup - } log_assert "'zpool add ...' can add zfs volume to the pool." log_onexit cleanup -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" log_must $ZFS create -V $VOLSIZE $TESTPOOL1/$TESTVOL log_must $ZPOOL add "$TESTPOOL" /dev/zvol/$TESTPOOL1/$TESTVOL log_must iscontained "$TESTPOOL" "/dev/zvol/$TESTPOOL1/$TESTVOL" log_pass "'zpool add ...' adds zfs volume to the pool successfully" Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh (revision 353379) @@ -1,102 +1,98 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_005_pos.ksh 1.4 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_005_pos # # DESCRIPTION: # 'zpool add' should return fail if # 1. vdev is part of an active pool # 2. vdev is currently mounted # 3. vdev is in /etc/vfstab # 3. vdev is specified as the dedicated dump device # # STRATEGY: # 1. Create case scenarios # 2. For each scenario, try to add the device to the pool # 3. Verify the add operation get failed # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ############################################################################### verify_runnable "global" +set_disks + function cleanup { poolexists "$TESTPOOL" && \ destroy_pool "$TESTPOOL" poolexists "$TESTPOOL1" && \ destroy_pool "$TESTPOOL1" - if [[ -n $saved_dump_dev ]]; then - log_must eval "$DUMPADM -u -d $saved_dump_dev > /dev/null" - fi - - partition_cleanup + $DUMPON -r $dump_dev } log_assert "'zpool add' should fail with inapplicable scenarios." log_onexit cleanup mnttab_dev=$(find_mnttab_dev) vfstab_dev=$(find_vfstab_dev) -saved_dump_dev=$(save_dump_dev) -dump_dev=${disk}p3 +dump_dev=${DISK2} -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_mustnot $ZPOOL add -f "$TESTPOOL" $mnttab_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $vfstab_dev -log_must $ECHO "y" | $NEWFS /dev/$dump_dev > /dev/null 2>&1 -log_must $DUMPADM -u -d /dev/$dump_dev > /dev/null +log_must $DUMPON $dump_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $dump_dev log_pass "'zpool add' should fail with inapplicable scenarios." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh (revision 353379) @@ -1,161 +1,150 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_006_pos.ksh 1.5 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_006_pos # # DESCRIPTION: # 'zpool add [-f]' can add large numbers of file-in-zfs-filesystem-based vdevs # to the specified pool without any errors. # # STRATEGY: # 1. Create assigned number of files in ZFS filesystem as vdevs and use the first # file to create a pool # 2. Add other vdevs to the pool should get success # 3 Fill in the filesystem and create a partially written file # as vdev # 4. Add the new file into the pool should be failed. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-10-09) # # __stc_assertion_end # ################################################################################ verify_runnable "global" function cleanup { poolexists $TESTPOOL1 && \ destroy_pool $TESTPOOL1 - datasetexists $TESTPOOL/$TESTFS && \ - log_must $ZFS destroy -f $TESTPOOL/$TESTFS poolexists $TESTPOOL && \ destroy_pool $TESTPOOL if [[ -d $TESTDIR ]]; then log_must $RM -rf $TESTDIR fi - - partition_cleanup } # # Create a pool and fs on the assigned disk, and dynamically create large # numbers of files as vdevs.(the default value is ) # the first file will be used to create a pool for other vdevs to be added into # function setup_vdevs # { typeset disk=$1 typeset -i count=0 typeset -i largest_num=0 typeset -i slicesize=0 typeset vdev="" fs_size=$(get_available_disk_size $disk) # 64M is the minimum size for the pool (( largest_num = fs_size / (1024 * 1024 * 64) )) if (( largest_num < $VDEVS_NUM )); then # Minus $largest_num/20 to leave 5% space for metadata. (( vdevs_num=largest_num - largest_num/20 )) file_size=64 - vdev=$disk else vdevs_num=$VDEVS_NUM (( file_size = fs_size / (1024 * 1024 * (vdevs_num + vdevs_num/20)) )) if (( file_size > FILE_SIZE )); then file_size=$FILE_SIZE fi # Plus $vdevs_num/20 to provide enough space for metadata. (( slice_size = file_size * (vdevs_num + vdevs_num/20) )) wipe_partition_table $disk set_partition 0 "" ${slice_size}m $disk - vdev=${disk}p1 fi + vdev=${disk} create_pool $TESTPOOL $vdev [[ -d $TESTDIR ]] && \ log_must $RM -rf $TESTDIR log_must $MKDIR -p $TESTDIR log_must $ZFS create $TESTPOOL/$TESTFS log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS # Create a pool first using the first file, and make subsequent files ready # as vdevs to add to the pool vdev=${TESTDIR}/file.$count VDEV_SIZE=${file_size}m log_must create_vdevs ${TESTDIR}/file.$count create_pool "$TESTPOOL1" "${TESTDIR}/file.$count" log_must poolexists "$TESTPOOL1" while (( count < vdevs_num )); do # minus 1 to avoid space non-enough (( count = count + 1 )) log_must create_vdevs ${TESTDIR}/file.$count vdevs_list="$vdevs_list ${TESTDIR}/file.$count" done unset VDEV_SIZE } log_assert " 'zpool add [-f]' can add large numbers of vdevs to the specified" \ " pool without any errors." log_onexit cleanup -if [[ $DISK_ARRAY_NUM == 0 ]]; then - disk=$DISK -else - disk=$DISK0 -fi - vdevs_list="" vdevs_num=$VDEVS_NUM file_size=$FILE_SIZE -setup_vdevs $disk +setup_vdevs $DISK0 log_must $ZPOOL add -f "$TESTPOOL1" $vdevs_list log_must iscontained "$TESTPOOL1" "$vdevs_list" log_pass "'zpool successfully add [-f]' can add large numbers of vdevs to the" \ "specified pool without any errors." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh (revision 353379) @@ -1,84 +1,76 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_007_neg.ksh 1.3 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_007_neg # # DESCRIPTION: # 'zpool add' should return an error with badly-formed parameters, # # STRATEGY: # 1. Create an array of parameters # 2. For each parameter in the array, execute 'zpool add' # 3. Verify an error is returned. # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ############################################################################### verify_runnable "global" -function cleanup -{ - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} +set_disks log_assert "'zpool add' should return an error with badly-formed parameters." -log_onexit cleanup - set -A args "" "-f" "-n" "-?" "-nf" "-fn" "-f -n" "--f" "-blah" \ - "-? $TESTPOOL ${disk}p2" + "-? $TESTPOOL ${DISK1}" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 while (( $i < ${#args[*]} )); do log_mustnot $ZPOOL add ${args[i]} ((i = i + 1)) done log_pass "'zpool add' badly formed parameters fail as expected." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh (revision 353379) @@ -1,85 +1,74 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_008_neg.ksh 1.3 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_008_neg # # DESCRIPTION: # 'zpool add' should return an error with nonexistent pools or vdevs # # STRATEGY: # 1. Create an array of parameters which contains nonexistent pools/vdevs # 2. For each parameter in the array, execute 'zpool add' # 3. Verify an error is returned # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ############################################################################### verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} - log_assert "'zpool add' should return an error with nonexistent pools and vdevs" -log_onexit cleanup - -set -A args "" "-f nonexistent_pool ${disk}p2" \ +set -A args "" "-f nonexistent_pool ${DISK1}" \ "-f $TESTPOOL nonexistent_vdev" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 while (( $i < ${#args[*]} )); do log_mustnot $ZPOOL add ${args[i]} ((i = i + 1)) done log_pass "'zpool add' with nonexistent pools and vdevs fail as expected." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh (revision 353379) @@ -1,83 +1,71 @@ #!/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 # # $FreeBSD$ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zpool_add_009_neg.ksh 1.4 09/06/22 SMI" # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib ################################################################################ # # __stc_assertion_start # # ID: zpool_add_009_neg # # DESCRIPTION: # 'zpool add' should return fail if vdevs are the same or vdev is # contained in the given pool # # STRATEGY: # 1. Create a storage pool # 2. Add the two same devices to pool A # 3. Add the device in pool A to pool A again # # TESTABILITY: explicit # # TEST_AUTOMATION_LEVEL: automated # # CODING_STATUS: COMPLETED (2005-09-29) # # __stc_assertion_end # ############################################################################### verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup - -} - log_assert "'zpool add' should fail if vdevs are the same or vdev is " \ "contained in the given pool." -log_onexit cleanup - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 ${disk}p2 -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p1 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK0} ${DISK0} +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_pass "'zpool add' get fail as expected if vdevs are the same or vdev is " \ "contained in the given pool." Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh (revision 353379) @@ -1,56 +1,46 @@ #!/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 # # $FreeBSD$ # # Copyright 2017 Spectra Logic Corp. All rights reserved. # Use is subject to license terms. # . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add' can add devices, even if a replacing vdev with a spare child is present" - -log_onexit cleanup create_pool $TESTPOOL mirror ${DISK0} ${DISK1} # A replacing vdev will automatically detach the older member when resilvering # is complete. We don't want that to happen during this test, so write some # data just to slow down resilvering. $TIMEOUT 60s $DD if=/dev/zero of=/$TESTPOOL/zerofile bs=128k log_must $ZPOOL add $TESTPOOL spare ${DISK3} log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK2} log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK3} log_must $ZPOOL add $TESTPOOL spare ${DISK4} log_pass "'zpool add ...' executes successfully, even when a replacing vdev with a spare child is present" Index: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh =================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh (revision 353378) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh (revision 353379) @@ -1,313 +1,314 @@ # 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 # # $FreeBSD$ # # Copyright 2012 Spectra Logic. All rights reserved. # Use is subject to license terms. # atf_test_case zpool_add_001_pos cleanup zpool_add_001_pos_head() { atf_set "descr" "'zpool add ...' can add devices to the pool." atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_001_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 5 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_001_pos.ksh || atf_fail "Testcase failed" } zpool_add_001_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_002_pos cleanup zpool_add_002_pos_head() { atf_set "descr" "'zpool add -f ...' can successfully add devices to the pool in some cases." atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_002_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_002_pos.ksh || atf_fail "Testcase failed" } zpool_add_002_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_003_pos cleanup zpool_add_003_pos_head() { atf_set "descr" "'zpool add -n ...' can display the configuration without actually adding devices to the pool." atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_003_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_003_pos.ksh || atf_fail "Testcase failed" } zpool_add_003_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_004_pos cleanup zpool_add_004_pos_head() { atf_set "descr" "'zpool add ...' can add zfs volume to the pool." atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_add_004_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg + verify_disk_count "$DISKS" 2 verify_zvol_recursive ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_004_pos.ksh || atf_fail "Testcase failed" } zpool_add_004_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_005_pos cleanup zpool_add_005_pos_head() { atf_set "descr" "'zpool add' should fail with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_005_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_005_pos.ksh || atf_fail "Testcase failed" } zpool_add_005_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_006_pos cleanup zpool_add_006_pos_head() { atf_set "descr" "'zpool add [-f]' can add large numbers of vdevs to the specified pool without any errors." atf_set "require.progs" zfs zpool atf_set "timeout" 2400 } zpool_add_006_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_006_pos.ksh || atf_fail "Testcase failed" } zpool_add_006_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_007_neg cleanup zpool_add_007_neg_head() { atf_set "descr" "'zpool add' should return an error with badly-formed parameters." atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_007_neg_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_007_neg.ksh || atf_fail "Testcase failed" } zpool_add_007_neg_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_008_neg cleanup zpool_add_008_neg_head() { atf_set "descr" "'zpool add' should return an error with nonexistent pools and vdevs" atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_008_neg_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_008_neg.ksh || atf_fail "Testcase failed" } zpool_add_008_neg_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_test_case zpool_add_009_neg cleanup zpool_add_009_neg_head() { atf_set "descr" "'zpool add' should fail if vdevs are the same or vdev iscontained in the given pool." atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_009_neg_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_009_neg.ksh || atf_fail "Testcase failed" } zpool_add_009_neg_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } # Regression test for PR 225546. "zpool add" asserts if the pool contains a # replacing vdev with a spare child. # Assertion failed: (nvlist_lookup_string(cnv, "path", &path) == 0), file /usr/home/alans/freebsd/head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c, line 694. /usr/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh[54]: log_must[69]: log_pos: line 206: 27710: Abort(coredump) atf_test_case zpool_add_010_pos cleanup zpool_add_010_pos_head() { atf_set "descr" "'zpool add' can add devices, even if a replacing vdev with a spare child is present" atf_set "require.progs" zpool } zpool_add_010_pos_body() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg verify_disk_count "$DISKS" 5 ksh93 $(atf_get_srcdir)/zpool_add_010_pos.ksh || atf_fail "Testcase failed" } zpool_add_010_pos_cleanup() { . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" } atf_init_test_cases() { atf_add_test_case zpool_add_001_pos atf_add_test_case zpool_add_002_pos atf_add_test_case zpool_add_003_pos atf_add_test_case zpool_add_004_pos atf_add_test_case zpool_add_005_pos atf_add_test_case zpool_add_006_pos atf_add_test_case zpool_add_007_neg atf_add_test_case zpool_add_008_neg atf_add_test_case zpool_add_009_neg atf_add_test_case zpool_add_010_pos }