4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
28 # Copyright (c) 2012, 2014 by Delphix. All rights reserved.
31 . $STF_SUITE/include/libtest.shlib
32 . $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.cfg
35 # Find the storage device in /etc/vfstab
37 function find_vfstab_dev
39 typeset vfstab="/etc/vfstab"
40 typeset tmpfile="/tmp/vfstab.tmp"
45 $CAT $vfstab | $GREP "^/dev/dsk" >$tmpfile
48 vfstabdev=`$ECHO "$line" | $AWK '{print $1}'`
49 vfstabdev=${vfstabdev%%:}
50 vfstabdevs="$vfstabdev $vfstabdevs"
58 # Find the storage device in /etc/mnttab
60 function find_mnttab_dev
62 typeset mnttab="/etc/mnttab"
63 typeset tmpfile="/tmp/mnttab.tmp"
68 $CAT $mnttab | $GREP "^/dev/dsk" >$tmpfile
71 mnttabdev=`$ECHO "$line" | $AWK '{print $1}'`
72 mnttabdev=${mnttabdev%%:}
73 mnttabdevs="$mnttabdev $mnttabdevs"
81 # Save the systme current dump device configuration
83 function save_dump_dev
87 typeset fnd="Dump device"
89 dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \
95 # Common cleanup routine for partitions used in testing
97 function partition_cleanup
100 if [[ -n $DISK ]]; then
101 partition_disk $SIZE $DISK 7
104 for disk in $DISK0 $DISK1; do
105 partition_disk $SIZE $disk 7