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