xref: /freebsd/tools/regression/zfs/zpool/add/mirror.t (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1#!/bin/sh
2# $FreeBSD$
3
4dir=`dirname $0`
5. ${dir}/../../misc.sh
6
7echo "1..15"
8
9disks_create 10
10names_create 1
11
12expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
13expect_ok ${ZPOOL} add ${name0} mirror ${disk2} ${disk3}
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 "	  mirror      ONLINE     0     0     0"
22  echo "	    ${disk0}  ONLINE     0     0     0"
23  echo "	    ${disk1}  ONLINE     0     0     0"
24  echo "	  mirror      ONLINE     0     0     0"
25  echo "	    ${disk2}  ONLINE     0     0     0"
26  echo "	    ${disk3}  ONLINE     0     0     0"
27  echo "errors: No known data errors"
28)`
29expect "${exp}" ${ZPOOL} status ${name0}
30expect_ok ${ZPOOL} destroy ${name0}
31expect_fl ${ZPOOL} status -x ${name0}
32
33expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} ${disk2}
34expect_ok ${ZPOOL} add ${name0} mirror ${disk3} ${disk4} ${disk5}
35exp=`(
36  echo "  pool: ${name0}"
37  echo " state: ONLINE"
38  echo " scrub: none requested"
39  echo "config:"
40  echo "	NAME          STATE   READ WRITE CKSUM"
41  echo "	${name0}      ONLINE     0     0     0"
42  echo "	  mirror      ONLINE     0     0     0"
43  echo "	    ${disk0}  ONLINE     0     0     0"
44  echo "	    ${disk1}  ONLINE     0     0     0"
45  echo "	    ${disk2}  ONLINE     0     0     0"
46  echo "	  mirror      ONLINE     0     0     0"
47  echo "	    ${disk3}  ONLINE     0     0     0"
48  echo "	    ${disk4}  ONLINE     0     0     0"
49  echo "	    ${disk5}  ONLINE     0     0     0"
50  echo "errors: No known data errors"
51)`
52expect "${exp}" ${ZPOOL} status ${name0}
53expect_ok ${ZPOOL} destroy ${name0}
54expect_fl ${ZPOOL} status -x ${name0}
55
56expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} mirror ${disk2} ${disk3}
57expect_ok ${ZPOOL} add ${name0} mirror ${disk4} ${disk5} mirror ${disk6} ${disk7} mirror ${disk8} ${disk9}
58exp=`(
59  echo "  pool: ${name0}"
60  echo " state: ONLINE"
61  echo " scrub: none requested"
62  echo "config:"
63  echo "	NAME          STATE   READ WRITE CKSUM"
64  echo "	${name0}      ONLINE     0     0     0"
65  echo "	  mirror      ONLINE     0     0     0"
66  echo "	    ${disk0}  ONLINE     0     0     0"
67  echo "	    ${disk1}  ONLINE     0     0     0"
68  echo "	  mirror      ONLINE     0     0     0"
69  echo "	    ${disk2}  ONLINE     0     0     0"
70  echo "	    ${disk3}  ONLINE     0     0     0"
71  echo "	  mirror      ONLINE     0     0     0"
72  echo "	    ${disk4}  ONLINE     0     0     0"
73  echo "	    ${disk5}  ONLINE     0     0     0"
74  echo "	  mirror      ONLINE     0     0     0"
75  echo "	    ${disk6}  ONLINE     0     0     0"
76  echo "	    ${disk7}  ONLINE     0     0     0"
77  echo "	  mirror      ONLINE     0     0     0"
78  echo "	    ${disk8}  ONLINE     0     0     0"
79  echo "	    ${disk9}  ONLINE     0     0     0"
80  echo "errors: No known data errors"
81)`
82expect "${exp}" ${ZPOOL} status ${name0}
83expect_ok ${ZPOOL} destroy ${name0}
84expect_fl ${ZPOOL} status -x ${name0}
85
86disks_destroy
87