1#!/bin/sh
2# $FreeBSD$
3
4dir=`dirname $0`
5. ${dir}/../../misc.sh
6
7echo "1..160"
8
9disks_create 6
10files_create 2
11names_create 1
12
13expect_fl ${ZPOOL} create ${name0} ${disk0} ${file0}
14expect_fl ${ZPOOL} status -x ${name0}
15expect_fl ${ZPOOL} destroy ${name0}
16
17expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${file0}
18expect_ok ${ZPOOL} status -x ${name0}
19expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
20exp=`(
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)`
31expect "${exp}" ${ZPOOL} status ${name0}
32expect_ok ${ZPOOL} destroy ${name0}
33expect_fl ${ZPOOL} status -x ${name0}
34expect_fl ${ZPOOL} destroy ${name0}
35
36expect_fl ${ZPOOL} create ${name0} ${file0} ${disk0}
37expect_fl ${ZPOOL} status -x ${name0}
38expect_fl ${ZPOOL} destroy ${name0}
39
40expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${file0} ${disk0}
41expect_ok ${ZPOOL} status -x ${name0}
42expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
43exp=`(
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)`
54expect "${exp}" ${ZPOOL} status ${name0}
55expect_ok ${ZPOOL} destroy ${name0}
56expect_fl ${ZPOOL} status -x ${name0}
57expect_fl ${ZPOOL} destroy ${name0}
58
59expect_fl ${ZPOOL} create ${name0} mirror ${disk0} ${file0}
60expect_fl ${ZPOOL} status -x ${name0}
61expect_fl ${ZPOOL} destroy ${name0}
62
63expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${disk0} ${file0}
64expect_ok ${ZPOOL} status -x ${name0}
65expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
66exp=`(
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)`
78expect "${exp}" ${ZPOOL} status ${name0}
79expect_ok ${ZPOOL} destroy ${name0}
80expect_fl ${ZPOOL} status -x ${name0}
81expect_fl ${ZPOOL} destroy ${name0}
82
83expect_fl ${ZPOOL} create ${name0} mirror ${file0} ${disk0}
84expect_fl ${ZPOOL} status -x ${name0}
85expect_fl ${ZPOOL} destroy ${name0}
86
87expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${file0} ${disk0}
88expect_ok ${ZPOOL} status -x ${name0}
89expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
90exp=`(
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)`
102expect "${exp}" ${ZPOOL} status ${name0}
103expect_ok ${ZPOOL} destroy ${name0}
104expect_fl ${ZPOOL} status -x ${name0}
105expect_fl ${ZPOOL} destroy ${name0}
106
107expect_fl ${ZPOOL} create ${name0} mirror ${disk0} ${file0} ${file1}
108expect_fl ${ZPOOL} status -x ${name0}
109expect_fl ${ZPOOL} destroy ${name0}
110
111expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${disk0} ${file0} ${file1}
112expect_ok ${ZPOOL} status -x ${name0}
113expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
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 "	  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)`
127expect "${exp}" ${ZPOOL} status ${name0}
128expect_ok ${ZPOOL} destroy ${name0}
129expect_fl ${ZPOOL} status -x ${name0}
130expect_fl ${ZPOOL} destroy ${name0}
131
132expect_fl ${ZPOOL} create ${name0} mirror ${file0} ${disk0} ${disk1}
133expect_fl ${ZPOOL} status -x ${name0}
134expect_fl ${ZPOOL} destroy ${name0}
135
136expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${file0} ${disk0} ${disk1}
137expect_ok ${ZPOOL} status -x ${name0}
138expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
139exp=`(
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)`
152expect "${exp}" ${ZPOOL} status ${name0}
153expect_ok ${ZPOOL} destroy ${name0}
154expect_fl ${ZPOOL} status -x ${name0}
155expect_fl ${ZPOOL} destroy ${name0}
156
157expect_fl ${ZPOOL} create ${name0} raidz1 ${disk0} ${file0}
158expect_fl ${ZPOOL} status -x ${name0}
159expect_fl ${ZPOOL} destroy ${name0}
160
161expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${disk0} ${file0}
162expect_ok ${ZPOOL} status -x ${name0}
163expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
164exp=`(
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)`
176expect "${exp}" ${ZPOOL} status ${name0}
177expect_ok ${ZPOOL} destroy ${name0}
178expect_fl ${ZPOOL} status -x ${name0}
179expect_fl ${ZPOOL} destroy ${name0}
180
181expect_fl ${ZPOOL} create ${name0} raidz1 ${file0} ${disk0}
182expect_fl ${ZPOOL} status -x ${name0}
183expect_fl ${ZPOOL} destroy ${name0}
184
185expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${file0} ${disk0}
186expect_ok ${ZPOOL} status -x ${name0}
187expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
188exp=`(
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)`
200expect "${exp}" ${ZPOOL} status ${name0}
201expect_ok ${ZPOOL} destroy ${name0}
202expect_fl ${ZPOOL} status -x ${name0}
203expect_fl ${ZPOOL} destroy ${name0}
204
205expect_fl ${ZPOOL} create ${name0} raidz1 ${disk0} ${file0} ${file1}
206expect_fl ${ZPOOL} status -x ${name0}
207expect_fl ${ZPOOL} destroy ${name0}
208
209expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${disk0} ${file0} ${file1}
210expect_ok ${ZPOOL} status -x ${name0}
211expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
212exp=`(
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)`
225expect "${exp}" ${ZPOOL} status ${name0}
226expect_ok ${ZPOOL} destroy ${name0}
227expect_fl ${ZPOOL} status -x ${name0}
228expect_fl ${ZPOOL} destroy ${name0}
229
230expect_fl ${ZPOOL} create ${name0} raidz1 ${file0} ${disk0} ${disk1}
231expect_fl ${ZPOOL} status -x ${name0}
232expect_fl ${ZPOOL} destroy ${name0}
233
234expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${file0} ${disk0} ${disk1}
235expect_ok ${ZPOOL} status -x ${name0}
236expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
237exp=`(
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)`
250expect "${exp}" ${ZPOOL} status ${name0}
251expect_ok ${ZPOOL} destroy ${name0}
252expect_fl ${ZPOOL} status -x ${name0}
253expect_fl ${ZPOOL} destroy ${name0}
254
255expect_fl ${ZPOOL} create ${name0} raidz2 ${disk0} ${file0} ${file1}
256expect_fl ${ZPOOL} status -x ${name0}
257expect_fl ${ZPOOL} destroy ${name0}
258
259expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${file0} ${file1}
260expect_ok ${ZPOOL} status -x ${name0}
261expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
262exp=`(
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)`
275expect "${exp}" ${ZPOOL} status ${name0}
276expect_ok ${ZPOOL} destroy ${name0}
277expect_fl ${ZPOOL} status -x ${name0}
278expect_fl ${ZPOOL} destroy ${name0}
279
280expect_fl ${ZPOOL} create ${name0} raidz2 ${file0} ${disk0} ${disk1}
281expect_fl ${ZPOOL} status -x ${name0}
282expect_fl ${ZPOOL} destroy ${name0}
283
284expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${file0} ${disk0} ${disk1}
285expect_ok ${ZPOOL} status -x ${name0}
286expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
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 "	  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)`
300expect "${exp}" ${ZPOOL} status ${name0}
301expect_ok ${ZPOOL} destroy ${name0}
302expect_fl ${ZPOOL} status -x ${name0}
303expect_fl ${ZPOOL} destroy ${name0}
304
305expect_fl ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${file0} ${file1}
306expect_fl ${ZPOOL} status -x ${name0}
307expect_fl ${ZPOOL} destroy ${name0}
308
309expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${file0} ${file1}
310expect_ok ${ZPOOL} status -x ${name0}
311expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
312exp=`(
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)`
326expect "${exp}" ${ZPOOL} status ${name0}
327expect_ok ${ZPOOL} destroy ${name0}
328expect_fl ${ZPOOL} status -x ${name0}
329expect_fl ${ZPOOL} destroy ${name0}
330
331expect_fl ${ZPOOL} create ${name0} raidz2 ${file0} ${disk0} ${file1} ${disk1}
332expect_fl ${ZPOOL} status -x ${name0}
333expect_fl ${ZPOOL} destroy ${name0}
334
335expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${file0} ${disk0} ${file1} ${disk1}
336expect_ok ${ZPOOL} status -x ${name0}
337expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
338exp=`(
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)`
352expect "${exp}" ${ZPOOL} status ${name0}
353expect_ok ${ZPOOL} destroy ${name0}
354expect_fl ${ZPOOL} status -x ${name0}
355expect_fl ${ZPOOL} destroy ${name0}
356
357add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
358expect_fl ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${file0}
359expect_fl ${ZPOOL} status -x ${name0}
360expect_fl ${ZPOOL} destroy ${name0}
361add_msg=""
362
363expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} log mirror ${disk1} ${file0}
364expect_ok ${ZPOOL} status -x ${name0}
365expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
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 "	    ${file0}  ONLINE     0     0     0"
378  echo "errors: No known data errors"
379)`
380expect "${exp}" ${ZPOOL} status ${name0}
381expect_ok ${ZPOOL} destroy ${name0}
382expect_fl ${ZPOOL} status -x ${name0}
383expect_fl ${ZPOOL} destroy ${name0}
384
385add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
386expect_fl ${ZPOOL} create ${name0} ${file0} log mirror ${file1} ${disk0}
387expect_fl ${ZPOOL} status -x ${name0}
388expect_fl ${ZPOOL} destroy ${name0}
389add_msg=""
390
391expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${file0} log mirror ${file1} ${disk0}
392expect_ok ${ZPOOL} status -x ${name0}
393expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
394exp=`(
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)`
408expect "${exp}" ${ZPOOL} status ${name0}
409expect_ok ${ZPOOL} destroy ${name0}
410expect_fl ${ZPOOL} status -x ${name0}
411expect_fl ${ZPOOL} destroy ${name0}
412
413disks_destroy
414files_destroy
415