]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/zfs/zpool/replace/disk.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / zfs / zpool / replace / disk.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/../../misc.sh
6
7 echo "1..10"
8
9 disks_create 4
10 names_create 1
11
12 expect_ok ${ZPOOL} create ${name0} ${disk0}
13 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk1}
14 wait_for_resilver ${name0}
15 exp=`(
16   echo "  pool: ${name0}"
17   echo " state: ONLINE"
18   echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
19   echo "config:"
20   echo "        NAME        STATE   READ WRITE CKSUM"
21   echo "        ${name0}    ONLINE     0     0     0"
22   echo "          ${disk1}  ONLINE     0     0     0(  [0-9.]+[A-Z] resilvered)?"
23   echo "errors: No known data errors"
24 )`
25 expect "${exp}" ${ZPOOL} status ${name0}
26 expect_ok ${ZPOOL} destroy ${name0}
27 expect_fl ${ZPOOL} status -x ${name0}
28
29 expect_ok ${ZPOOL} create ${name0} ${disk0} ${disk1} ${disk2}
30 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk3}
31 wait_for_resilver ${name0}
32 exp=`(
33   echo "  pool: ${name0}"
34   echo " state: ONLINE"
35   echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
36   echo "config:"
37   echo "        NAME        STATE   READ WRITE CKSUM"
38   echo "        ${name0}    ONLINE     0     0     0"
39   echo "          ${disk0}  ONLINE     0     0     0"
40   echo "          ${disk3}  ONLINE     0     0     0(  [0-9.]+[A-Z] resilvered)?"
41   echo "          ${disk2}  ONLINE     0     0     0"
42   echo "errors: No known data errors"
43 )`
44 expect "${exp}" ${ZPOOL} status ${name0}
45 expect_ok ${ZPOOL} destroy ${name0}
46 expect_fl ${ZPOOL} status -x ${name0}
47
48 disks_destroy