]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/zfs/zpool/offline/raidz2.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / zfs / zpool / offline / raidz2.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..33"
8
9 disks_create 8
10 names_create 1
11
12 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2}
13 expect_ok ${ZPOOL} offline ${name0} ${disk0}
14 exp=`(
15   echo "  pool: ${name0}"
16   echo " state: DEGRADED"
17   echo "status: One or more devices has been taken offline by the administrator."
18   echo "        Sufficient replicas exist for the pool to continue functioning in a"
19   echo "        degraded state."
20   echo "action: Online the device using 'zpool online' or replace the device with"
21   echo "        'zpool replace'."
22   echo " scrub: none requested"
23   echo "config:"
24   echo "        NAME          STATE     READ WRITE CKSUM"
25   echo "        ${name0}      DEGRADED     0     0     0"
26   echo "          raidz2      DEGRADED     0     0     0"
27   echo "            ${disk0}  OFFLINE      0     0     0"
28   echo "            ${disk1}  ONLINE       0     0     0"
29   echo "            ${disk2}  ONLINE       0     0     0"
30   echo "errors: No known data errors"
31 )`
32 expect "${exp}" ${ZPOOL} status ${name0}
33 expect_ok ${ZPOOL} destroy ${name0}
34 expect_fl ${ZPOOL} status -x ${name0}
35
36 expect_ok ${ZPOOL} create -f ${name0} raidz2 ${disk0} ${disk1} ${disk2}
37 expect_ok ${ZPOOL} offline ${name0} ${disk1}
38 exp=`(
39   echo "  pool: ${name0}"
40   echo " state: DEGRADED"
41   echo "status: One or more devices has been taken offline by the administrator."
42   echo "        Sufficient replicas exist for the pool to continue functioning in a"
43   echo "        degraded state."
44   echo "action: Online the device using 'zpool online' or replace the device with"
45   echo "        'zpool replace'."
46   echo " scrub: none requested"
47   echo "config:"
48   echo "        NAME          STATE     READ WRITE CKSUM"
49   echo "        ${name0}      DEGRADED     0     0     0"
50   echo "          raidz2      DEGRADED     0     0     0"
51   echo "            ${disk0}  ONLINE       0     0     0"
52   echo "            ${disk1}  OFFLINE      0     0     0"
53   echo "            ${disk2}  ONLINE       0     0     0"
54   echo "errors: No known data errors"
55 )`
56 expect "${exp}" ${ZPOOL} status ${name0}
57 expect_ok ${ZPOOL} destroy ${name0}
58 expect_fl ${ZPOOL} status -x ${name0}
59
60 expect_ok ${ZPOOL} create -f ${name0} raidz2 ${disk0} ${disk1} ${disk2}
61 expect_ok ${ZPOOL} offline ${name0} ${disk2}
62 exp=`(
63   echo "  pool: ${name0}"
64   echo " state: DEGRADED"
65   echo "status: One or more devices has been taken offline by the administrator."
66   echo "        Sufficient replicas exist for the pool to continue functioning in a"
67   echo "        degraded state."
68   echo "action: Online the device using 'zpool online' or replace the device with"
69   echo "        'zpool replace'."
70   echo " scrub: none requested"
71   echo "config:"
72   echo "        NAME          STATE     READ WRITE CKSUM"
73   echo "        ${name0}      DEGRADED     0     0     0"
74   echo "          raidz2      DEGRADED     0     0     0"
75   echo "            ${disk0}  ONLINE       0     0     0"
76   echo "            ${disk1}  ONLINE       0     0     0"
77   echo "            ${disk2}  OFFLINE      0     0     0"
78   echo "errors: No known data errors"
79 )`
80 expect "${exp}" ${ZPOOL} status ${name0}
81 expect_ok ${ZPOOL} destroy ${name0}
82 expect_fl ${ZPOOL} status -x ${name0}
83
84 expect_ok ${ZPOOL} create -f ${name0} raidz2 ${disk0} ${disk1} ${disk2}
85 add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
86 expect_ok ${ZPOOL} offline ${name0} ${disk0} ${disk1}
87 add_msg=""
88 expect_fl ${ZPOOL} offline ${name0} ${disk2}
89 exp=`(
90   echo "  pool: ${name0}"
91   echo " state: DEGRADED"
92   echo "status: One or more devices has been taken offline by the administrator."
93   echo "        Sufficient replicas exist for the pool to continue functioning in a"
94   echo "        degraded state."
95   echo "action: Online the device using 'zpool online' or replace the device with"
96   echo "        'zpool replace'."
97   echo " scrub: none requested"
98   echo "config:"
99   echo "        NAME          STATE     READ WRITE CKSUM"
100   echo "        ${name0}      DEGRADED     0     0     0"
101   echo "          raidz2      DEGRADED     0     0     0"
102   echo "            ${disk0}  OFFLINE      0     0     0"
103   echo "            ${disk1}  OFFLINE      0     0     0"
104   echo "            ${disk2}  ONLINE       0     0     0"
105   echo "errors: No known data errors"
106 )`
107 add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
108 expect "${exp}" ${ZPOOL} status ${name0}
109 add_msg=""
110 expect_ok ${ZPOOL} destroy ${name0}
111 expect_fl ${ZPOOL} status -x ${name0}
112
113 expect_ok ${ZPOOL} create -f ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3} raidz2 ${disk4} ${disk5} ${disk6} ${disk7}
114 expect_ok ${ZPOOL} offline ${name0} ${disk1}
115 exp=`(
116   echo "  pool: ${name0}"
117   echo " state: DEGRADED"
118   echo "status: One or more devices has been taken offline by the administrator."
119   echo "        Sufficient replicas exist for the pool to continue functioning in a"
120   echo "        degraded state."
121   echo "action: Online the device using 'zpool online' or replace the device with"
122   echo "        'zpool replace'."
123   echo " scrub: none requested"
124   echo "config:"
125   echo "        NAME          STATE     READ WRITE CKSUM"
126   echo "        ${name0}      DEGRADED     0     0     0"
127   echo "          raidz2      DEGRADED     0     0     0"
128   echo "            ${disk0}  ONLINE       0     0     0"
129   echo "            ${disk1}  OFFLINE      0     0     0"
130   echo "            ${disk2}  ONLINE       0     0     0"
131   echo "            ${disk3}  ONLINE       0     0     0"
132   echo "          raidz2      ONLINE       0     0     0"
133   echo "            ${disk4}  ONLINE       0     0     0"
134   echo "            ${disk5}  ONLINE       0     0     0"
135   echo "            ${disk6}  ONLINE       0     0     0"
136   echo "            ${disk7}  ONLINE       0     0     0"
137   echo "errors: No known data errors"
138 )`
139 expect "${exp}" ${ZPOOL} status ${name0}
140 add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
141 expect_ok ${ZPOOL} offline ${name0} ${disk3}
142 exp=`(
143   echo "  pool: ${name0}"
144   echo " state: DEGRADED"
145   echo "status: One or more devices has been taken offline by the administrator."
146   echo "        Sufficient replicas exist for the pool to continue functioning in a"
147   echo "        degraded state."
148   echo "action: Online the device using 'zpool online' or replace the device with"
149   echo "        'zpool replace'."
150   echo " scrub: none requested"
151   echo "config:"
152   echo "        NAME          STATE     READ WRITE CKSUM"
153   echo "        ${name0}      DEGRADED     0     0     0"
154   echo "          raidz2      DEGRADED     0     0     0"
155   echo "            ${disk0}  ONLINE       0     0     0"
156   echo "            ${disk1}  OFFLINE      0     0     0"
157   echo "            ${disk2}  ONLINE       0     0     0"
158   echo "            ${disk3}  OFFLINE      0     0     0"
159   echo "          raidz2      ONLINE       0     0     0"
160   echo "            ${disk4}  ONLINE       0     0     0"
161   echo "            ${disk5}  ONLINE       0     0     0"
162   echo "            ${disk6}  ONLINE       0     0     0"
163   echo "            ${disk7}  ONLINE       0     0     0"
164   echo "errors: No known data errors"
165 )`
166 expect "${exp}" ${ZPOOL} status ${name0}
167 expect_ok ${ZPOOL} offline ${name0} ${disk4} ${disk7}
168 add_msg=""
169 expect_fl ${ZPOOL} offline ${name0} ${disk0}
170 expect_fl ${ZPOOL} offline ${name0} ${disk2}
171 expect_fl ${ZPOOL} offline ${name0} ${disk5} ${disk6}
172 exp=`(
173   echo "  pool: ${name0}"
174   echo " state: DEGRADED"
175   echo "status: One or more devices has been taken offline by the administrator."
176   echo "        Sufficient replicas exist for the pool to continue functioning in a"
177   echo "        degraded state."
178   echo "action: Online the device using 'zpool online' or replace the device with"
179   echo "        'zpool replace'."
180   echo " scrub: none requested"
181   echo "config:"
182   echo "        NAME          STATE     READ WRITE CKSUM"
183   echo "        ${name0}      DEGRADED     0     0     0"
184   echo "          raidz2      DEGRADED     0     0     0"
185   echo "            ${disk0}  ONLINE       0     0     0"
186   echo "            ${disk1}  OFFLINE      0     0     0"
187   echo "            ${disk2}  ONLINE       0     0     0"
188   echo "            ${disk3}  OFFLINE      0     0     0"
189   echo "          raidz2      DEGRADED     0     0     0"
190   echo "            ${disk4}  OFFLINE      0     0     0"
191   echo "            ${disk5}  ONLINE       0     0     0"
192   echo "            ${disk6}  ONLINE       0     0     0"
193   echo "            ${disk7}  OFFLINE      0     0     0"
194   echo "errors: No known data errors"
195 )`
196 add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
197 expect "${exp}" ${ZPOOL} status ${name0}
198 add_msg=""
199 expect_ok ${ZPOOL} destroy ${name0}
200 expect_fl ${ZPOOL} status -x ${name0}
201
202 disks_destroy