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