1185029Spjd#!/bin/sh 2185029Spjd# $FreeBSD: releng/10.3/tools/regression/zfs/zpool/add/files.t 185029 2008-11-17 20:49:29Z pjd $ 3185029Spjd 4185029Spjddir=`dirname $0` 5185029Spjd. ${dir}/../../misc.sh 6185029Spjd 7185029Spjdecho "1..54" 8185029Spjd 9185029Spjdfiles_create 8 10185029Spjdnames_create 1 11185029Spjd 12185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} 13185029Spjdexpect_fl ${ZPOOL} add ${name0} ${file0} 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 " ${file0} ONLINE 0 0 0" 22185029Spjd echo "errors: No known data errors" 23185029Spjd)` 24185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 25185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 26185029Spjd 27185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} ${file1} 28185029Spjdexpect_fl ${ZPOOL} add ${name0} ${file0} 29185029Spjdexpect_fl ${ZPOOL} add ${name0} ${file1} 30185029Spjdexp=`( 31185029Spjd echo " pool: ${name0}" 32185029Spjd echo " state: ONLINE" 33185029Spjd echo " scrub: none requested" 34185029Spjd echo "config:" 35185029Spjd echo " NAME STATE READ WRITE CKSUM" 36185029Spjd echo " ${name0} ONLINE 0 0 0" 37185029Spjd echo " ${file0} ONLINE 0 0 0" 38185029Spjd echo "errors: No known data errors" 39185029Spjd)` 40185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 41185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 42185029Spjd 43185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} 44185029Spjdexpect_ok ${ZPOOL} add ${name0} ${file1} 45185029Spjdexp=`( 46185029Spjd echo " pool: ${name0}" 47185029Spjd echo " state: ONLINE" 48185029Spjd echo " scrub: none requested" 49185029Spjd echo "config:" 50185029Spjd echo " NAME STATE READ WRITE CKSUM" 51185029Spjd echo " ${name0} ONLINE 0 0 0" 52185029Spjd echo " ${file0} ONLINE 0 0 0" 53185029Spjd echo " ${file1} ONLINE 0 0 0" 54185029Spjd echo "errors: No known data errors" 55185029Spjd)` 56185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 57185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 58185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 59185029Spjd 60185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} ${file1} ${file2} 61185029Spjdexpect_ok ${ZPOOL} add ${name0} ${file3} ${file4} 62185029Spjdexp=`( 63185029Spjd echo " pool: ${name0}" 64185029Spjd echo " state: ONLINE" 65185029Spjd echo " scrub: none requested" 66185029Spjd echo "config:" 67185029Spjd echo " NAME STATE READ WRITE CKSUM" 68185029Spjd echo " ${name0} ONLINE 0 0 0" 69185029Spjd echo " ${file0} ONLINE 0 0 0" 70185029Spjd echo " ${file1} ONLINE 0 0 0" 71185029Spjd echo " ${file2} ONLINE 0 0 0" 72185029Spjd echo " ${file3} ONLINE 0 0 0" 73185029Spjd echo " ${file4} ONLINE 0 0 0" 74185029Spjd echo "errors: No known data errors" 75185029Spjd)` 76185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 77185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 78185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 79185029Spjd 80185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 81185029Spjdexpect_ok ${ZPOOL} add ${name0} mirror ${file2} ${file3} 82185029Spjdexp=`( 83185029Spjd echo " pool: ${name0}" 84185029Spjd echo " state: ONLINE" 85185029Spjd echo " scrub: none requested" 86185029Spjd echo "config:" 87185029Spjd echo " NAME STATE READ WRITE CKSUM" 88185029Spjd echo " ${name0} ONLINE 0 0 0" 89185029Spjd echo " mirror ONLINE 0 0 0" 90185029Spjd echo " ${file0} ONLINE 0 0 0" 91185029Spjd echo " ${file1} ONLINE 0 0 0" 92185029Spjd echo " mirror ONLINE 0 0 0" 93185029Spjd echo " ${file2} ONLINE 0 0 0" 94185029Spjd echo " ${file3} ONLINE 0 0 0" 95185029Spjd echo "errors: No known data errors" 96185029Spjd)` 97185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 98185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 99185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 100185029Spjd 101185029Spjdexpect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2} 102185029Spjdexpect_ok ${ZPOOL} add ${name0} raidz1 ${file3} ${file4} ${file5} 103185029Spjdexp=`( 104185029Spjd echo " pool: ${name0}" 105185029Spjd echo " state: ONLINE" 106185029Spjd echo " scrub: none requested" 107185029Spjd echo "config:" 108185029Spjd echo " NAME STATE READ WRITE CKSUM" 109185029Spjd echo " ${name0} ONLINE 0 0 0" 110185029Spjd echo " raidz1 ONLINE 0 0 0" 111185029Spjd echo " ${file0} ONLINE 0 0 0" 112185029Spjd echo " ${file1} ONLINE 0 0 0" 113185029Spjd echo " ${file2} ONLINE 0 0 0" 114185029Spjd echo " raidz1 ONLINE 0 0 0" 115185029Spjd echo " ${file3} ONLINE 0 0 0" 116185029Spjd echo " ${file4} ONLINE 0 0 0" 117185029Spjd echo " ${file5} ONLINE 0 0 0" 118185029Spjd echo "errors: No known data errors" 119185029Spjd)` 120185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 121185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 122185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 123185029Spjd 124185029Spjdexpect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3} 125185029Spjdexpect_ok ${ZPOOL} add ${name0} raidz2 ${file4} ${file5} ${file6} ${file7} 126185029Spjdexp=`( 127185029Spjd echo " pool: ${name0}" 128185029Spjd echo " state: ONLINE" 129185029Spjd echo " scrub: none requested" 130185029Spjd echo "config:" 131185029Spjd echo " NAME STATE READ WRITE CKSUM" 132185029Spjd echo " ${name0} ONLINE 0 0 0" 133185029Spjd echo " raidz2 ONLINE 0 0 0" 134185029Spjd echo " ${file0} ONLINE 0 0 0" 135185029Spjd echo " ${file1} ONLINE 0 0 0" 136185029Spjd echo " ${file2} ONLINE 0 0 0" 137185029Spjd echo " ${file3} ONLINE 0 0 0" 138185029Spjd echo " raidz2 ONLINE 0 0 0" 139185029Spjd echo " ${file4} ONLINE 0 0 0" 140185029Spjd echo " ${file5} ONLINE 0 0 0" 141185029Spjd echo " ${file6} ONLINE 0 0 0" 142185029Spjd echo " ${file7} ONLINE 0 0 0" 143185029Spjd echo "errors: No known data errors" 144185029Spjd)` 145185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 146185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 147185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 148185029Spjd 149185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 150185029Spjdexpect_ok ${ZPOOL} add ${name0} spare ${file2} ${file3} 151185029Spjdexp=`( 152185029Spjd echo " pool: ${name0}" 153185029Spjd echo " state: ONLINE" 154185029Spjd echo " scrub: none requested" 155185029Spjd echo "config:" 156185029Spjd echo " NAME STATE READ WRITE CKSUM" 157185029Spjd echo " ${name0} ONLINE 0 0 0" 158185029Spjd echo " mirror ONLINE 0 0 0" 159185029Spjd echo " ${file0} ONLINE 0 0 0" 160185029Spjd echo " ${file1} ONLINE 0 0 0" 161185029Spjd echo " spares" 162185029Spjd echo " ${file2} AVAIL" 163185029Spjd echo " ${file3} AVAIL" 164185029Spjd echo "errors: No known data errors" 165185029Spjd)` 166185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 167185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 168185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 169185029Spjd 170185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 171185029Spjdexpect_ok ${ZPOOL} add ${name0} log ${file2} ${file3} 172185029Spjdexp=`( 173185029Spjd echo " pool: ${name0}" 174185029Spjd echo " state: ONLINE" 175185029Spjd echo " scrub: none requested" 176185029Spjd echo "config:" 177185029Spjd echo " NAME STATE READ WRITE CKSUM" 178185029Spjd echo " ${name0} ONLINE 0 0 0" 179185029Spjd echo " mirror ONLINE 0 0 0" 180185029Spjd echo " ${file0} ONLINE 0 0 0" 181185029Spjd echo " ${file1} ONLINE 0 0 0" 182185029Spjd echo " logs ONLINE 0 0 0" 183185029Spjd echo " ${file2} ONLINE 0 0 0" 184185029Spjd echo " ${file3} ONLINE 0 0 0" 185185029Spjd echo "errors: No known data errors" 186185029Spjd)` 187185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 188185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 189185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 190185029Spjd 191185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 192185029Spjdexpect_ok ${ZPOOL} add ${name0} log mirror ${file2} ${file3} 193185029Spjdexp=`( 194185029Spjd echo " pool: ${name0}" 195185029Spjd echo " state: ONLINE" 196185029Spjd echo " scrub: none requested" 197185029Spjd echo "config:" 198185029Spjd echo " NAME STATE READ WRITE CKSUM" 199185029Spjd echo " ${name0} ONLINE 0 0 0" 200185029Spjd echo " mirror ONLINE 0 0 0" 201185029Spjd echo " ${file0} ONLINE 0 0 0" 202185029Spjd echo " ${file1} ONLINE 0 0 0" 203185029Spjd echo " logs ONLINE 0 0 0" 204185029Spjd echo " mirror ONLINE 0 0 0" 205185029Spjd echo " ${file2} ONLINE 0 0 0" 206185029Spjd echo " ${file3} ONLINE 0 0 0" 207185029Spjd echo "errors: No known data errors" 208185029Spjd)` 209185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 210185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 211185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 212185029Spjd 213185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 214185029Spjdexpect_fl ${ZPOOL} add ${name0} cache ${file2} ${file3} 215185029Spjdexp=`( 216185029Spjd echo " pool: ${name0}" 217185029Spjd echo " state: ONLINE" 218185029Spjd echo " scrub: none requested" 219185029Spjd echo "config:" 220185029Spjd echo " NAME STATE READ WRITE CKSUM" 221185029Spjd echo " ${name0} ONLINE 0 0 0" 222185029Spjd echo " mirror ONLINE 0 0 0" 223185029Spjd echo " ${file0} ONLINE 0 0 0" 224185029Spjd echo " ${file1} ONLINE 0 0 0" 225185029Spjd echo "errors: No known data errors" 226185029Spjd)` 227185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 228185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 229185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 230185029Spjd 231185029Spjdfiles_destroy 232