1185029Spjd#!/bin/sh 2185029Spjd# $FreeBSD: releng/10.3/tools/regression/zfs/zpool/offline/log.t 185029 2008-11-17 20:49:29Z pjd $ 3185029Spjd 4185029Spjddir=`dirname $0` 5185029Spjd. ${dir}/../../misc.sh 6185029Spjd 7185029Spjdecho "1..67" 8185029Spjd 9185029Spjddisks_create 7 10185029Spjdnames_create 1 11185029Spjd 12185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} 13185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} 14185029Spjdexp=`( 15185029Spjd echo " pool: ${name0}" 16185029Spjd echo " state: DEGRADED" 17185029Spjd echo "status: One or more devices has been taken offline by the administrator." 18185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 19185029Spjd echo " degraded state." 20185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 21185029Spjd echo " 'zpool replace'." 22185029Spjd echo " scrub: none requested" 23185029Spjd echo "config:" 24185029Spjd echo " NAME STATE READ WRITE CKSUM" 25185029Spjd echo " ${name0} DEGRADED 0 0 0" 26185029Spjd echo " ${disk0} ONLINE 0 0 0" 27185029Spjd echo " logs DEGRADED 0 0 0" 28185029Spjd echo " mirror DEGRADED 0 0 0" 29185029Spjd echo " ${disk1} OFFLINE 0 0 0" 30185029Spjd echo " ${disk2} ONLINE 0 0 0" 31185029Spjd echo "errors: No known data errors" 32185029Spjd)` 33185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 34185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 35185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 36185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 37185029Spjd 38185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} 39185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk2} 40185029Spjdexp=`( 41185029Spjd echo " pool: ${name0}" 42185029Spjd echo " state: DEGRADED" 43185029Spjd echo "status: One or more devices has been taken offline by the administrator." 44185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 45185029Spjd echo " degraded state." 46185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 47185029Spjd echo " 'zpool replace'." 48185029Spjd echo " scrub: none requested" 49185029Spjd echo "config:" 50185029Spjd echo " NAME STATE READ WRITE CKSUM" 51185029Spjd echo " ${name0} DEGRADED 0 0 0" 52185029Spjd echo " ${disk0} ONLINE 0 0 0" 53185029Spjd echo " logs DEGRADED 0 0 0" 54185029Spjd echo " mirror DEGRADED 0 0 0" 55185029Spjd echo " ${disk1} ONLINE 0 0 0" 56185029Spjd echo " ${disk2} OFFLINE 0 0 0" 57185029Spjd echo "errors: No known data errors" 58185029Spjd)` 59185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 60185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 61185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 62185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 63185029Spjd 64185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} 65185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} 66185029Spjdexpect_fl ${ZPOOL} offline ${name0} ${disk2} 67185029Spjdexp=`( 68185029Spjd echo " pool: ${name0}" 69185029Spjd echo " state: DEGRADED" 70185029Spjd echo "status: One or more devices has been taken offline by the administrator." 71185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 72185029Spjd echo " degraded state." 73185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 74185029Spjd echo " 'zpool replace'." 75185029Spjd echo " scrub: none requested" 76185029Spjd echo "config:" 77185029Spjd echo " NAME STATE READ WRITE CKSUM" 78185029Spjd echo " ${name0} DEGRADED 0 0 0" 79185029Spjd echo " ${disk0} ONLINE 0 0 0" 80185029Spjd echo " logs DEGRADED 0 0 0" 81185029Spjd echo " mirror DEGRADED 0 0 0" 82185029Spjd echo " ${disk1} OFFLINE 0 0 0" 83185029Spjd echo " ${disk2} ONLINE 0 0 0" 84185029Spjd echo "errors: No known data errors" 85185029Spjd)` 86185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 87185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 88185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 89185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 90185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 91185029Spjd 92185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} mirror ${disk3} ${disk4} 93185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} 94185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk4} 95185029Spjdexpect_fl ${ZPOOL} offline ${name0} ${disk2} 96185029Spjdexpect_fl ${ZPOOL} offline ${name0} ${disk3} 97185029Spjdexp=`( 98185029Spjd echo " pool: ${name0}" 99185029Spjd echo " state: DEGRADED" 100185029Spjd echo "status: One or more devices has been taken offline by the administrator." 101185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 102185029Spjd echo " degraded state." 103185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 104185029Spjd echo " 'zpool replace'." 105185029Spjd echo " scrub: none requested" 106185029Spjd echo "config:" 107185029Spjd echo " NAME STATE READ WRITE CKSUM" 108185029Spjd echo " ${name0} DEGRADED 0 0 0" 109185029Spjd echo " ${disk0} ONLINE 0 0 0" 110185029Spjd echo " logs DEGRADED 0 0 0" 111185029Spjd echo " mirror DEGRADED 0 0 0" 112185029Spjd echo " ${disk1} OFFLINE 0 0 0" 113185029Spjd echo " ${disk2} ONLINE 0 0 0" 114185029Spjd echo " mirror DEGRADED 0 0 0" 115185029Spjd echo " ${disk3} ONLINE 0 0 0" 116185029Spjd echo " ${disk4} OFFLINE 0 0 0" 117185029Spjd echo "errors: No known data errors" 118185029Spjd)` 119185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 120185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 121185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk4} 122185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 123185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk3} 124185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 125185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 126185029Spjd 127185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} mirror ${disk3} ${disk4} 128185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk2} ${disk3} 129185029Spjdexp=`( 130185029Spjd echo " pool: ${name0}" 131185029Spjd echo " state: DEGRADED" 132185029Spjd echo "status: One or more devices has been taken offline by the administrator." 133185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 134185029Spjd echo " degraded state." 135185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 136185029Spjd echo " 'zpool replace'." 137185029Spjd echo " scrub: none requested" 138185029Spjd echo "config:" 139185029Spjd echo " NAME STATE READ WRITE CKSUM" 140185029Spjd echo " ${name0} DEGRADED 0 0 0" 141185029Spjd echo " ${disk0} ONLINE 0 0 0" 142185029Spjd echo " logs DEGRADED 0 0 0" 143185029Spjd echo " mirror DEGRADED 0 0 0" 144185029Spjd echo " ${disk1} ONLINE 0 0 0" 145185029Spjd echo " ${disk2} OFFLINE 0 0 0" 146185029Spjd echo " mirror DEGRADED 0 0 0" 147185029Spjd echo " ${disk3} OFFLINE 0 0 0" 148185029Spjd echo " ${disk4} ONLINE 0 0 0" 149185029Spjd echo "errors: No known data errors" 150185029Spjd)` 151185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 152185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 153185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk3} 154185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 155185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 156185029Spjd 157185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} ${disk3} 158185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} 159185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk2} 160185029Spjdexp=`( 161185029Spjd echo " pool: ${name0}" 162185029Spjd echo " state: DEGRADED" 163185029Spjd echo "status: One or more devices has been taken offline by the administrator." 164185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 165185029Spjd echo " degraded state." 166185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 167185029Spjd echo " 'zpool replace'." 168185029Spjd echo " scrub: none requested" 169185029Spjd echo "config:" 170185029Spjd echo " NAME STATE READ WRITE CKSUM" 171185029Spjd echo " ${name0} DEGRADED 0 0 0" 172185029Spjd echo " ${disk0} ONLINE 0 0 0" 173185029Spjd echo " logs DEGRADED 0 0 0" 174185029Spjd echo " mirror DEGRADED 0 0 0" 175185029Spjd echo " ${disk1} OFFLINE 0 0 0" 176185029Spjd echo " ${disk2} OFFLINE 0 0 0" 177185029Spjd echo " ${disk3} ONLINE 0 0 0" 178185029Spjd echo "errors: No known data errors" 179185029Spjd)` 180185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 181185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 182185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 183185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 184185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 185185029Spjd 186185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} ${disk3} mirror ${disk4} ${disk5} ${disk6} 187185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} 188185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk2} 189185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk4} ${disk6} 190185029Spjdexp=`( 191185029Spjd echo " pool: ${name0}" 192185029Spjd echo " state: DEGRADED" 193185029Spjd echo "status: One or more devices has been taken offline by the administrator." 194185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 195185029Spjd echo " degraded state." 196185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 197185029Spjd echo " 'zpool replace'." 198185029Spjd echo " scrub: none requested" 199185029Spjd echo "config:" 200185029Spjd echo " NAME STATE READ WRITE CKSUM" 201185029Spjd echo " ${name0} DEGRADED 0 0 0" 202185029Spjd echo " ${disk0} ONLINE 0 0 0" 203185029Spjd echo " logs DEGRADED 0 0 0" 204185029Spjd echo " mirror DEGRADED 0 0 0" 205185029Spjd echo " ${disk1} OFFLINE 0 0 0" 206185029Spjd echo " ${disk2} OFFLINE 0 0 0" 207185029Spjd echo " ${disk3} ONLINE 0 0 0" 208185029Spjd echo " mirror DEGRADED 0 0 0" 209185029Spjd echo " ${disk4} OFFLINE 0 0 0" 210185029Spjd echo " ${disk5} ONLINE 0 0 0" 211185029Spjd echo " ${disk6} OFFLINE 0 0 0" 212185029Spjd echo "errors: No known data errors" 213185029Spjd)` 214185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 215185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 216185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk2} 217185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk4} 218185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk6} 219185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 220185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 221185029Spjd 222185029Spjdexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2} ${disk3} ${disk4} ${disk5} 223185029Spjdexpect_ok ${ZPOOL} offline ${name0} ${disk1} ${disk3} ${disk4} ${disk5} 224185029Spjdexp=`( 225185029Spjd echo " pool: ${name0}" 226185029Spjd echo " state: DEGRADED" 227185029Spjd echo "status: One or more devices has been taken offline by the administrator." 228185029Spjd echo " Sufficient replicas exist for the pool to continue functioning in a" 229185029Spjd echo " degraded state." 230185029Spjd echo "action: Online the device using 'zpool online' or replace the device with" 231185029Spjd echo " 'zpool replace'." 232185029Spjd echo " scrub: none requested" 233185029Spjd echo "config:" 234185029Spjd echo " NAME STATE READ WRITE CKSUM" 235185029Spjd echo " ${name0} DEGRADED 0 0 0" 236185029Spjd echo " ${disk0} ONLINE 0 0 0" 237185029Spjd echo " logs DEGRADED 0 0 0" 238185029Spjd echo " mirror DEGRADED 0 0 0" 239185029Spjd echo " ${disk1} OFFLINE 0 0 0" 240185029Spjd echo " ${disk2} ONLINE 0 0 0" 241185029Spjd echo " ${disk3} OFFLINE 0 0 0" 242185029Spjd echo " ${disk4} OFFLINE 0 0 0" 243185029Spjd echo " ${disk5} OFFLINE 0 0 0" 244185029Spjd echo "errors: No known data errors" 245185029Spjd)` 246185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 247185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk1} 248185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk3} 249185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk4} 250185029Spjdexpect_ok ${ZPOOL} online ${name0} ${disk5} 251185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 252185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 253185029Spjd 254185029Spjddisks_destroy 255