]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/zfs/zpool/add/disks.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / zfs / zpool / add / disks.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..19"
8
9 disks_create 5
10 names_create 1
11
12 expect_ok ${ZPOOL} create ${name0} ${disk0}
13 expect_fl ${ZPOOL} add ${name0} ${disk0}
14 expect_ok ${ZPOOL} destroy ${name0}
15
16 expect_ok ${ZPOOL} create ${name0} ${disk0} ${disk1}
17 expect_fl ${ZPOOL} add ${name0} ${disk0}
18 expect_fl ${ZPOOL} add ${name0} ${disk1}
19 expect_ok ${ZPOOL} destroy ${name0}
20
21 expect_ok ${ZPOOL} create ${name0} ${disk0}
22 expect_ok ${ZPOOL} add ${name0} ${disk1}
23 exp=`(
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 )`
34 expect "${exp}" ${ZPOOL} status ${name0}
35 expect_ok ${ZPOOL} destroy ${name0}
36 expect_fl ${ZPOOL} status -x ${name0}
37
38 expect_ok ${ZPOOL} create ${name0} ${disk0} ${disk1} ${disk2}
39 expect_ok ${ZPOOL} add ${name0} ${disk3} ${disk4}
40 expect_ok ${ZPOOL} status -x ${name0}
41 expect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
42 exp=`(
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 )`
56 expect "${exp}" ${ZPOOL} status ${name0}
57 expect_ok ${ZPOOL} destroy ${name0}
58 expect_fl ${ZPOOL} status -x ${name0}
59
60 disks_destroy