xref: /freebsd/tools/regression/zfs/zpool/add/mirror.t (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1#!/bin/sh
2
3dir=`dirname $0`
4. ${dir}/../../misc.sh
5
6echo "1..15"
7
8disks_create 10
9names_create 1
10
11expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
12expect_ok ${ZPOOL} add ${name0} mirror ${disk2} ${disk3}
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 "	  mirror      ONLINE     0     0     0"
21  echo "	    ${disk0}  ONLINE     0     0     0"
22  echo "	    ${disk1}  ONLINE     0     0     0"
23  echo "	  mirror      ONLINE     0     0     0"
24  echo "	    ${disk2}  ONLINE     0     0     0"
25  echo "	    ${disk3}  ONLINE     0     0     0"
26  echo "errors: No known data errors"
27)`
28expect "${exp}" ${ZPOOL} status ${name0}
29expect_ok ${ZPOOL} destroy ${name0}
30expect_fl ${ZPOOL} status -x ${name0}
31
32expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} ${disk2}
33expect_ok ${ZPOOL} add ${name0} mirror ${disk3} ${disk4} ${disk5}
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 "	  mirror      ONLINE     0     0     0"
42  echo "	    ${disk0}  ONLINE     0     0     0"
43  echo "	    ${disk1}  ONLINE     0     0     0"
44  echo "	    ${disk2}  ONLINE     0     0     0"
45  echo "	  mirror      ONLINE     0     0     0"
46  echo "	    ${disk3}  ONLINE     0     0     0"
47  echo "	    ${disk4}  ONLINE     0     0     0"
48  echo "	    ${disk5}  ONLINE     0     0     0"
49  echo "errors: No known data errors"
50)`
51expect "${exp}" ${ZPOOL} status ${name0}
52expect_ok ${ZPOOL} destroy ${name0}
53expect_fl ${ZPOOL} status -x ${name0}
54
55expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} mirror ${disk2} ${disk3}
56expect_ok ${ZPOOL} add ${name0} mirror ${disk4} ${disk5} mirror ${disk6} ${disk7} mirror ${disk8} ${disk9}
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 "	  mirror      ONLINE     0     0     0"
68  echo "	    ${disk2}  ONLINE     0     0     0"
69  echo "	    ${disk3}  ONLINE     0     0     0"
70  echo "	  mirror      ONLINE     0     0     0"
71  echo "	    ${disk4}  ONLINE     0     0     0"
72  echo "	    ${disk5}  ONLINE     0     0     0"
73  echo "	  mirror      ONLINE     0     0     0"
74  echo "	    ${disk6}  ONLINE     0     0     0"
75  echo "	    ${disk7}  ONLINE     0     0     0"
76  echo "	  mirror      ONLINE     0     0     0"
77  echo "	    ${disk8}  ONLINE     0     0     0"
78  echo "	    ${disk9}  ONLINE     0     0     0"
79  echo "errors: No known data errors"
80)`
81expect "${exp}" ${ZPOOL} status ${name0}
82expect_ok ${ZPOOL} destroy ${name0}
83expect_fl ${ZPOOL} status -x ${name0}
84
85disks_destroy
86