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