1#!/bin/sh
2# $FreeBSD$
3
4dir=`dirname $0`
5. ${dir}/../../misc.sh
6
7echo "1..100"
8
9disks_create 7
10disks_create 1 64M
11files_create 7
12files_create 1 64M
13names_create 1
14
15expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
16expect_fl ${ZPOOL} add ${name0} mirror ${disk7} ${disk2}
17exp=`(
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)`
29expect "${exp}" ${ZPOOL} status ${name0}
30expect_ok ${ZPOOL} destroy ${name0}
31expect_fl ${ZPOOL} status -x ${name0}
32
33expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
34expect_ok ${ZPOOL} add -f ${name0} mirror ${disk7} ${disk2}
35exp=`(
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)`
50expect "${exp}" ${ZPOOL} status ${name0}
51expect_ok ${ZPOOL} destroy ${name0}
52expect_fl ${ZPOOL} status -x ${name0}
53
54expect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1}
55expect_fl ${ZPOOL} add ${name0} mirror ${file7} ${file2}
56exp=`(
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)`
68expect "${exp}" ${ZPOOL} status ${name0}
69expect_ok ${ZPOOL} destroy ${name0}
70expect_fl ${ZPOOL} status -x ${name0}
71
72expect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1}
73expect_ok ${ZPOOL} add -f ${name0} mirror ${file7} ${file2}
74exp=`(
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)`
89expect "${exp}" ${ZPOOL} status ${name0}
90expect_ok ${ZPOOL} destroy ${name0}
91expect_fl ${ZPOOL} status -x ${name0}
92
93expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
94expect_fl ${ZPOOL} add ${name0} raidz1 ${disk3} ${disk7} ${disk4}
95exp=`(
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)`
108expect "${exp}" ${ZPOOL} status ${name0}
109expect_ok ${ZPOOL} destroy ${name0}
110expect_fl ${ZPOOL} status -x ${name0}
111
112expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
113expect_ok ${ZPOOL} add -f ${name0} raidz1 ${disk3} ${disk7} ${disk4}
114exp=`(
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)`
131expect "${exp}" ${ZPOOL} status ${name0}
132expect_ok ${ZPOOL} destroy ${name0}
133expect_fl ${ZPOOL} status -x ${name0}
134
135expect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2}
136expect_fl ${ZPOOL} add ${name0} raidz1 ${file3} ${file7} ${file4}
137exp=`(
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)`
150expect "${exp}" ${ZPOOL} status ${name0}
151expect_ok ${ZPOOL} destroy ${name0}
152expect_fl ${ZPOOL} status -x ${name0}
153
154expect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2}
155expect_ok ${ZPOOL} add -f ${name0} raidz1 ${file3} ${file7} ${file4}
156exp=`(
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)`
173expect "${exp}" ${ZPOOL} status ${name0}
174expect_ok ${ZPOOL} destroy ${name0}
175expect_fl ${ZPOOL} status -x ${name0}
176
177expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
178expect_fl ${ZPOOL} add ${name0} raidz2 ${disk4} ${disk5} ${disk6} ${disk7}
179exp=`(
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)`
193expect "${exp}" ${ZPOOL} status ${name0}
194expect_ok ${ZPOOL} destroy ${name0}
195expect_fl ${ZPOOL} status -x ${name0}
196
197expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
198expect_ok ${ZPOOL} add -f ${name0} raidz2 ${disk4} ${disk5} ${disk6} ${disk7}
199exp=`(
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)`
218expect "${exp}" ${ZPOOL} status ${name0}
219expect_ok ${ZPOOL} destroy ${name0}
220expect_fl ${ZPOOL} status -x ${name0}
221
222expect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3}
223expect_fl ${ZPOOL} add ${name0} raidz2 ${file4} ${file5} ${file6} ${file7}
224exp=`(
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)`
238expect "${exp}" ${ZPOOL} status ${name0}
239expect_ok ${ZPOOL} destroy ${name0}
240expect_fl ${ZPOOL} status -x ${name0}
241
242expect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3}
243expect_ok ${ZPOOL} add -f ${name0} raidz2 ${file4} ${file5} ${file6} ${file7}
244exp=`(
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)`
263expect "${exp}" ${ZPOOL} status ${name0}
264expect_ok ${ZPOOL} destroy ${name0}
265expect_fl ${ZPOOL} status -x ${name0}
266
267expect_ok ${ZPOOL} create ${name0} ${disk0}
268add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
269expect_fl ${ZPOOL} add ${name0} log mirror ${disk1} ${disk7}
270exp=`(
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)`
280expect "${exp}" ${ZPOOL} status ${name0}
281add_msg=""
282expect_ok ${ZPOOL} destroy ${name0}
283expect_fl ${ZPOOL} status -x ${name0}
284
285expect_ok ${ZPOOL} create ${name0} ${disk0}
286expect_ok ${ZPOOL} add -f ${name0} log mirror ${disk1} ${disk7}
287exp=`(
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)`
301expect "${exp}" ${ZPOOL} status ${name0}
302expect_ok ${ZPOOL} destroy ${name0}
303expect_fl ${ZPOOL} status -x ${name0}
304
305expect_ok ${ZPOOL} create ${name0} ${file0}
306add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
307expect_fl ${ZPOOL} add ${name0} log mirror ${file1} ${file7}
308exp=`(
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)`
318expect "${exp}" ${ZPOOL} status ${name0}
319add_msg=""
320expect_ok ${ZPOOL} destroy ${name0}
321expect_fl ${ZPOOL} status -x ${name0}
322
323expect_ok ${ZPOOL} create ${name0} ${file0}
324expect_ok ${ZPOOL} add -f ${name0} log mirror ${file1} ${file7}
325exp=`(
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)`
339expect "${exp}" ${ZPOOL} status ${name0}
340expect_ok ${ZPOOL} destroy ${name0}
341expect_fl ${ZPOOL} status -x ${name0}
342
343expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
344add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
345expect_fl ${ZPOOL} add ${name0} log mirror ${disk3} ${disk7}
346exp=`(
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)`
360expect "${exp}" ${ZPOOL} status ${name0}
361add_msg=""
362expect_ok ${ZPOOL} destroy ${name0}
363expect_fl ${ZPOOL} status -x ${name0}
364
365expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
366expect_ok ${ZPOOL} add -f ${name0} log mirror ${disk3} ${disk7}
367exp=`(
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)`
384expect "${exp}" ${ZPOOL} status ${name0}
385expect_ok ${ZPOOL} destroy ${name0}
386expect_fl ${ZPOOL} status -x ${name0}
387
388expect_ok ${ZPOOL} create ${name0} ${file0} log mirror ${file1} ${file2}
389add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
390expect_fl ${ZPOOL} add ${name0} log mirror ${file3} ${file7}
391exp=`(
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)`
405expect "${exp}" ${ZPOOL} status ${name0}
406add_msg=""
407expect_ok ${ZPOOL} destroy ${name0}
408expect_fl ${ZPOOL} status -x ${name0}
409
410expect_ok ${ZPOOL} create ${name0} ${file0} log mirror ${file1} ${file2}
411expect_ok ${ZPOOL} add -f ${name0} log mirror ${file3} ${file7}
412exp=`(
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)`
429expect "${exp}" ${ZPOOL} status ${name0}
430expect_ok ${ZPOOL} destroy ${name0}
431expect_fl ${ZPOOL} status -x ${name0}
432
433disks_destroy
434files_destroy
435