xref: /freebsd/tools/regression/zfs/zpool/add/disks.t (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1#!/bin/sh
2
3dir=`dirname $0`
4. ${dir}/../../misc.sh
5
6echo "1..19"
7
8disks_create 5
9names_create 1
10
11expect_ok ${ZPOOL} create ${name0} ${disk0}
12expect_fl ${ZPOOL} add ${name0} ${disk0}
13expect_ok ${ZPOOL} destroy ${name0}
14
15expect_ok ${ZPOOL} create ${name0} ${disk0} ${disk1}
16expect_fl ${ZPOOL} add ${name0} ${disk0}
17expect_fl ${ZPOOL} add ${name0} ${disk1}
18expect_ok ${ZPOOL} destroy ${name0}
19
20expect_ok ${ZPOOL} create ${name0} ${disk0}
21expect_ok ${ZPOOL} add ${name0} ${disk1}
22exp=`(
23  echo "  pool: ${name0}"
24  echo " state: ONLINE"
25  echo " scrub: none requested"
26  echo "config:"
27  echo "	NAME        STATE   READ WRITE CKSUM"
28  echo "	${name0}    ONLINE     0     0     0"
29  echo "	  ${disk0}  ONLINE     0     0     0"
30  echo "	  ${disk1}  ONLINE     0     0     0"
31  echo "errors: No known data errors"
32)`
33expect "${exp}" ${ZPOOL} status ${name0}
34expect_ok ${ZPOOL} destroy ${name0}
35expect_fl ${ZPOOL} status -x ${name0}
36
37expect_ok ${ZPOOL} create ${name0} ${disk0} ${disk1} ${disk2}
38expect_ok ${ZPOOL} add ${name0} ${disk3} ${disk4}
39expect_ok ${ZPOOL} status -x ${name0}
40expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
41exp=`(
42  echo "  pool: ${name0}"
43  echo " state: ONLINE"
44  echo " scrub: none requested"
45  echo "config:"
46  echo "	NAME        STATE   READ WRITE CKSUM"
47  echo "	${name0}    ONLINE     0     0     0"
48  echo "	  ${disk0}  ONLINE     0     0     0"
49  echo "	  ${disk1}  ONLINE     0     0     0"
50  echo "	  ${disk2}  ONLINE     0     0     0"
51  echo "	  ${disk3}  ONLINE     0     0     0"
52  echo "	  ${disk4}  ONLINE     0     0     0"
53  echo "errors: No known data errors"
54)`
55expect "${exp}" ${ZPOOL} status ${name0}
56expect_ok ${ZPOOL} destroy ${name0}
57expect_fl ${ZPOOL} status -x ${name0}
58
59disks_destroy
60