xref: /freebsd/tools/regression/zfs/zpool/offline/io.t (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1#!/bin/sh
2# $FreeBSD$
3
4dir=`dirname $0`
5. ${dir}/../../misc.sh
6
7echo "1..31"
8
9disks_create 4 128M
10names_create 1
11
12expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
13expect_ok ${ZPOOL} offline ${name0} ${disk0}
14sum0_before=`calcsum ${fdisk0}`
15sum1_before=`calcsum ${fdisk1}`
16${ZFS} snapshot ${name0}@test
17sum0_after=`calcsum ${fdisk0}`
18sum1_after=`calcsum ${fdisk1}`
19expect_ok test "${sum0_before}" = "${sum0_after}"
20expect_fl test "${sum1_before}" = "${sum1_after}"
21expect_ok ${ZPOOL} destroy ${name0}
22expect_fl ${ZPOOL} status -x ${name0}
23
24expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} mirror ${disk0} ${disk1} ${disk2} ${disk3}
25expect_ok ${ZPOOL} offline ${name0} ${disk1}
26add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
27expect_ok ${ZPOOL} offline ${name0} ${disk3}
28add_msg=""
29sum0_before=`calcsum ${fdisk0}`
30sum1_before=`calcsum ${fdisk1}`
31sum2_before=`calcsum ${fdisk2}`
32sum3_before=`calcsum ${fdisk3}`
33${ZFS} snapshot ${name0}@test
34sum0_after=`calcsum ${fdisk0}`
35sum1_after=`calcsum ${fdisk1}`
36sum2_after=`calcsum ${fdisk2}`
37sum3_after=`calcsum ${fdisk3}`
38expect_fl test "${sum0_before}" = "${sum0_after}"
39expect_ok test "${sum1_before}" = "${sum1_after}"
40expect_fl test "${sum2_before}" = "${sum2_after}"
41add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
42expect_ok test "${sum3_before}" = "${sum3_after}"
43add_msg=""
44expect_ok ${ZPOOL} destroy ${name0}
45expect_fl ${ZPOOL} status -x ${name0}
46
47expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz1 ${disk0} ${disk1} ${disk2}
48expect_ok ${ZPOOL} offline ${name0} ${disk1}
49sum0_before=`calcsum ${fdisk0}`
50sum1_before=`calcsum ${fdisk1}`
51sum2_before=`calcsum ${fdisk2}`
52${ZFS} snapshot ${name0}@test
53sum0_after=`calcsum ${fdisk0}`
54sum1_after=`calcsum ${fdisk1}`
55sum2_after=`calcsum ${fdisk2}`
56expect_fl test "${sum0_before}" = "${sum0_after}"
57expect_ok test "${sum1_before}" = "${sum1_after}"
58expect_fl test "${sum2_before}" = "${sum2_after}"
59expect_ok ${ZPOOL} destroy ${name0}
60expect_fl ${ZPOOL} status -x ${name0}
61
62expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
63expect_ok ${ZPOOL} offline ${name0} ${disk1}
64add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
65expect_ok ${ZPOOL} offline ${name0} ${disk3}
66add_msg=""
67sum0_before=`calcsum ${fdisk0}`
68sum1_before=`calcsum ${fdisk1}`
69sum2_before=`calcsum ${fdisk2}`
70sum3_before=`calcsum ${fdisk3}`
71${ZFS} snapshot ${name0}@test
72sum0_after=`calcsum ${fdisk0}`
73sum1_after=`calcsum ${fdisk1}`
74sum2_after=`calcsum ${fdisk2}`
75sum3_after=`calcsum ${fdisk3}`
76expect_fl test "${sum0_before}" = "${sum0_after}"
77expect_ok test "${sum1_before}" = "${sum1_after}"
78expect_fl test "${sum2_before}" = "${sum2_after}"
79add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
80expect_ok test "${sum3_before}" = "${sum3_after}"
81add_msg=""
82expect_ok ${ZPOOL} destroy ${name0}
83expect_fl ${ZPOOL} status -x ${name0}
84
85disks_destroy
86