xref: /freebsd/tools/regression/zfs/zpool/create/option-f_inuse.t (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
11ba4a712SPawel Jakub Dawidek#!/bin/sh
21ba4a712SPawel Jakub Dawidek
31ba4a712SPawel Jakub Dawidekdir=`dirname $0`
41ba4a712SPawel Jakub Dawidek. ${dir}/../../misc.sh
51ba4a712SPawel Jakub Dawidek
61ba4a712SPawel Jakub Dawidekecho "1..146"
71ba4a712SPawel Jakub Dawidek
81ba4a712SPawel Jakub Dawidekdisks_create 7
91ba4a712SPawel Jakub Dawideknames_create 2
101ba4a712SPawel Jakub Dawidek
111ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0}
121ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
131ba4a712SPawel Jakub Dawidekexp=`(
141ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
151ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
161ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
171ba4a712SPawel Jakub Dawidek)`
181ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk0}
191ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
201ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk0}
211ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
221ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
231ba4a712SPawel Jakub Dawidek
241ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
251ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
261ba4a712SPawel Jakub Dawidekexp=`(
271ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
281ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
291ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
301ba4a712SPawel Jakub Dawidek)`
311ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} mirror ${disk0} ${disk1}
321ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
331ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} mirror ${disk0} ${disk1}
341ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
351ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
361ba4a712SPawel Jakub Dawidek
371ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
381ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
391ba4a712SPawel Jakub Dawidekexp=`(
401ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
411ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
421ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
431ba4a712SPawel Jakub Dawidek)`
441ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz1 ${disk0} ${disk1} ${disk2}
451ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
461ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} raidz1 ${disk0} ${disk1} ${disk2}
471ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
481ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
491ba4a712SPawel Jakub Dawidek
501ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
511ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
521ba4a712SPawel Jakub Dawidekexp=`(
531ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
541ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
551ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
561ba4a712SPawel Jakub Dawidek)`
571ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
581ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
591ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
601ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
611ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
621ba4a712SPawel Jakub Dawidek
631ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} log ${disk1}
641ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
651ba4a712SPawel Jakub Dawidekexp=`(
661ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
671ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
681ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
691ba4a712SPawel Jakub Dawidek)`
701ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk0} log ${disk1}
711ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
721ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk0} log ${disk1}
731ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
741ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
751ba4a712SPawel Jakub Dawidek
761ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
771ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
781ba4a712SPawel Jakub Dawidekexp=`(
791ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
801ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
811ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
821ba4a712SPawel Jakub Dawidek)`
831ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk0} log mirror ${disk1} ${disk2}
841ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
851ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk0} log mirror ${disk1} ${disk2}
861ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
871ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
881ba4a712SPawel Jakub Dawidek
891ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} cache ${disk1}
901ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
911ba4a712SPawel Jakub Dawidekexp=`(
921ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
931ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
941ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
951ba4a712SPawel Jakub Dawidek)`
961ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk0} cache ${disk1}
971ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
981ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk0} cache ${disk1}
991ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1001ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1011ba4a712SPawel Jakub Dawidek
1021ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
1031ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk1}
1041ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
1051ba4a712SPawel Jakub Dawidekexp=`(
1061ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1071ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1081ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of potentially active pool '${name0}'"
1091ba4a712SPawel Jakub Dawidek)`
1101ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} mirror ${disk1} ${disk2}
1111ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1121ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} mirror ${disk1} ${disk2}
1131ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1141ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1151ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} import ${name0}
1161ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
1171ba4a712SPawel Jakub Dawidek
1181ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
1191ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk2}
1201ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
1211ba4a712SPawel Jakub Dawidekexp=`(
1221ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1231ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1241ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of potentially active pool '${name0}'"
1251ba4a712SPawel Jakub Dawidek)`
1261ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz1 ${disk2} ${disk3} ${disk4}
1271ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1281ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} raidz1 ${disk2} ${disk3} ${disk4}
1291ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1301ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1311ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} import ${name0}
1321ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
1331ba4a712SPawel Jakub Dawidek
1341ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
1351ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk3}
1361ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
1371ba4a712SPawel Jakub Dawidekexp=`(
1381ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1391ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1401ba4a712SPawel Jakub Dawidek  echo "${fdisk3} is part of potentially active pool '${name0}'"
1411ba4a712SPawel Jakub Dawidek)`
1421ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz2 ${disk3} ${disk4} ${disk5} ${disk6}
1431ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1441ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} raidz2 ${disk3} ${disk4} ${disk5} ${disk6}
1451ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1461ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1471ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} import ${name0}
1481ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
1491ba4a712SPawel Jakub Dawidek
1501ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
1511ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk2}
1521ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
1531ba4a712SPawel Jakub Dawidekexp=`(
1541ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1551ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1561ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of potentially active pool '${name0}'"
1571ba4a712SPawel Jakub Dawidek)`
1581ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk3} log mirror ${disk2} ${disk4}
1591ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1601ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk3} log mirror ${disk2} ${disk4}
1611ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1621ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1631ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} import ${name0}
1641ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
1651ba4a712SPawel Jakub Dawidek
1661ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} cache ${disk1}
1671ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk1}
1681ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
1691ba4a712SPawel Jakub Dawidekexp=`(
1701ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1711ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1721ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of potentially active pool '${name0}'"
1731ba4a712SPawel Jakub Dawidek)`
1741ba4a712SPawel Jakub Dawidekadd_msg="# TODO It shouldn't be possible to use offlined cache vdev."
1751ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk2} cache ${disk1}
1761ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1771ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name1} ${disk2} cache ${disk1}
1781ba4a712SPawel Jakub Dawidekadd_msg=""
1791ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name1}
1801ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name1}
1811ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} import ${name0}
1821ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
1831ba4a712SPawel Jakub Dawidek
1841ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
1851ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk1}
1861ba4a712SPawel Jakub Dawidekexp=`(
1871ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1881ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
1891ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of active pool '${name0}'"
1901ba4a712SPawel Jakub Dawidek)`
1911ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} mirror ${disk1} ${disk2}
1921ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
1931ba4a712SPawel Jakub Dawidekexp=`(
1941ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
1951ba4a712SPawel Jakub Dawidek  echo "the following errors must be manually repaired:"
1961ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of active pool '${name0}'"
1971ba4a712SPawel Jakub Dawidek)`
1981ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create -f ${name1} mirror ${disk1} ${disk2}
1991ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2001ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} online ${name0} ${disk1}
2011ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2021ba4a712SPawel Jakub Dawidek
2031ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
2041ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk2}
2051ba4a712SPawel Jakub Dawidekexp=`(
2061ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2071ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
2081ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of active pool '${name0}'"
2091ba4a712SPawel Jakub Dawidek)`
2101ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz1 ${disk2} ${disk3} ${disk4}
2111ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2121ba4a712SPawel Jakub Dawidekexp=`(
2131ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2141ba4a712SPawel Jakub Dawidek  echo "the following errors must be manually repaired:"
2151ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of active pool '${name0}'"
2161ba4a712SPawel Jakub Dawidek)`
2171ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create -f ${name1} raidz1 ${disk2} ${disk3} ${disk4}
2181ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2191ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} online ${name0} ${disk2}
2201ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2211ba4a712SPawel Jakub Dawidek
2221ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
2231ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk3}
2241ba4a712SPawel Jakub Dawidekexp=`(
2251ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2261ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
2271ba4a712SPawel Jakub Dawidek  echo "${fdisk3} is part of active pool '${name0}'"
2281ba4a712SPawel Jakub Dawidek)`
2291ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} raidz2 ${disk3} ${disk4} ${disk5} ${disk6}
2301ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2311ba4a712SPawel Jakub Dawidekexp=`(
2321ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2331ba4a712SPawel Jakub Dawidek  echo "the following errors must be manually repaired:"
2341ba4a712SPawel Jakub Dawidek  echo "${fdisk3} is part of active pool '${name0}'"
2351ba4a712SPawel Jakub Dawidek)`
2361ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create -f ${name1} raidz2 ${disk3} ${disk4} ${disk5} ${disk6}
2371ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2381ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} online ${name0} ${disk3}
2391ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2401ba4a712SPawel Jakub Dawidek
2411ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
2421ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk2}
2431ba4a712SPawel Jakub Dawidekexp=`(
2441ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2451ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
2461ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of active pool '${name0}'"
2471ba4a712SPawel Jakub Dawidek)`
2481ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk3} log mirror ${disk2} ${disk4}
2491ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2501ba4a712SPawel Jakub Dawidekexp=`(
2511ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2521ba4a712SPawel Jakub Dawidek  echo "the following errors must be manually repaired:"
2531ba4a712SPawel Jakub Dawidek  echo "${fdisk2} is part of active pool '${name0}'"
2541ba4a712SPawel Jakub Dawidek)`
2551ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create -f ${name1} ${disk3} log mirror ${disk2} ${disk4}
2561ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2571ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} online ${name0} ${disk2}
2581ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2591ba4a712SPawel Jakub Dawidek
2601ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} cache ${disk1}
2611ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} offline ${name0} ${disk1}
2621ba4a712SPawel Jakub Dawidekexp=`(
2631ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2641ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
2651ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of active pool '${name0}'"
2661ba4a712SPawel Jakub Dawidek)`
2671ba4a712SPawel Jakub Dawidekadd_msg="# TODO It reports that ${fdisk1} is part of unknown pool."
2681ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name1} ${disk2} cache ${disk1}
2691ba4a712SPawel Jakub Dawidekadd_msg=""
2701ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2711ba4a712SPawel Jakub Dawidekexp=`(
2721ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2731ba4a712SPawel Jakub Dawidek  echo "the following errors must be manually repaired:"
2741ba4a712SPawel Jakub Dawidek  echo "${fdisk1} is part of active pool '${name0}'"
2751ba4a712SPawel Jakub Dawidek)`
2761ba4a712SPawel Jakub Dawidekadd_msg="# TODO It reports that ${fdisk1} is used twice."
2771ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create -f ${name1} ${disk2} cache ${disk1}
2781ba4a712SPawel Jakub Dawidekadd_msg=""
2791ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name1}
2801ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} online ${name0} ${disk1}
2811ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2821ba4a712SPawel Jakub Dawidek
2831ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0}
2841ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} export ${name0}
2851ba4a712SPawel Jakub Dawidekexp=`(
2861ba4a712SPawel Jakub Dawidek  echo "invalid vdev specification"
2871ba4a712SPawel Jakub Dawidek  echo "use '-f' to override the following errors:"
2881ba4a712SPawel Jakub Dawidek  echo "${fdisk0} is part of exported pool '${name0}'"
2891ba4a712SPawel Jakub Dawidek)`
2901ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} create ${name0} ${disk0}
2911ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name0}
2921ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create -f ${name0} ${disk0}
2931ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name0}
2941ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
2951ba4a712SPawel Jakub Dawidek
2961ba4a712SPawel Jakub Dawidekdisks_destroy
297