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