xref: /freebsd/tools/regression/zfs/zpool/add/log.t (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1#!/bin/sh
2
3dir=`dirname $0`
4. ${dir}/../../misc.sh
5
6echo "1..66"
7
8disks_create 7
9names_create 1
10
11expect_ok ${ZPOOL} create ${name0} ${disk0}
12expect_ok ${ZPOOL} add ${name0} log ${disk1}
13exp=`(
14  echo "  pool: ${name0}"
15  echo " state: ONLINE"
16  echo " scrub: none requested"
17  echo "config:"
18  echo "	NAME        STATE   READ WRITE CKSUM"
19  echo "	${name0}    ONLINE     0     0     0"
20  echo "	  ${disk0}  ONLINE     0     0     0"
21  echo "	logs        ONLINE       0     0     0"
22  echo "	  ${disk1}  ONLINE     0     0     0"
23  echo "errors: No known data errors"
24)`
25expect "${exp}" ${ZPOOL} status ${name0}
26expect_ok ${ZPOOL} destroy ${name0}
27expect_fl ${ZPOOL} status -x ${name0}
28
29expect_ok ${ZPOOL} create ${name0} ${disk0}
30expect_ok ${ZPOOL} add ${name0} log mirror ${disk1} ${disk2} ${disk3}
31exp=`(
32  echo "  pool: ${name0}"
33  echo " state: ONLINE"
34  echo " scrub: none requested"
35  echo "config:"
36  echo "	NAME          STATE   READ WRITE CKSUM"
37  echo "	${name0}      ONLINE     0     0     0"
38  echo "	  ${disk0}    ONLINE     0     0     0"
39  echo "	logs          ONLINE     0     0     0"
40  echo "	  mirror      ONLINE     0     0     0"
41  echo "	    ${disk1}  ONLINE     0     0     0"
42  echo "	    ${disk2}  ONLINE     0     0     0"
43  echo "	    ${disk3}  ONLINE     0     0     0"
44  echo "errors: No known data errors"
45)`
46expect "${exp}" ${ZPOOL} status ${name0}
47expect_ok ${ZPOOL} destroy ${name0}
48expect_fl ${ZPOOL} status -x ${name0}
49
50expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
51expect_ok ${ZPOOL} add ${name0} log ${disk2}
52exp=`(
53  echo "  pool: ${name0}"
54  echo " state: ONLINE"
55  echo " scrub: none requested"
56  echo "config:"
57  echo "	NAME          STATE   READ WRITE CKSUM"
58  echo "	${name0}      ONLINE     0     0     0"
59  echo "	  mirror      ONLINE     0     0     0"
60  echo "	    ${disk0}  ONLINE     0     0     0"
61  echo "	    ${disk1}  ONLINE     0     0     0"
62  echo "	logs          ONLINE     0     0     0"
63  echo "	  ${disk2}    ONLINE     0     0     0"
64  echo "errors: No known data errors"
65)`
66expect "${exp}" ${ZPOOL} status ${name0}
67expect_ok ${ZPOOL} destroy ${name0}
68expect_fl ${ZPOOL} status -x ${name0}
69
70expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
71expect_ok ${ZPOOL} add ${name0} log mirror ${disk2} ${disk3} ${disk4}
72exp=`(
73  echo "  pool: ${name0}"
74  echo " state: ONLINE"
75  echo " scrub: none requested"
76  echo "config:"
77  echo "	NAME          STATE   READ WRITE CKSUM"
78  echo "	${name0}      ONLINE     0     0     0"
79  echo "	  mirror      ONLINE     0     0     0"
80  echo "	    ${disk0}  ONLINE     0     0     0"
81  echo "	    ${disk1}  ONLINE     0     0     0"
82  echo "	logs          ONLINE     0     0     0"
83  echo "	  mirror      ONLINE     0     0     0"
84  echo "	    ${disk2}  ONLINE     0     0     0"
85  echo "	    ${disk3}  ONLINE     0     0     0"
86  echo "	    ${disk4}  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} raidz ${disk0} ${disk1} ${disk2}
94expect_ok ${ZPOOL} add ${name0} log ${disk3}
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 "	logs          ONLINE     0     0     0"
107  echo "	  ${disk3}    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}
113
114expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
115expect_ok ${ZPOOL} add ${name0} log mirror ${disk3} ${disk4} ${disk5}
116exp=`(
117  echo "  pool: ${name0}"
118  echo " state: ONLINE"
119  echo " scrub: none requested"
120  echo "config:"
121  echo "	NAME          STATE   READ WRITE CKSUM"
122  echo "	${name0}      ONLINE     0     0     0"
123  echo "	  raidz1      ONLINE     0     0     0"
124  echo "	    ${disk0}  ONLINE     0     0     0"
125  echo "	    ${disk1}  ONLINE     0     0     0"
126  echo "	    ${disk2}  ONLINE     0     0     0"
127  echo "	logs          ONLINE     0     0     0"
128  echo "	  mirror      ONLINE     0     0     0"
129  echo "	    ${disk3}  ONLINE     0     0     0"
130  echo "	    ${disk4}  ONLINE     0     0     0"
131  echo "	    ${disk5}  ONLINE     0     0     0"
132  echo "errors: No known data errors"
133)`
134expect "${exp}" ${ZPOOL} status ${name0}
135expect_ok ${ZPOOL} destroy ${name0}
136expect_fl ${ZPOOL} status -x ${name0}
137
138expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
139expect_ok ${ZPOOL} add ${name0} log ${disk4}
140exp=`(
141  echo "  pool: ${name0}"
142  echo " state: ONLINE"
143  echo " scrub: none requested"
144  echo "config:"
145  echo "	NAME          STATE   READ WRITE CKSUM"
146  echo "	${name0}      ONLINE     0     0     0"
147  echo "	  raidz2      ONLINE     0     0     0"
148  echo "	    ${disk0}  ONLINE     0     0     0"
149  echo "	    ${disk1}  ONLINE     0     0     0"
150  echo "	    ${disk2}  ONLINE     0     0     0"
151  echo "	    ${disk3}  ONLINE     0     0     0"
152  echo "	logs          ONLINE     0     0     0"
153  echo "	  ${disk4}    ONLINE     0     0     0"
154  echo "errors: No known data errors"
155)`
156expect "${exp}" ${ZPOOL} status ${name0}
157expect_ok ${ZPOOL} destroy ${name0}
158expect_fl ${ZPOOL} status -x ${name0}
159
160expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
161expect_ok ${ZPOOL} add ${name0} log mirror ${disk4} ${disk5} ${disk6}
162exp=`(
163  echo "  pool: ${name0}"
164  echo " state: ONLINE"
165  echo " scrub: none requested"
166  echo "config:"
167  echo "	NAME          STATE   READ WRITE CKSUM"
168  echo "	${name0}      ONLINE     0     0     0"
169  echo "	  raidz2      ONLINE     0     0     0"
170  echo "	    ${disk0}  ONLINE     0     0     0"
171  echo "	    ${disk1}  ONLINE     0     0     0"
172  echo "	    ${disk2}  ONLINE     0     0     0"
173  echo "	    ${disk3}  ONLINE     0     0     0"
174  echo "	logs          ONLINE     0     0     0"
175  echo "	  mirror      ONLINE     0     0     0"
176  echo "	    ${disk4}  ONLINE     0     0     0"
177  echo "	    ${disk5}  ONLINE     0     0     0"
178  echo "	    ${disk6}  ONLINE     0     0     0"
179  echo "errors: No known data errors"
180)`
181expect "${exp}" ${ZPOOL} status ${name0}
182expect_ok ${ZPOOL} destroy ${name0}
183expect_fl ${ZPOOL} status -x ${name0}
184
185expect_ok ${ZPOOL} create ${name0} ${disk0}
186expect_ok ${ZPOOL} add ${name0} log ${disk1}
187expect_ok ${ZPOOL} add ${name0} log ${disk2}
188expect_ok ${ZPOOL} add ${name0} log ${disk3}
189exp=`(
190  echo "  pool: ${name0}"
191  echo " state: ONLINE"
192  echo " scrub: none requested"
193  echo "config:"
194  echo "	NAME        STATE   READ WRITE CKSUM"
195  echo "	${name0}    ONLINE     0     0     0"
196  echo "	  ${disk0}  ONLINE     0     0     0"
197  echo "	logs        ONLINE     0     0     0"
198  echo "	  ${disk1}  ONLINE     0     0     0"
199  echo "	  ${disk2}  ONLINE     0     0     0"
200  echo "	  ${disk3}  ONLINE     0     0     0"
201  echo "errors: No known data errors"
202)`
203expect "${exp}" ${ZPOOL} status ${name0}
204expect_ok ${ZPOOL} destroy ${name0}
205expect_fl ${ZPOOL} status -x ${name0}
206
207expect_ok ${ZPOOL} create ${name0} ${disk0}
208expect_ok ${ZPOOL} add ${name0} log mirror ${disk1} ${disk2}
209expect_ok ${ZPOOL} add ${name0} log mirror ${disk3} ${disk4}
210expect_ok ${ZPOOL} add ${name0} log mirror ${disk5} ${disk6}
211exp=`(
212  echo "  pool: ${name0}"
213  echo " state: ONLINE"
214  echo " scrub: none requested"
215  echo "config:"
216  echo "	NAME          STATE   READ WRITE CKSUM"
217  echo "	${name0}      ONLINE     0     0     0"
218  echo "	  ${disk0}    ONLINE     0     0     0"
219  echo "	logs          ONLINE     0     0     0"
220  echo "	  mirror      ONLINE     0     0     0"
221  echo "	    ${disk1}  ONLINE     0     0     0"
222  echo "	    ${disk2}  ONLINE     0     0     0"
223  echo "	  mirror      ONLINE     0     0     0"
224  echo "	    ${disk3}  ONLINE     0     0     0"
225  echo "	    ${disk4}  ONLINE     0     0     0"
226  echo "	  mirror      ONLINE     0     0     0"
227  echo "	    ${disk5}  ONLINE     0     0     0"
228  echo "	    ${disk6}  ONLINE     0     0     0"
229  echo "errors: No known data errors"
230)`
231expect "${exp}" ${ZPOOL} status ${name0}
232expect_ok ${ZPOOL} destroy ${name0}
233expect_fl ${ZPOOL} status -x ${name0}
234
235expect_ok ${ZPOOL} create ${name0} ${disk0} log ${disk1}
236expect_ok ${ZPOOL} add ${name0} log ${disk2}
237expect_ok ${ZPOOL} add ${name0} log ${disk3}
238exp=`(
239  echo "  pool: ${name0}"
240  echo " state: ONLINE"
241  echo " scrub: none requested"
242  echo "config:"
243  echo "	NAME        STATE   READ WRITE CKSUM"
244  echo "	${name0}    ONLINE     0     0     0"
245  echo "	  ${disk0}  ONLINE     0     0     0"
246  echo "	logs        ONLINE     0     0     0"
247  echo "	  ${disk1}  ONLINE     0     0     0"
248  echo "	  ${disk2}  ONLINE     0     0     0"
249  echo "	  ${disk3}  ONLINE     0     0     0"
250  echo "errors: No known data errors"
251)`
252expect "${exp}" ${ZPOOL} status ${name0}
253expect_ok ${ZPOOL} destroy ${name0}
254expect_fl ${ZPOOL} status -x ${name0}
255
256expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
257expect_ok ${ZPOOL} add ${name0} log mirror ${disk3} ${disk4}
258expect_ok ${ZPOOL} add ${name0} log mirror ${disk5} ${disk6}
259exp=`(
260  echo "  pool: ${name0}"
261  echo " state: ONLINE"
262  echo " scrub: none requested"
263  echo "config:"
264  echo "	NAME          STATE   READ WRITE CKSUM"
265  echo "	${name0}      ONLINE     0     0     0"
266  echo "	  ${disk0}    ONLINE     0     0     0"
267  echo "	logs          ONLINE     0     0     0"
268  echo "	  mirror      ONLINE     0     0     0"
269  echo "	    ${disk1}  ONLINE     0     0     0"
270  echo "	    ${disk2}  ONLINE     0     0     0"
271  echo "	  mirror      ONLINE     0     0     0"
272  echo "	    ${disk3}  ONLINE     0     0     0"
273  echo "	    ${disk4}  ONLINE     0     0     0"
274  echo "	  mirror      ONLINE     0     0     0"
275  echo "	    ${disk5}  ONLINE     0     0     0"
276  echo "	    ${disk6}  ONLINE     0     0     0"
277  echo "errors: No known data errors"
278)`
279expect "${exp}" ${ZPOOL} status ${name0}
280expect_ok ${ZPOOL} destroy ${name0}
281expect_fl ${ZPOOL} status -x ${name0}
282
283disks_destroy
284