1185029Spjd#!/bin/sh 2185029Spjd# $FreeBSD: releng/10.3/tools/regression/zfs/zpool/create/files.t 185029 2008-11-17 20:49:29Z pjd $ 3185029Spjd 4185029Spjddir=`dirname $0` 5185029Spjd. ${dir}/../../misc.sh 6185029Spjd 7185029Spjdecho "1..59" 8185029Spjd 9185029Spjdfiles_create 5 10185029Spjdnames_create 1 11185029Spjd 12185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} 13185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 14185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 15185029Spjdexp=`( 16185029Spjd echo " pool: ${name0}" 17185029Spjd echo " state: ONLINE" 18185029Spjd echo " scrub: none requested" 19185029Spjd echo "config:" 20185029Spjd echo " NAME STATE READ WRITE CKSUM" 21185029Spjd echo " ${name0} ONLINE 0 0 0" 22185029Spjd echo " ${file0} ONLINE 0 0 0" 23185029Spjd echo "errors: No known data errors" 24185029Spjd)` 25185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 26185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 27185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 28185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 29185029Spjd 30185029Spjdexpect_ok ${ZPOOL} create ${name0} ${file0} ${file1} ${file2} ${file3} ${file4} 31185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 32185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 33185029Spjdexp=`( 34185029Spjd echo " pool: ${name0}" 35185029Spjd echo " state: ONLINE" 36185029Spjd echo " scrub: none requested" 37185029Spjd echo "config:" 38185029Spjd echo " NAME STATE READ WRITE CKSUM" 39185029Spjd echo " ${name0} ONLINE 0 0 0" 40185029Spjd echo " ${file0} ONLINE 0 0 0" 41185029Spjd echo " ${file1} ONLINE 0 0 0" 42185029Spjd echo " ${file2} ONLINE 0 0 0" 43185029Spjd echo " ${file3} ONLINE 0 0 0" 44185029Spjd echo " ${file4} ONLINE 0 0 0" 45185029Spjd echo "errors: No known data errors" 46185029Spjd)` 47185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 48185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 49185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 50185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 51185029Spjd 52185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 53185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 54185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 55185029Spjdexp=`( 56185029Spjd echo " pool: ${name0}" 57185029Spjd echo " state: ONLINE" 58185029Spjd echo " scrub: none requested" 59185029Spjd echo "config:" 60185029Spjd echo " NAME STATE READ WRITE CKSUM" 61185029Spjd echo " ${name0} ONLINE 0 0 0" 62185029Spjd echo " mirror ONLINE 0 0 0" 63185029Spjd echo " ${file0} ONLINE 0 0 0" 64185029Spjd echo " ${file1} ONLINE 0 0 0" 65185029Spjd echo "errors: No known data errors" 66185029Spjd)` 67185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 68185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 69185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 70185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 71185029Spjd 72185029Spjdexpect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2} 73185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 74185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 75185029Spjdexp=`( 76185029Spjd echo " pool: ${name0}" 77185029Spjd echo " state: ONLINE" 78185029Spjd echo " scrub: none requested" 79185029Spjd echo "config:" 80185029Spjd echo " NAME STATE READ WRITE CKSUM" 81185029Spjd echo " ${name0} ONLINE 0 0 0" 82185029Spjd echo " raidz1 ONLINE 0 0 0" 83185029Spjd echo " ${file0} ONLINE 0 0 0" 84185029Spjd echo " ${file1} ONLINE 0 0 0" 85185029Spjd echo " ${file2} ONLINE 0 0 0" 86185029Spjd echo "errors: No known data errors" 87185029Spjd)` 88185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 89185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 90185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 91185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 92185029Spjd 93185029Spjdexpect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3} 94185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 95185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 96185029Spjdexp=`( 97185029Spjd echo " pool: ${name0}" 98185029Spjd echo " state: ONLINE" 99185029Spjd echo " scrub: none requested" 100185029Spjd echo "config:" 101185029Spjd echo " NAME STATE READ WRITE CKSUM" 102185029Spjd echo " ${name0} ONLINE 0 0 0" 103185029Spjd echo " raidz2 ONLINE 0 0 0" 104185029Spjd echo " ${file0} ONLINE 0 0 0" 105185029Spjd echo " ${file1} ONLINE 0 0 0" 106185029Spjd echo " ${file2} ONLINE 0 0 0" 107185029Spjd echo " ${file3} ONLINE 0 0 0" 108185029Spjd echo "errors: No known data errors" 109185029Spjd)` 110185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 111185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 112185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 113185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 114185029Spjd 115185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} spare ${file2} ${file3} 116185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 117185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 118185029Spjdexp=`( 119185029Spjd echo " pool: ${name0}" 120185029Spjd echo " state: ONLINE" 121185029Spjd echo " scrub: none requested" 122185029Spjd echo "config:" 123185029Spjd echo " NAME STATE READ WRITE CKSUM" 124185029Spjd echo " ${name0} ONLINE 0 0 0" 125185029Spjd echo " mirror ONLINE 0 0 0" 126185029Spjd echo " ${file0} ONLINE 0 0 0" 127185029Spjd echo " ${file1} ONLINE 0 0 0" 128185029Spjd echo " spares" 129185029Spjd echo " ${file2} AVAIL " 130185029Spjd echo " ${file3} AVAIL " 131185029Spjd echo "errors: No known data errors" 132185029Spjd)` 133185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 134185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 135185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 136185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 137185029Spjd 138185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} log ${file2} ${file3} 139185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 140185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 141185029Spjdexp=`( 142185029Spjd echo " pool: ${name0}" 143185029Spjd echo " state: ONLINE" 144185029Spjd echo " scrub: none requested" 145185029Spjd echo "config:" 146185029Spjd echo " NAME STATE READ WRITE CKSUM" 147185029Spjd echo " ${name0} ONLINE 0 0 0" 148185029Spjd echo " mirror ONLINE 0 0 0" 149185029Spjd echo " ${file0} ONLINE 0 0 0" 150185029Spjd echo " ${file1} ONLINE 0 0 0" 151185029Spjd echo " logs ONLINE 0 0 0" 152185029Spjd echo " ${file2} ONLINE 0 0 0" 153185029Spjd echo " ${file3} ONLINE 0 0 0" 154185029Spjd echo "errors: No known data errors" 155185029Spjd)` 156185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 157185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 158185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 159185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 160185029Spjd 161185029Spjdexpect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} log mirror ${file2} ${file3} 162185029Spjdexpect_ok ${ZPOOL} status -x ${name0} 163185029Spjdexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0} 164185029Spjdexp=`( 165185029Spjd echo " pool: ${name0}" 166185029Spjd echo " state: ONLINE" 167185029Spjd echo " scrub: none requested" 168185029Spjd echo "config:" 169185029Spjd echo " NAME STATE READ WRITE CKSUM" 170185029Spjd echo " ${name0} ONLINE 0 0 0" 171185029Spjd echo " mirror ONLINE 0 0 0" 172185029Spjd echo " ${file0} ONLINE 0 0 0" 173185029Spjd echo " ${file1} ONLINE 0 0 0" 174185029Spjd echo " logs ONLINE 0 0 0" 175185029Spjd echo " mirror ONLINE 0 0 0" 176185029Spjd echo " ${file2} ONLINE 0 0 0" 177185029Spjd echo " ${file3} ONLINE 0 0 0" 178185029Spjd echo "errors: No known data errors" 179185029Spjd)` 180185029Spjdexpect "${exp}" ${ZPOOL} status ${name0} 181185029Spjdexpect_ok ${ZPOOL} destroy ${name0} 182185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 183185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 184185029Spjd 185185029Spjdexpect_fl ${ZPOOL} create ${name0} mirror ${file0} ${file1} cache ${file2} ${file3} 186185029Spjdexpect_fl ${ZPOOL} status -x ${name0} 187185029Spjdexpect_fl ${ZPOOL} destroy ${name0} 188185029Spjd 189185029Spjdfiles_destroy 190