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