]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/zfs/zpool/add/mirror.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / zfs / zpool / add / mirror.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..15"
8
9 disks_create 10
10 names_create 1
11
12 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
13 expect_ok ${ZPOOL} add ${name0} mirror ${disk2} ${disk3}
14 exp=`(
15   echo "  pool: ${name0}"
16   echo " state: ONLINE"
17   echo " scrub: none requested"
18   echo "config:"
19   echo "        NAME          STATE   READ WRITE CKSUM"
20   echo "        ${name0}      ONLINE     0     0     0"
21   echo "          mirror      ONLINE     0     0     0"
22   echo "            ${disk0}  ONLINE     0     0     0"
23   echo "            ${disk1}  ONLINE     0     0     0"
24   echo "          mirror      ONLINE     0     0     0"
25   echo "            ${disk2}  ONLINE     0     0     0"
26   echo "            ${disk3}  ONLINE     0     0     0"
27   echo "errors: No known data errors"
28 )`
29 expect "${exp}" ${ZPOOL} status ${name0}
30 expect_ok ${ZPOOL} destroy ${name0}
31 expect_fl ${ZPOOL} status -x ${name0}
32
33 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} ${disk2}
34 expect_ok ${ZPOOL} add ${name0} mirror ${disk3} ${disk4} ${disk5}
35 exp=`(
36   echo "  pool: ${name0}"
37   echo " state: ONLINE"
38   echo " scrub: none requested"
39   echo "config:"
40   echo "        NAME          STATE   READ WRITE CKSUM"
41   echo "        ${name0}      ONLINE     0     0     0"
42   echo "          mirror      ONLINE     0     0     0"
43   echo "            ${disk0}  ONLINE     0     0     0"
44   echo "            ${disk1}  ONLINE     0     0     0"
45   echo "            ${disk2}  ONLINE     0     0     0"
46   echo "          mirror      ONLINE     0     0     0"
47   echo "            ${disk3}  ONLINE     0     0     0"
48   echo "            ${disk4}  ONLINE     0     0     0"
49   echo "            ${disk5}  ONLINE     0     0     0"
50   echo "errors: No known data errors"
51 )`
52 expect "${exp}" ${ZPOOL} status ${name0}
53 expect_ok ${ZPOOL} destroy ${name0}
54 expect_fl ${ZPOOL} status -x ${name0}
55
56 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} mirror ${disk2} ${disk3}
57 expect_ok ${ZPOOL} add ${name0} mirror ${disk4} ${disk5} mirror ${disk6} ${disk7} mirror ${disk8} ${disk9}
58 exp=`(
59   echo "  pool: ${name0}"
60   echo " state: ONLINE"
61   echo " scrub: none requested"
62   echo "config:"
63   echo "        NAME          STATE   READ WRITE CKSUM"
64   echo "        ${name0}      ONLINE     0     0     0"
65   echo "          mirror      ONLINE     0     0     0"
66   echo "            ${disk0}  ONLINE     0     0     0"
67   echo "            ${disk1}  ONLINE     0     0     0"
68   echo "          mirror      ONLINE     0     0     0"
69   echo "            ${disk2}  ONLINE     0     0     0"
70   echo "            ${disk3}  ONLINE     0     0     0"
71   echo "          mirror      ONLINE     0     0     0"
72   echo "            ${disk4}  ONLINE     0     0     0"
73   echo "            ${disk5}  ONLINE     0     0     0"
74   echo "          mirror      ONLINE     0     0     0"
75   echo "            ${disk6}  ONLINE     0     0     0"
76   echo "            ${disk7}  ONLINE     0     0     0"
77   echo "          mirror      ONLINE     0     0     0"
78   echo "            ${disk8}  ONLINE     0     0     0"
79   echo "            ${disk9}  ONLINE     0     0     0"
80   echo "errors: No known data errors"
81 )`
82 expect "${exp}" ${ZPOOL} status ${name0}
83 expect_ok ${ZPOOL} destroy ${name0}
84 expect_fl ${ZPOOL} status -x ${name0}
85
86 disks_destroy