1185029Spjd#!/bin/sh 2185029Spjd# $FreeBSD: releng/10.3/tools/regression/zfs/zpool/create/mirror.t 185029 2008-11-17 20:49:29Z pjd $ 3185029Spjd 4185029Spjddir=`dirname $0` 5185029Spjd. ${dir}/../../misc.sh 6185029Spjd 7185029Spjdecho "1..22" 8185029Spjd 9185029Spjddisks_create 6 10185029Spjdnames_create 1 11185029Spjd 12185029Spjdexpect_fl ${ZPOOL} create ${name0} mirror ${disk0} 13185029Spjd 14185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} 15185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 16185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 17185029Spjdexp=`( 18185029Spjd echo " pool: ${name0}" 19185029Spjd echo " state: ONLINE" 20185029Spjd echo " scrub: none requested" 21185029Spjd echo "config:" 22185029Spjd echo " NAME STATE READ WRITE CKSUM" 23185029Spjd echo " ${name0} ONLINE 0 0 0" 24185029Spjd echo " mirror ONLINE 0 0 0" 25185029Spjd echo " ${disk0} ONLINE 0 0 0" 26185029Spjd echo " ${disk1} ONLINE 0 0 0" 27185029Spjd echo "errors: No known data errors" 28185029Spjd)` 29185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 30185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 31185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 32185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 33185029Spjd 34185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} ${disk2} ${disk3} ${disk4} 35185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 36185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 37185029Spjdexp=`( 38185029Spjd echo " pool: ${name0}" 39185029Spjd echo " state: ONLINE" 40185029Spjd echo " scrub: none requested" 41185029Spjd echo "config:" 42185029Spjd echo " NAME STATE READ WRITE CKSUM" 43185029Spjd echo " ${name0} ONLINE 0 0 0" 44185029Spjd echo " mirror ONLINE 0 0 0" 45185029Spjd echo " ${disk0} ONLINE 0 0 0" 46185029Spjd echo " ${disk1} ONLINE 0 0 0" 47185029Spjd echo " ${disk2} ONLINE 0 0 0" 48185029Spjd echo " ${disk3} ONLINE 0 0 0" 49185029Spjd echo " ${disk4} ONLINE 0 0 0" 50185029Spjd echo "errors: No known data errors" 51185029Spjd)` 52185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 53185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 54185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 55185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 56185029Spjd 57185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} mirror ${disk2} ${disk3} mirror ${disk4} ${disk5} 58185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 59185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 60185029Spjdexp=`( 61185029Spjd echo " pool: ${name0}" 62185029Spjd echo " state: ONLINE" 63185029Spjd echo " scrub: none requested" 64185029Spjd echo "config:" 65185029Spjd echo " NAME STATE READ WRITE CKSUM" 66185029Spjd echo " ${name0} ONLINE 0 0 0" 67185029Spjd echo " mirror ONLINE 0 0 0" 68185029Spjd echo " ${disk0} ONLINE 0 0 0" 69185029Spjd echo " ${disk1} ONLINE 0 0 0" 70185029Spjd echo " mirror ONLINE 0 0 0" 71185029Spjd echo " ${disk2} ONLINE 0 0 0" 72185029Spjd echo " ${disk3} ONLINE 0 0 0" 73185029Spjd echo " mirror ONLINE 0 0 0" 74185029Spjd echo " ${disk4} ONLINE 0 0 0" 75185029Spjd echo " ${disk5} ONLINE 0 0 0" 76185029Spjd echo "errors: No known data errors" 77185029Spjd)` 78185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 79185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 80185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 81185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 82185029Spjd 83185029Spjddisks_destroy 84