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 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
28 # Copyright (c) 2012, 2016 by Delphix. All rights reserved.
31 . $STF_SUITE/include/libtest.shlib
32 . $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.cfg
35 # Given a pool vdevs list, create the pool,verify the created pool,
36 # and destroy the pool
38 # $2, pool type, mirror, raidz, or none
41 function create_pool_test
46 eval "typeset -a diskarray=($3)"
48 for vdevs in "${diskarray[@]}"; do
49 create_pool $pool $keywd $vdevs
50 log_must poolexists $pool
56 # Create a file for storage pool vdev
59 function create_blockfile
62 typeset file=$(mktemp)
63 truncate -s $size $file
68 # Find the storage device in /etc/vfstab
70 function find_vfstab_dev
78 tmpfile="$TEST_BASE_DIR/vfstab.tmp"
81 tmpfile="$TEST_BASE_DIR/fstab.tmp"
84 cat $vfstab | grep "^${DEV_DSKDIR}" >$tmpfile
87 vfstabdev=`echo "$line" | awk '{print $1}'`
88 vfstabdev=${vfstabdev%%:}
89 vfstabdevs="$vfstabdev $vfstabdevs"
97 # Save the system current dump device configuration
99 function save_dump_dev
104 typeset fnd="Dump device"
105 dumpdev=`dumpadm | grep "$fnd" | cut -f2 -d : | \