]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/zfs/zpool/create/option-f_type_mismatch.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_type_mismatch.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..160"
8
9 disks_create 6
10 files_create 2
11 names_create 1
12
13 expect_fl ${ZPOOL} create ${name0} ${disk0} ${file0}
14 expect_fl ${ZPOOL} status -x ${name0}
15 expect_fl ${ZPOOL} destroy ${name0}
16
17 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${file0}
18 expect_ok ${ZPOOL} status -x ${name0}
19 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
20 exp=`(
21   echo "  pool: ${name0}"
22   echo " state: ONLINE"
23   echo " scrub: none requested"
24   echo "config:"
25   echo "        NAME        STATE   READ WRITE CKSUM"
26   echo "        ${name0}    ONLINE     0     0     0"
27   echo "          ${disk0}  ONLINE     0     0     0"
28   echo "          ${file0}  ONLINE     0     0     0"
29   echo "errors: No known data errors"
30 )`
31 expect "${exp}" ${ZPOOL} status ${name0}
32 expect_ok ${ZPOOL} destroy ${name0}
33 expect_fl ${ZPOOL} status -x ${name0}
34 expect_fl ${ZPOOL} destroy ${name0}
35
36 expect_fl ${ZPOOL} create ${name0} ${file0} ${disk0}
37 expect_fl ${ZPOOL} status -x ${name0}
38 expect_fl ${ZPOOL} destroy ${name0}
39
40 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${file0} ${disk0}
41 expect_ok ${ZPOOL} status -x ${name0}
42 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
43 exp=`(
44   echo "  pool: ${name0}"
45   echo " state: ONLINE"
46   echo " scrub: none requested"
47   echo "config:"
48   echo "        NAME        STATE   READ WRITE CKSUM"
49   echo "        ${name0}    ONLINE     0     0     0"
50   echo "          ${file0}  ONLINE     0     0     0"
51   echo "          ${disk0}  ONLINE     0     0     0"
52   echo "errors: No known data errors"
53 )`
54 expect "${exp}" ${ZPOOL} status ${name0}
55 expect_ok ${ZPOOL} destroy ${name0}
56 expect_fl ${ZPOOL} status -x ${name0}
57 expect_fl ${ZPOOL} destroy ${name0}
58
59 expect_fl ${ZPOOL} create ${name0} mirror ${disk0} ${file0}
60 expect_fl ${ZPOOL} status -x ${name0}
61 expect_fl ${ZPOOL} destroy ${name0}
62
63 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${disk0} ${file0}
64 expect_ok ${ZPOOL} status -x ${name0}
65 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
66 exp=`(
67   echo "  pool: ${name0}"
68   echo " state: ONLINE"
69   echo " scrub: none requested"
70   echo "config:"
71   echo "        NAME          STATE   READ WRITE CKSUM"
72   echo "        ${name0}      ONLINE     0     0     0"
73   echo "          mirror      ONLINE     0     0     0"
74   echo "            ${disk0}  ONLINE     0     0     0"
75   echo "            ${file0}  ONLINE     0     0     0"
76   echo "errors: No known data errors"
77 )`
78 expect "${exp}" ${ZPOOL} status ${name0}
79 expect_ok ${ZPOOL} destroy ${name0}
80 expect_fl ${ZPOOL} status -x ${name0}
81 expect_fl ${ZPOOL} destroy ${name0}
82
83 expect_fl ${ZPOOL} create ${name0} mirror ${file0} ${disk0}
84 expect_fl ${ZPOOL} status -x ${name0}
85 expect_fl ${ZPOOL} destroy ${name0}
86
87 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${file0} ${disk0}
88 expect_ok ${ZPOOL} status -x ${name0}
89 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
90 exp=`(
91   echo "  pool: ${name0}"
92   echo " state: ONLINE"
93   echo " scrub: none requested"
94   echo "config:"
95   echo "        NAME          STATE   READ WRITE CKSUM"
96   echo "        ${name0}      ONLINE     0     0     0"
97   echo "          mirror      ONLINE     0     0     0"
98   echo "            ${file0}  ONLINE     0     0     0"
99   echo "            ${disk0}  ONLINE     0     0     0"
100   echo "errors: No known data errors"
101 )`
102 expect "${exp}" ${ZPOOL} status ${name0}
103 expect_ok ${ZPOOL} destroy ${name0}
104 expect_fl ${ZPOOL} status -x ${name0}
105 expect_fl ${ZPOOL} destroy ${name0}
106
107 expect_fl ${ZPOOL} create ${name0} mirror ${disk0} ${file0} ${file1}
108 expect_fl ${ZPOOL} status -x ${name0}
109 expect_fl ${ZPOOL} destroy ${name0}
110
111 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${disk0} ${file0} ${file1}
112 expect_ok ${ZPOOL} status -x ${name0}
113 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
114 exp=`(
115   echo "  pool: ${name0}"
116   echo " state: ONLINE"
117   echo " scrub: none requested"
118   echo "config:"
119   echo "        NAME          STATE   READ WRITE CKSUM"
120   echo "        ${name0}      ONLINE     0     0     0"
121   echo "          mirror      ONLINE     0     0     0"
122   echo "            ${disk0}  ONLINE     0     0     0"
123   echo "            ${file0}  ONLINE     0     0     0"
124   echo "            ${file1}  ONLINE     0     0     0"
125   echo "errors: No known data errors"
126 )`
127 expect "${exp}" ${ZPOOL} status ${name0}
128 expect_ok ${ZPOOL} destroy ${name0}
129 expect_fl ${ZPOOL} status -x ${name0}
130 expect_fl ${ZPOOL} destroy ${name0}
131
132 expect_fl ${ZPOOL} create ${name0} mirror ${file0} ${disk0} ${disk1}
133 expect_fl ${ZPOOL} status -x ${name0}
134 expect_fl ${ZPOOL} destroy ${name0}
135
136 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${file0} ${disk0} ${disk1}
137 expect_ok ${ZPOOL} status -x ${name0}
138 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
139 exp=`(
140   echo "  pool: ${name0}"
141   echo " state: ONLINE"
142   echo " scrub: none requested"
143   echo "config:"
144   echo "        NAME          STATE   READ WRITE CKSUM"
145   echo "        ${name0}      ONLINE     0     0     0"
146   echo "          mirror      ONLINE     0     0     0"
147   echo "            ${file0}  ONLINE     0     0     0"
148   echo "            ${disk0}  ONLINE     0     0     0"
149   echo "            ${disk1}  ONLINE     0     0     0"
150   echo "errors: No known data errors"
151 )`
152 expect "${exp}" ${ZPOOL} status ${name0}
153 expect_ok ${ZPOOL} destroy ${name0}
154 expect_fl ${ZPOOL} status -x ${name0}
155 expect_fl ${ZPOOL} destroy ${name0}
156
157 expect_fl ${ZPOOL} create ${name0} raidz1 ${disk0} ${file0}
158 expect_fl ${ZPOOL} status -x ${name0}
159 expect_fl ${ZPOOL} destroy ${name0}
160
161 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${disk0} ${file0}
162 expect_ok ${ZPOOL} status -x ${name0}
163 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
164 exp=`(
165   echo "  pool: ${name0}"
166   echo " state: ONLINE"
167   echo " scrub: none requested"
168   echo "config:"
169   echo "        NAME          STATE   READ WRITE CKSUM"
170   echo "        ${name0}      ONLINE     0     0     0"
171   echo "          raidz1      ONLINE     0     0     0"
172   echo "            ${disk0}  ONLINE     0     0     0"
173   echo "            ${file0}  ONLINE     0     0     0"
174   echo "errors: No known data errors"
175 )`
176 expect "${exp}" ${ZPOOL} status ${name0}
177 expect_ok ${ZPOOL} destroy ${name0}
178 expect_fl ${ZPOOL} status -x ${name0}
179 expect_fl ${ZPOOL} destroy ${name0}
180
181 expect_fl ${ZPOOL} create ${name0} raidz1 ${file0} ${disk0}
182 expect_fl ${ZPOOL} status -x ${name0}
183 expect_fl ${ZPOOL} destroy ${name0}
184
185 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${file0} ${disk0}
186 expect_ok ${ZPOOL} status -x ${name0}
187 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
188 exp=`(
189   echo "  pool: ${name0}"
190   echo " state: ONLINE"
191   echo " scrub: none requested"
192   echo "config:"
193   echo "        NAME          STATE   READ WRITE CKSUM"
194   echo "        ${name0}      ONLINE     0     0     0"
195   echo "          raidz1      ONLINE     0     0     0"
196   echo "            ${file0}  ONLINE     0     0     0"
197   echo "            ${disk0}  ONLINE     0     0     0"
198   echo "errors: No known data errors"
199 )`
200 expect "${exp}" ${ZPOOL} status ${name0}
201 expect_ok ${ZPOOL} destroy ${name0}
202 expect_fl ${ZPOOL} status -x ${name0}
203 expect_fl ${ZPOOL} destroy ${name0}
204
205 expect_fl ${ZPOOL} create ${name0} raidz1 ${disk0} ${file0} ${file1}
206 expect_fl ${ZPOOL} status -x ${name0}
207 expect_fl ${ZPOOL} destroy ${name0}
208
209 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${disk0} ${file0} ${file1}
210 expect_ok ${ZPOOL} status -x ${name0}
211 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
212 exp=`(
213   echo "  pool: ${name0}"
214   echo " state: ONLINE"
215   echo " scrub: none requested"
216   echo "config:"
217   echo "        NAME          STATE   READ WRITE CKSUM"
218   echo "        ${name0}      ONLINE     0     0     0"
219   echo "          raidz1      ONLINE     0     0     0"
220   echo "            ${disk0}  ONLINE     0     0     0"
221   echo "            ${file0}  ONLINE     0     0     0"
222   echo "            ${file1}  ONLINE     0     0     0"
223   echo "errors: No known data errors"
224 )`
225 expect "${exp}" ${ZPOOL} status ${name0}
226 expect_ok ${ZPOOL} destroy ${name0}
227 expect_fl ${ZPOOL} status -x ${name0}
228 expect_fl ${ZPOOL} destroy ${name0}
229
230 expect_fl ${ZPOOL} create ${name0} raidz1 ${file0} ${disk0} ${disk1}
231 expect_fl ${ZPOOL} status -x ${name0}
232 expect_fl ${ZPOOL} destroy ${name0}
233
234 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${file0} ${disk0} ${disk1}
235 expect_ok ${ZPOOL} status -x ${name0}
236 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
237 exp=`(
238   echo "  pool: ${name0}"
239   echo " state: ONLINE"
240   echo " scrub: none requested"
241   echo "config:"
242   echo "        NAME          STATE   READ WRITE CKSUM"
243   echo "        ${name0}      ONLINE     0     0     0"
244   echo "          raidz1      ONLINE     0     0     0"
245   echo "            ${file0}  ONLINE     0     0     0"
246   echo "            ${disk0}  ONLINE     0     0     0"
247   echo "            ${disk1}  ONLINE     0     0     0"
248   echo "errors: No known data errors"
249 )`
250 expect "${exp}" ${ZPOOL} status ${name0}
251 expect_ok ${ZPOOL} destroy ${name0}
252 expect_fl ${ZPOOL} status -x ${name0}
253 expect_fl ${ZPOOL} destroy ${name0}
254
255 expect_fl ${ZPOOL} create ${name0} raidz2 ${disk0} ${file0} ${file1}
256 expect_fl ${ZPOOL} status -x ${name0}
257 expect_fl ${ZPOOL} destroy ${name0}
258
259 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${file0} ${file1}
260 expect_ok ${ZPOOL} status -x ${name0}
261 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
262 exp=`(
263   echo "  pool: ${name0}"
264   echo " state: ONLINE"
265   echo " scrub: none requested"
266   echo "config:"
267   echo "        NAME          STATE   READ WRITE CKSUM"
268   echo "        ${name0}      ONLINE     0     0     0"
269   echo "          raidz2      ONLINE     0     0     0"
270   echo "            ${disk0}  ONLINE     0     0     0"
271   echo "            ${file0}  ONLINE     0     0     0"
272   echo "            ${file1}  ONLINE     0     0     0"
273   echo "errors: No known data errors"
274 )`
275 expect "${exp}" ${ZPOOL} status ${name0}
276 expect_ok ${ZPOOL} destroy ${name0}
277 expect_fl ${ZPOOL} status -x ${name0}
278 expect_fl ${ZPOOL} destroy ${name0}
279
280 expect_fl ${ZPOOL} create ${name0} raidz2 ${file0} ${disk0} ${disk1}
281 expect_fl ${ZPOOL} status -x ${name0}
282 expect_fl ${ZPOOL} destroy ${name0}
283
284 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${file0} ${disk0} ${disk1}
285 expect_ok ${ZPOOL} status -x ${name0}
286 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
287 exp=`(
288   echo "  pool: ${name0}"
289   echo " state: ONLINE"
290   echo " scrub: none requested"
291   echo "config:"
292   echo "        NAME          STATE   READ WRITE CKSUM"
293   echo "        ${name0}      ONLINE     0     0     0"
294   echo "          raidz2      ONLINE     0     0     0"
295   echo "            ${file0}  ONLINE     0     0     0"
296   echo "            ${disk0}  ONLINE     0     0     0"
297   echo "            ${disk1}  ONLINE     0     0     0"
298   echo "errors: No known data errors"
299 )`
300 expect "${exp}" ${ZPOOL} status ${name0}
301 expect_ok ${ZPOOL} destroy ${name0}
302 expect_fl ${ZPOOL} status -x ${name0}
303 expect_fl ${ZPOOL} destroy ${name0}
304
305 expect_fl ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${file0} ${file1}
306 expect_fl ${ZPOOL} status -x ${name0}
307 expect_fl ${ZPOOL} destroy ${name0}
308
309 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${file0} ${file1}
310 expect_ok ${ZPOOL} status -x ${name0}
311 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
312 exp=`(
313   echo "  pool: ${name0}"
314   echo " state: ONLINE"
315   echo " scrub: none requested"
316   echo "config:"
317   echo "        NAME          STATE   READ WRITE CKSUM"
318   echo "        ${name0}      ONLINE     0     0     0"
319   echo "          raidz2      ONLINE     0     0     0"
320   echo "            ${disk0}  ONLINE     0     0     0"
321   echo "            ${disk1}  ONLINE     0     0     0"
322   echo "            ${file0}  ONLINE     0     0     0"
323   echo "            ${file1}  ONLINE     0     0     0"
324   echo "errors: No known data errors"
325 )`
326 expect "${exp}" ${ZPOOL} status ${name0}
327 expect_ok ${ZPOOL} destroy ${name0}
328 expect_fl ${ZPOOL} status -x ${name0}
329 expect_fl ${ZPOOL} destroy ${name0}
330
331 expect_fl ${ZPOOL} create ${name0} raidz2 ${file0} ${disk0} ${file1} ${disk1}
332 expect_fl ${ZPOOL} status -x ${name0}
333 expect_fl ${ZPOOL} destroy ${name0}
334
335 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${file0} ${disk0} ${file1} ${disk1}
336 expect_ok ${ZPOOL} status -x ${name0}
337 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
338 exp=`(
339   echo "  pool: ${name0}"
340   echo " state: ONLINE"
341   echo " scrub: none requested"
342   echo "config:"
343   echo "        NAME          STATE   READ WRITE CKSUM"
344   echo "        ${name0}      ONLINE     0     0     0"
345   echo "          raidz2      ONLINE     0     0     0"
346   echo "            ${file0}  ONLINE     0     0     0"
347   echo "            ${disk0}  ONLINE     0     0     0"
348   echo "            ${file1}  ONLINE     0     0     0"
349   echo "            ${disk1}  ONLINE     0     0     0"
350   echo "errors: No known data errors"
351 )`
352 expect "${exp}" ${ZPOOL} status ${name0}
353 expect_ok ${ZPOOL} destroy ${name0}
354 expect_fl ${ZPOOL} status -x ${name0}
355 expect_fl ${ZPOOL} destroy ${name0}
356
357 add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
358 expect_fl ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${file0}
359 expect_fl ${ZPOOL} status -x ${name0}
360 expect_fl ${ZPOOL} destroy ${name0}
361 add_msg=""
362
363 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} log mirror ${disk1} ${file0}
364 expect_ok ${ZPOOL} status -x ${name0}
365 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
366 exp=`(
367   echo "  pool: ${name0}"
368   echo " state: ONLINE"
369   echo " scrub: none requested"
370   echo "config:"
371   echo "        NAME          STATE   READ WRITE CKSUM"
372   echo "        ${name0}      ONLINE     0     0     0"
373   echo "          ${disk0}    ONLINE     0     0     0"
374   echo "        logs          ONLINE     0     0     0"
375   echo "          mirror      ONLINE     0     0     0"
376   echo "            ${disk1}  ONLINE     0     0     0"
377   echo "            ${file0}  ONLINE     0     0     0"
378   echo "errors: No known data errors"
379 )`
380 expect "${exp}" ${ZPOOL} status ${name0}
381 expect_ok ${ZPOOL} destroy ${name0}
382 expect_fl ${ZPOOL} status -x ${name0}
383 expect_fl ${ZPOOL} destroy ${name0}
384
385 add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
386 expect_fl ${ZPOOL} create ${name0} ${file0} log mirror ${file1} ${disk0}
387 expect_fl ${ZPOOL} status -x ${name0}
388 expect_fl ${ZPOOL} destroy ${name0}
389 add_msg=""
390
391 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${file0} log mirror ${file1} ${disk0}
392 expect_ok ${ZPOOL} status -x ${name0}
393 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
394 exp=`(
395   echo "  pool: ${name0}"
396   echo " state: ONLINE"
397   echo " scrub: none requested"
398   echo "config:"
399   echo "        NAME          STATE   READ WRITE CKSUM"
400   echo "        ${name0}      ONLINE     0     0     0"
401   echo "          ${file0}    ONLINE     0     0     0"
402   echo "        logs          ONLINE     0     0     0"
403   echo "          mirror      ONLINE     0     0     0"
404   echo "            ${file1}  ONLINE     0     0     0"
405   echo "            ${disk0}  ONLINE     0     0     0"
406   echo "errors: No known data errors"
407 )`
408 expect "${exp}" ${ZPOOL} status ${name0}
409 expect_ok ${ZPOOL} destroy ${name0}
410 expect_fl ${ZPOOL} status -x ${name0}
411 expect_fl ${ZPOOL} destroy ${name0}
412
413 disks_destroy
414 files_destroy