1#!/bin/sh
2
3dir=`dirname $0`
4. ${dir}/../../misc.sh
5
6echo "1..70"
7
8disks_create 6
9names_create 1
10
11expect_fl ${ZPOOL} create ${name0} ${disk0} mirror ${disk1} ${disk2}
12expect_fl ${ZPOOL} status -x ${name0}
13expect_fl ${ZPOOL} destroy ${name0}
14
15expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} mirror ${disk1} ${disk2}
16expect_ok ${ZPOOL} status -x ${name0}
17expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
18exp=`(
19  echo "  pool: ${name0}"
20  echo " state: ONLINE"
21  echo " scrub: none requested"
22  echo "config:"
23  echo "	NAME          STATE   READ WRITE CKSUM"
24  echo "	${name0}      ONLINE     0     0     0"
25  echo "	  ${disk0}    ONLINE     0     0     0"
26  echo "	  mirror      ONLINE     0     0     0"
27  echo "	    ${disk1}  ONLINE     0     0     0"
28  echo "	    ${disk2}  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} ${disk0} ${disk1} mirror ${disk2} ${disk3}
37expect_fl ${ZPOOL} status -x ${name0}
38expect_fl ${ZPOOL} destroy ${name0}
39
40expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} mirror ${disk2} ${disk3}
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 "	  ${disk0}    ONLINE     0     0     0"
51  echo "	  ${disk1}    ONLINE     0     0     0"
52  echo "	  mirror      ONLINE     0     0     0"
53  echo "	    ${disk2}  ONLINE     0     0     0"
54  echo "	    ${disk3}  ONLINE     0     0     0"
55  echo "errors: No known data errors"
56)`
57expect "${exp}" ${ZPOOL} status ${name0}
58expect_ok ${ZPOOL} destroy ${name0}
59expect_fl ${ZPOOL} status -x ${name0}
60expect_fl ${ZPOOL} destroy ${name0}
61
62expect_fl ${ZPOOL} create ${name0} ${disk0} raidz ${disk1} ${disk2} ${disk3}
63expect_fl ${ZPOOL} status -x ${name0}
64expect_fl ${ZPOOL} destroy ${name0}
65
66expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} raidz ${disk1} ${disk2} ${disk3}
67expect_ok ${ZPOOL} status -x ${name0}
68expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
69exp=`(
70  echo "  pool: ${name0}"
71  echo " state: ONLINE"
72  echo " scrub: none requested"
73  echo "config:"
74  echo "	NAME          STATE   READ WRITE CKSUM"
75  echo "	${name0}      ONLINE     0     0     0"
76  echo "	  ${disk0}    ONLINE     0     0     0"
77  echo "	  raidz1      ONLINE     0     0     0"
78  echo "	    ${disk1}  ONLINE     0     0     0"
79  echo "	    ${disk2}  ONLINE     0     0     0"
80  echo "	    ${disk3}  ONLINE     0     0     0"
81  echo "errors: No known data errors"
82)`
83expect "${exp}" ${ZPOOL} status ${name0}
84expect_ok ${ZPOOL} destroy ${name0}
85expect_fl ${ZPOOL} status -x ${name0}
86expect_fl ${ZPOOL} destroy ${name0}
87
88expect_fl ${ZPOOL} create ${name0} ${disk0} ${disk1} raidz1 ${disk2} ${disk3} ${disk4}
89expect_fl ${ZPOOL} status -x ${name0}
90expect_fl ${ZPOOL} destroy ${name0}
91
92expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} raidz1 ${disk2} ${disk3} ${disk4}
93expect_ok ${ZPOOL} status -x ${name0}
94expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
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 "	  ${disk0}    ONLINE     0     0     0"
103  echo "	  ${disk1}    ONLINE     0     0     0"
104  echo "	  raidz1      ONLINE     0     0     0"
105  echo "	    ${disk2}  ONLINE     0     0     0"
106  echo "	    ${disk3}  ONLINE     0     0     0"
107  echo "	    ${disk4}  ONLINE     0     0     0"
108  echo "errors: No known data errors"
109)`
110expect "${exp}" ${ZPOOL} status ${name0}
111expect_ok ${ZPOOL} destroy ${name0}
112expect_fl ${ZPOOL} status -x ${name0}
113expect_fl ${ZPOOL} destroy ${name0}
114
115expect_fl ${ZPOOL} create ${name0} ${disk0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
116expect_fl ${ZPOOL} status -x ${name0}
117expect_fl ${ZPOOL} destroy ${name0}
118
119expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
120expect_ok ${ZPOOL} status -x ${name0}
121expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
122exp=`(
123  echo "  pool: ${name0}"
124  echo " state: ONLINE"
125  echo " scrub: none requested"
126  echo "config:"
127  echo "	NAME          STATE   READ WRITE CKSUM"
128  echo "	${name0}      ONLINE     0     0     0"
129  echo "	  ${disk0}    ONLINE     0     0     0"
130  echo "	  raidz2      ONLINE     0     0     0"
131  echo "	    ${disk1}  ONLINE     0     0     0"
132  echo "	    ${disk2}  ONLINE     0     0     0"
133  echo "	    ${disk3}  ONLINE     0     0     0"
134  echo "	    ${disk4}  ONLINE     0     0     0"
135  echo "errors: No known data errors"
136)`
137expect "${exp}" ${ZPOOL} status ${name0}
138expect_ok ${ZPOOL} destroy ${name0}
139expect_fl ${ZPOOL} status -x ${name0}
140expect_fl ${ZPOOL} destroy ${name0}
141
142expect_fl ${ZPOOL} create ${name0} ${disk0} ${disk1} raidz2 ${disk2} ${disk3} ${disk4} ${disk5}
143expect_fl ${ZPOOL} status -x ${name0}
144expect_fl ${ZPOOL} destroy ${name0}
145
146expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} ${disk1} raidz2 ${disk2} ${disk3} ${disk4} ${disk5}
147expect_ok ${ZPOOL} status -x ${name0}
148expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
149exp=`(
150  echo "  pool: ${name0}"
151  echo " state: ONLINE"
152  echo " scrub: none requested"
153  echo "config:"
154  echo "	NAME          STATE   READ WRITE CKSUM"
155  echo "	${name0}      ONLINE     0     0     0"
156  echo "	  ${disk0}    ONLINE     0     0     0"
157  echo "	  ${disk1}    ONLINE     0     0     0"
158  echo "	  raidz2      ONLINE     0     0     0"
159  echo "	    ${disk2}  ONLINE     0     0     0"
160  echo "	    ${disk3}  ONLINE     0     0     0"
161  echo "	    ${disk4}  ONLINE     0     0     0"
162  echo "	    ${disk5}  ONLINE     0     0     0"
163  echo "errors: No known data errors"
164)`
165expect "${exp}" ${ZPOOL} status ${name0}
166expect_ok ${ZPOOL} destroy ${name0}
167expect_fl ${ZPOOL} status -x ${name0}
168expect_fl ${ZPOOL} destroy ${name0}
169
170add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
171expect_fl ${ZPOOL} create ${name0} ${disk0} log ${disk1} mirror ${disk2} ${disk3}
172expect_fl ${ZPOOL} status -x ${name0}
173expect_fl ${ZPOOL} destroy ${name0}
174add_msg=""
175
176expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} ${disk0} log ${disk1} mirror ${disk2} ${disk3}
177expect_ok ${ZPOOL} status -x ${name0}
178expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
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 "	  ${disk0}    ONLINE     0     0     0"
187  echo "	logs          ONLINE     0     0     0"
188  echo "	  ${disk1}    ONLINE     0     0     0"
189  echo "	  mirror      ONLINE     0     0     0"
190  echo "	    ${disk2}  ONLINE     0     0     0"
191  echo "	    ${disk3}  ONLINE     0     0     0"
192  echo "errors: No known data errors"
193)`
194expect "${exp}" ${ZPOOL} status ${name0}
195expect_ok ${ZPOOL} destroy ${name0}
196expect_fl ${ZPOOL} status -x ${name0}
197expect_fl ${ZPOOL} destroy ${name0}
198
199disks_destroy
200