]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/zfs/zpool/add/option-f_replication_level_mismatch_0.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / zfs / zpool / add / option-f_replication_level_mismatch_0.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..40"
8
9 disks_create 5
10 names_create 1
11
12 expect_ok ${ZPOOL} create ${name0} ${disk0}
13 expect_fl ${ZPOOL} add ${name0} mirror ${disk1} ${disk2}
14 exp=`(
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 "errors: No known data errors"
23 )`
24 expect "${exp}" ${ZPOOL} status ${name0}
25 expect_ok ${ZPOOL} destroy ${name0}
26 expect_fl ${ZPOOL} status -x ${name0}
27
28 expect_ok ${ZPOOL} create ${name0} ${disk0}
29 expect_ok ${ZPOOL} add -f ${name0} mirror ${disk1} ${disk2}
30 exp=`(
31   echo "  pool: ${name0}"
32   echo " state: ONLINE"
33   echo " scrub: none requested"
34   echo "config:"
35   echo "        NAME          STATE   READ WRITE CKSUM"
36   echo "        ${name0}      ONLINE     0     0     0"
37   echo "          ${disk0}    ONLINE     0     0     0"
38   echo "          mirror      ONLINE     0     0     0"
39   echo "            ${disk1}  ONLINE     0     0     0"
40   echo "            ${disk2}  ONLINE     0     0     0"
41   echo "errors: No known data errors"
42 )`
43 expect "${exp}" ${ZPOOL} status ${name0}
44 expect_ok ${ZPOOL} destroy ${name0}
45 expect_fl ${ZPOOL} status -x ${name0}
46
47 expect_ok ${ZPOOL} create ${name0} ${disk0}
48 expect_fl ${ZPOOL} add ${name0} raidz ${disk1} ${disk2} ${disk3}
49 exp=`(
50   echo "  pool: ${name0}"
51   echo " state: ONLINE"
52   echo " scrub: none requested"
53   echo "config:"
54   echo "        NAME        STATE   READ WRITE CKSUM"
55   echo "        ${name0}    ONLINE     0     0     0"
56   echo "          ${disk0}  ONLINE     0     0     0"
57   echo "errors: No known data errors"
58 )`
59 expect "${exp}" ${ZPOOL} status ${name0}
60 expect_ok ${ZPOOL} destroy ${name0}
61 expect_fl ${ZPOOL} status -x ${name0}
62
63 expect_ok ${ZPOOL} create ${name0} ${disk0}
64 expect_ok ${ZPOOL} add -f ${name0} raidz ${disk1} ${disk2} ${disk3}
65 exp=`(
66   echo "  pool: ${name0}"
67   echo " state: ONLINE"
68   echo " scrub: none requested"
69   echo "config:"
70   echo "        NAME          STATE   READ WRITE CKSUM"
71   echo "        ${name0}      ONLINE     0     0     0"
72   echo "          ${disk0}    ONLINE     0     0     0"
73   echo "          raidz1      ONLINE     0     0     0"
74   echo "            ${disk1}  ONLINE     0     0     0"
75   echo "            ${disk2}  ONLINE     0     0     0"
76   echo "            ${disk3}  ONLINE     0     0     0"
77   echo "errors: No known data errors"
78 )`
79 expect "${exp}" ${ZPOOL} status ${name0}
80 expect_ok ${ZPOOL} destroy ${name0}
81 expect_fl ${ZPOOL} status -x ${name0}
82
83 expect_ok ${ZPOOL} create ${name0} ${disk0}
84 expect_fl ${ZPOOL} add ${name0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
85 exp=`(
86   echo "  pool: ${name0}"
87   echo " state: ONLINE"
88   echo " scrub: none requested"
89   echo "config:"
90   echo "        NAME        STATE   READ WRITE CKSUM"
91   echo "        ${name0}    ONLINE     0     0     0"
92   echo "          ${disk0}  ONLINE     0     0     0"
93   echo "errors: No known data errors"
94 )`
95 expect "${exp}" ${ZPOOL} status ${name0}
96 expect_ok ${ZPOOL} destroy ${name0}
97 expect_fl ${ZPOOL} status -x ${name0}
98
99 expect_ok ${ZPOOL} create ${name0} ${disk0}
100 expect_ok ${ZPOOL} add -f ${name0} raidz2 ${disk1} ${disk2} ${disk3} ${disk4}
101 exp=`(
102   echo "  pool: ${name0}"
103   echo " state: ONLINE"
104   echo " scrub: none requested"
105   echo "config:"
106   echo "        NAME          STATE   READ WRITE CKSUM"
107   echo "        ${name0}      ONLINE     0     0     0"
108   echo "          ${disk0}    ONLINE     0     0     0"
109   echo "          raidz2      ONLINE     0     0     0"
110   echo "            ${disk1}  ONLINE     0     0     0"
111   echo "            ${disk2}  ONLINE     0     0     0"
112   echo "            ${disk3}  ONLINE     0     0     0"
113   echo "            ${disk4}  ONLINE     0     0     0"
114   echo "errors: No known data errors"
115 )`
116 expect "${exp}" ${ZPOOL} status ${name0}
117 expect_ok ${ZPOOL} destroy ${name0}
118 expect_fl ${ZPOOL} status -x ${name0}
119
120 expect_ok ${ZPOOL} create ${name0} ${disk0} log ${disk1}
121 add_msg="# TODO Sun CR 6726091, Lustre bug 16873"
122 expect_fl ${ZPOOL} add ${name0} log mirror ${disk2} ${disk3}
123 exp=`(
124   echo "  pool: ${name0}"
125   echo " state: ONLINE"
126   echo " scrub: none requested"
127   echo "config:"
128   echo "        NAME        STATE   READ WRITE CKSUM"
129   echo "        ${name0}    ONLINE     0     0     0"
130   echo "          ${disk0}  ONLINE     0     0     0"
131   echo "        logs        ONLINE     0     0     0"
132   echo "          ${disk1}  ONLINE     0     0     0"
133   echo "errors: No known data errors"
134 )`
135 expect "${exp}" ${ZPOOL} status ${name0}
136 add_msg=""
137 expect_ok ${ZPOOL} destroy ${name0}
138 expect_fl ${ZPOOL} status -x ${name0}
139
140 expect_ok ${ZPOOL} create ${name0} ${disk0} log ${disk1}
141 expect_ok ${ZPOOL} add -f ${name0} log mirror ${disk2} ${disk3}
142 exp=`(
143   echo "  pool: ${name0}"
144   echo " state: ONLINE"
145   echo " scrub: none requested"
146   echo "config:"
147   echo "        NAME          STATE   READ WRITE CKSUM"
148   echo "        ${name0}      ONLINE     0     0     0"
149   echo "          ${disk0}    ONLINE     0     0     0"
150   echo "        logs          ONLINE     0     0     0"
151   echo "          ${disk1}    ONLINE     0     0     0"
152   echo "          mirror      ONLINE     0     0     0"
153   echo "            ${disk2}  ONLINE     0     0     0"
154   echo "            ${disk3}  ONLINE     0     0     0"
155   echo "errors: No known data errors"
156 )`
157 expect "${exp}" ${ZPOOL} status ${name0}
158 expect_ok ${ZPOOL} destroy ${name0}
159 expect_fl ${ZPOOL} status -x ${name0}
160
161 disks_destroy