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