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