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