1#!/usr/local/bin/ksh93 -p 2# 3# CDDL HEADER START 4# 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. 8# 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. 13# 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] 19# 20# CDDL HEADER END 21# 22 23# 24# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. 26 27. $STF_SUITE/include/libtest.kshlib 28 29################################################################################# 30# 31# __stc_assertion_start 32# 33# ID: zpool_create_006_pos 34# 35# DESCRIPTION: 36# Verify zpool create succeed with multiple keywords combination. 37# 38# STRATEGY: 39# 1. Create base filesystem to hold virtual disk files. 40# 2. Create several files >= 64M. 41# 3. Verify 'zpool create' succeed with valid keywords combination. 42# 43# TESTABILITY: explicit 44# 45# TEST_AUTOMATION_LEVEL: automated 46# 47# CODING_STATUS: COMPLETED (2006-08-16) 48# 49# __stc_assertion_end 50# 51################################################################################ 52 53verify_runnable "global" 54 55function cleanup 56{ 57 datasetexists $TESTPOOL1 && destroy_pool $TESTPOOL1 58 datasetexists $TESTPOOL && destroy_pool $TESTPOOL 59} 60 61 62log_assert "Verify 'zpool create' succeed with keywords combination." 63log_onexit cleanup 64 65create_pool $TESTPOOL $DISKS 66mntpnt=$(get_prop mountpoint $TESTPOOL) 67 68typeset -i i=0 69while ((i < 10)); do 70 log_must create_vdevs $mntpnt/vdev$i 71 72 eval vdev$i=$mntpnt/vdev$i 73 ((i += 1)) 74done 75 76set -A valid_args \ 77 "mirror $vdev0 $vdev1 $vdev2 mirror $vdev3 $vdev4 $vdev5" \ 78 "mirror $vdev0 $vdev1 mirror $vdev2 $vdev3 mirror $vdev4 $vdev5" \ 79 "mirror $vdev0 $vdev1 $vdev2 mirror $vdev3 $vdev4 $vdev5 \ 80 spare $vdev6" \ 81 "mirror $vdev0 $vdev1 mirror $vdev2 $vdev3 mirror $vdev4 $vdev5 \ 82 spare $vdev6 $vdev7" \ 83 "mirror $vdev0 $vdev1 spare $vdev2 mirror $vdev3 $vdev4" \ 84 "raidz $vdev0 $vdev1 $vdev2 raidz1 $vdev3 $vdev4 $vdev5" \ 85 "raidz $vdev0 $vdev1 raidz1 $vdev2 $vdev3 raidz $vdev4 $vdev5" \ 86 "raidz $vdev0 $vdev1 $vdev2 raidz1 $vdev3 $vdev4 $vdev5 \ 87 spare $vdev6" \ 88 "raidz $vdev0 $vdev1 raidz1 $vdev2 $vdev3 raidz $vdev4 $vdev5 \ 89 spare $vdev6 $vdev7" \ 90 "raidz $vdev0 $vdev1 spare $vdev2 raidz $vdev3 $vdev4" \ 91 "raidz2 $vdev0 $vdev1 $vdev2 raidz2 $vdev3 $vdev4 $vdev5" \ 92 "raidz2 $vdev0 $vdev1 $vdev2 raidz2 $vdev3 $vdev4 $vdev5 \ 93 raidz2 $vdev6 $vdev7 $vdev8" \ 94 "raidz2 $vdev0 $vdev1 $vdev2 raidz2 $vdev3 $vdev4 $vdev5 \ 95 spare $vdev6" \ 96 "raidz2 $vdev0 $vdev1 $vdev2 raidz2 $vdev3 $vdev4 $vdev5 \ 97 raidz2 $vdev6 $vdev7 $vdev8 spare $vdev9" \ 98 "raidz2 $vdev0 $vdev1 $vdev2 spare $vdev3 raidz2 $vdev4 $vdev5 $vdev6" 99 100set -A forced_args \ 101 "$vdev0 raidz $vdev1 $vdev2 raidz1 $vdev3 $vdev4 $vdev5" \ 102 "$vdev0 raidz2 $vdev1 $vdev2 $vdev3 raidz2 $vdev4 $vdev5 $vdev6" \ 103 "$vdev0 mirror $vdev1 $vdev2 mirror $vdev3 $vdev4" \ 104 "$vdev0 mirror $vdev1 $vdev2 raidz $vdev3 $vdev4 \ 105 raidz2 $vdev5 $vdev6 $vdev7 spare $vdev8" \ 106 "$vdev0 mirror $vdev1 $vdev2 spare $vdev3 raidz $vdev4 $vdev5" \ 107 "raidz $vdev0 $vdev1 raidz2 $vdev2 $vdev3 $vdev4" \ 108 "raidz $vdev0 $vdev1 raidz2 $vdev2 $vdev3 $vdev4 spare $vdev5" \ 109 "raidz $vdev0 $vdev1 spare $vdev2 raidz2 $vdev3 $vdev4 $vdev5" \ 110 "mirror $vdev0 $vdev1 raidz $vdev2 $vdev3 raidz2 $vdev4 $vdev5 $vdev6" \ 111 "mirror $vdev0 $vdev1 raidz $vdev2 $vdev3 \ 112 raidz2 $vdev4 $vdev5 $vdev6 spare $vdev7" \ 113 "mirror $vdev0 $vdev1 raidz $vdev2 $vdev3 \ 114 spare $vdev4 raidz2 $vdev5 $vdev6 $vdev7" \ 115 "spare $vdev0 $vdev1 $vdev2 mirror $vdev3 $vdev4 raidz $vdev5 $vdev6" 116 117i=0 118while ((i < ${#valid_args[@]})); do 119 log_must $ZPOOL create $TESTPOOL1 ${valid_args[$i]} 120 $SYNC; $SYNC 121 log_must $ZPOOL destroy -f $TESTPOOL1 122 123 ((i += 1)) 124done 125 126i=0 127while ((i < ${#forced_args[@]})); do 128 log_mustnot $ZPOOL create $TESTPOOL1 ${forced_args[$i]} 129 log_must $ZPOOL create -f $TESTPOOL1 ${forced_args[$i]} 130 $SYNC; $SYNC 131 log_must $ZPOOL destroy -f $TESTPOOL1 132 133 ((i += 1)) 134done 135 136log_pass "'zpool create' succeed with keywords combination." 137