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