]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_001_pos.ksh
824c6dc00401776a1b318be60f29aa50c8a7cbf9
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2012 by Delphix. All rights reserved.
32 .
$STF_SUITE/include
/libtest.shlib
33 .
$STF_SUITE/tests
/functional
/cli_root
/zpool_create
/zpool_create.shlib
37 # 'zpool create <pool> <vspec> ...' can successfully create a
38 # new pool with a name in ZFS namespace.
41 # 1. Create storage pools with a name in ZFS namespace with different
43 # 2. Verify the pool created successfully
46 verify_runnable
"global"
50 poolexists
$TESTPOOL && destroy_pool
$TESTPOOL
52 clean_blockfile
"$TESTDIR0 $TESTDIR1"
54 if [[ -n $DISK ]]; then
55 partition_disk
$SIZE $DISK 7
58 for disk
in $DISK0 $DISK1; do
59 partition_disk
$SIZE $disk 7
64 log_assert
"'zpool create <pool> <vspec> ...' can successfully create" \
65 "a new pool with a name in ZFS namespace."
69 set -A keywords
"" "mirror" "raidz" "raidz1"
71 case $DISK_ARRAY_NUM in
74 if (( $DISK_ARRAY_NUM == 0 )); then
79 create_blockfile
$FILESIZE $TESTDIR0/$FILEDISK0 \
80 ${disk}${SLICE_PREFIX}${SLICE5}
81 create_blockfile
$FILESIZE $TESTDIR1/$FILEDISK1 \
82 ${disk}${SLICE_PREFIX}${SLICE6}
84 pooldevs
="${disk}${SLICE_PREFIX}${SLICE0} \
85 ${DEV_DSKDIR}/${disk}${SLICE_PREFIX}${SLICE0} \
86 \"${disk}${SLICE_PREFIX}${SLICE0} \
87 ${disk}${SLICE_PREFIX}${SLICE1}\" \
89 raidzdevs
="\"${DEV_DSKDIR}/${disk}${SLICE_PREFIX}${SLICE0} \
90 ${disk}${SLICE_PREFIX}${SLICE1}\" \
91 \"${disk}${SLICE_PREFIX}${SLICE0} \
92 ${disk}${SLICE_PREFIX}${SLICE1} \
93 ${disk}${SLICE_PREFIX}${SLICE3}\" \
94 \"${disk}${SLICE_PREFIX}${SLICE0} \
95 ${disk}${SLICE_PREFIX}${SLICE1} \
96 ${disk}${SLICE_PREFIX}${SLICE3} \
97 ${disk}${SLICE_PREFIX}${SLICE4}\"\
98 \"$TESTDIR0/$FILEDISK0 $TESTDIR1/$FILEDISK1\""
102 create_blockfile
$FILESIZE $TESTDIR0/$FILEDISK0 \
103 ${DISK0}${SLICE_PREFIX}${SLICE5}
104 create_blockfile
$FILESIZE $TESTDIR1/$FILEDISK1 \
105 ${DISK1}${SLICE_PREFIX}${SLICE5}
107 pooldevs
="${DISK0}${SLICE_PREFIX}${SLICE0} \
108 \"${DEV_DSKDIR}/${DISK0}${SLICE_PREFIX}${SLICE0} \
109 ${DISK1}${SLICE_PREFIX}${SLICE0}\" \
110 \"${DISK0}${SLICE_PREFIX}${SLICE0} \
111 ${DISK0}${SLICE_PREFIX}${SLICE1} \
112 ${DISK1}${SLICE_PREFIX}${SLICE1}\"\
113 \"${DISK0}${SLICE_PREFIX}${SLICE0} \
114 ${DISK1}${SLICE_PREFIX}${SLICE0} \
115 ${DISK0}${SLICE_PREFIX}${SLICE1}\
116 ${DISK1}${SLICE_PREFIX}${SLICE1}\" \
117 \"$TESTDIR0/$FILEDISK0 $TESTDIR1/$FILEDISK1\""
118 raidzdevs
="\"${DEV_DSKDIR}/${DISK0}${SLICE_PREFIX}${SLICE0} \
119 ${DISK1}${SLICE_PREFIX}${SLICE0}\" \
120 \"${DISK0}${SLICE_PREFIX}${SLICE0} \
121 ${DISK0}${SLICE_PREFIX}${SLICE1} \
122 ${DISK1}${SLICE_PREFIX}${SLICE1}\" \
123 \"${DISK0}${SLICE_PREFIX}${SLICE0} \
124 ${DISK1}${SLICE_PREFIX}${SLICE0} \
125 ${DISK0}${SLICE_PREFIX}${SLICE1} \
126 ${DISK1}${SLICE_PREFIX}${SLICE1}\" \
127 \"$TESTDIR0/$FILEDISK0 $TESTDIR1/$FILEDISK1\""
128 mirrordevs
=$raidzdevs
133 while (( $i < ${#keywords[*]} )); do
134 case ${keywords[i]} in
136 create_pool_test
"$TESTPOOL" "${keywords[i]}" "$pooldevs";;
138 create_pool_test
"$TESTPOOL" "${keywords[i]}" "$mirrordevs";;
140 create_pool_test
"$TESTPOOL" "${keywords[i]}" "$raidzdevs" ;;
145 log_pass
"'zpool create <pool> <vspec> ...' success."