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