]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/zfs/zpool/create/option-f_replication_level_mismatch_0.t
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / zfs / zpool / create / option-f_replication_level_mismatch_0.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..70"
8
9 disks_create 6
10 names_create 1
11
12 expect_fl ${ZPOOL} create ${name0} ${disk0} mirror ${disk1} ${disk2}
13 expect_fl ${ZPOOL} status -x ${name0}
14 expect_fl ${ZPOOL} destroy ${name0}
15
16 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} mirror ${disk1} ${disk2}
17 expect_ok ${ZPOOL} status -x ${name0}
18 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
19 exp=`(
20   echo "  pool: ${name0}"
21   echo " state: ONLINE"
22   echo " scrub: none requested"
23   echo "config:"
24   echo "        NAME          STATE   READ WRITE CKSUM"
25   echo "        ${name0}      ONLINE     0     0     0"
26   echo "          ${disk0}    ONLINE     0     0     0"
27   echo "          mirror      ONLINE     0     0     0"
28   echo "            ${disk1}  ONLINE     0     0     0"
29   echo "            ${disk2}  ONLINE     0     0     0"
30   echo "errors: No known data errors"
31 )`
32 expect "${exp}" ${ZPOOL} status ${name0}
33 expect_ok ${ZPOOL} destroy ${name0}
34 expect_fl ${ZPOOL} status -x ${name0}
35 expect_fl ${ZPOOL} destroy ${name0}
36
37 expect_fl ${ZPOOL} create ${name0} ${disk0} ${disk1} mirror ${disk2} ${disk3}
38 expect_fl ${ZPOOL} status -x ${name0}
39 expect_fl ${ZPOOL} destroy ${name0}
40
41 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} mirror ${disk2} ${disk3}
42 expect_ok ${ZPOOL} status -x ${name0}
43 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
44 exp=`(
45   echo "  pool: ${name0}"
46   echo " state: ONLINE"
47   echo " scrub: none requested"
48   echo "config:"
49   echo "        NAME          STATE   READ WRITE CKSUM"
50   echo "        ${name0}      ONLINE     0     0     0"
51   echo "          ${disk0}    ONLINE     0     0     0"
52   echo "          ${disk1}    ONLINE     0     0     0"
53   echo "          mirror      ONLINE     0     0     0"
54   echo "            ${disk2}  ONLINE     0     0     0"
55   echo "            ${disk3}  ONLINE     0     0     0"
56   echo "errors: No known data errors"
57 )`
58 expect "${exp}" ${ZPOOL} status ${name0}
59 expect_ok ${ZPOOL} destroy ${name0}
60 expect_fl ${ZPOOL} status -x ${name0}
61 expect_fl ${ZPOOL} destroy ${name0}
62
63 expect_fl ${ZPOOL} create ${name0} ${disk0} raidz ${disk1} ${disk2} ${disk3}
64 expect_fl ${ZPOOL} status -x ${name0}
65 expect_fl ${ZPOOL} destroy ${name0}
66
67 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} raidz ${disk1} ${disk2} ${disk3}
68 expect_ok ${ZPOOL} status -x ${name0}
69 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
70 exp=`(
71   echo "  pool: ${name0}"
72   echo " state: ONLINE"
73   echo " scrub: none requested"
74   echo "config:"
75   echo "        NAME          STATE   READ WRITE CKSUM"
76   echo "        ${name0}      ONLINE     0     0     0"
77   echo "          ${disk0}    ONLINE     0     0     0"
78   echo "          raidz1      ONLINE     0     0     0"
79   echo "            ${disk1}  ONLINE     0     0     0"
80   echo "            ${disk2}  ONLINE     0     0     0"
81   echo "            ${disk3}  ONLINE     0     0     0"
82   echo "errors: No known data errors"
83 )`
84 expect "${exp}" ${ZPOOL} status ${name0}
85 expect_ok ${ZPOOL} destroy ${name0}
86 expect_fl ${ZPOOL} status -x ${name0}
87 expect_fl ${ZPOOL} destroy ${name0}
88
89 expect_fl ${ZPOOL} create ${name0} ${disk0} ${disk1} raidz1 ${disk2} ${disk3} ${disk4}
90 expect_fl ${ZPOOL} status -x ${name0}
91 expect_fl ${ZPOOL} destroy ${name0}
92
93 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} raidz1 ${disk2} ${disk3} ${disk4}
94 expect_ok ${ZPOOL} status -x ${name0}
95 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
96 exp=`(
97   echo "  pool: ${name0}"
98   echo " state: ONLINE"
99   echo " scrub: none requested"
100   echo "config:"
101   echo "        NAME          STATE   READ WRITE CKSUM"
102   echo "        ${name0}      ONLINE     0     0     0"
103   echo "          ${disk0}    ONLINE     0     0     0"
104   echo "          ${disk1}    ONLINE     0     0     0"
105   echo "          raidz1      ONLINE     0     0     0"
106   echo "            ${disk2}  ONLINE     0     0     0"
107   echo "            ${disk3}  ONLINE     0     0     0"
108   echo "            ${disk4}  ONLINE     0     0     0"
109   echo "errors: No known data errors"
110 )`
111 expect "${exp}" ${ZPOOL} status ${name0}
112 expect_ok ${ZPOOL} destroy ${name0}
113 expect_fl ${ZPOOL} status -x ${name0}
114 expect_fl ${ZPOOL} destroy ${name0}
115
116 expect_fl ${ZPOOL} create ${name0} ${disk0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
117 expect_fl ${ZPOOL} status -x ${name0}
118 expect_fl ${ZPOOL} destroy ${name0}
119
120 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
121 expect_ok ${ZPOOL} status -x ${name0}
122 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
123 exp=`(
124   echo "  pool: ${name0}"
125   echo " state: ONLINE"
126   echo " scrub: none requested"
127   echo "config:"
128   echo "        NAME          STATE   READ WRITE CKSUM"
129   echo "        ${name0}      ONLINE     0     0     0"
130   echo "          ${disk0}    ONLINE     0     0     0"
131   echo "          raidz2      ONLINE     0     0     0"
132   echo "            ${disk1}  ONLINE     0     0     0"
133   echo "            ${disk2}  ONLINE     0     0     0"
134   echo "            ${disk3}  ONLINE     0     0     0"
135   echo "            ${disk4}  ONLINE     0     0     0"
136   echo "errors: No known data errors"
137 )`
138 expect "${exp}" ${ZPOOL} status ${name0}
139 expect_ok ${ZPOOL} destroy ${name0}
140 expect_fl ${ZPOOL} status -x ${name0}
141 expect_fl ${ZPOOL} destroy ${name0}
142
143 expect_fl ${ZPOOL} create ${name0} ${disk0} ${disk1} raidz2 ${disk2} ${disk3} ${disk4} ${disk5}
144 expect_fl ${ZPOOL} status -x ${name0}
145 expect_fl ${ZPOOL} destroy ${name0}
146
147 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} raidz2 ${disk2} ${disk3} ${disk4} ${disk5}
148 expect_ok ${ZPOOL} status -x ${name0}
149 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
150 exp=`(
151   echo "  pool: ${name0}"
152   echo " state: ONLINE"
153   echo " scrub: none requested"
154   echo "config:"
155   echo "        NAME          STATE   READ WRITE CKSUM"
156   echo "        ${name0}      ONLINE     0     0     0"
157   echo "          ${disk0}    ONLINE     0     0     0"
158   echo "          ${disk1}    ONLINE     0     0     0"
159   echo "          raidz2      ONLINE     0     0     0"
160   echo "            ${disk2}  ONLINE     0     0     0"
161   echo "            ${disk3}  ONLINE     0     0     0"
162   echo "            ${disk4}  ONLINE     0     0     0"
163   echo "            ${disk5}  ONLINE     0     0     0"
164   echo "errors: No known data errors"
165 )`
166 expect "${exp}" ${ZPOOL} status ${name0}
167 expect_ok ${ZPOOL} destroy ${name0}
168 expect_fl ${ZPOOL} status -x ${name0}
169 expect_fl ${ZPOOL} destroy ${name0}
170
171 add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
172 expect_fl ${ZPOOL} create ${name0} ${disk0} log ${disk1} mirror ${disk2} ${disk3}
173 expect_fl ${ZPOOL} status -x ${name0}
174 expect_fl ${ZPOOL} destroy ${name0}
175 add_msg=""
176
177 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} log ${disk1} mirror ${disk2} ${disk3}
178 expect_ok ${ZPOOL} status -x ${name0}
179 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
180 exp=`(
181   echo "  pool: ${name0}"
182   echo " state: ONLINE"
183   echo " scrub: none requested"
184   echo "config:"
185   echo "        NAME          STATE   READ WRITE CKSUM"
186   echo "        ${name0}      ONLINE     0     0     0"
187   echo "          ${disk0}    ONLINE     0     0     0"
188   echo "        logs          ONLINE     0     0     0"
189   echo "          ${disk1}    ONLINE     0     0     0"
190   echo "          mirror      ONLINE     0     0     0"
191   echo "            ${disk2}  ONLINE     0     0     0"
192   echo "            ${disk3}  ONLINE     0     0     0"
193   echo "errors: No known data errors"
194 )`
195 expect "${exp}" ${ZPOOL} status ${name0}
196 expect_ok ${ZPOOL} destroy ${name0}
197 expect_fl ${ZPOOL} status -x ${name0}
198 expect_fl ${ZPOOL} destroy ${name0}
199
200 disks_destroy