xref: /freebsd/tools/regression/zfs/zpool/create/mirror.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..22"
71ba4a712SPawel Jakub Dawidek
81ba4a712SPawel Jakub Dawidekdisks_create 6
91ba4a712SPawel Jakub Dawideknames_create 1
101ba4a712SPawel Jakub Dawidek
111ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} create ${name0} mirror ${disk0}
121ba4a712SPawel Jakub Dawidek
131ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
141ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name0}
151ba4a712SPawel Jakub Dawidekexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
161ba4a712SPawel Jakub Dawidekexp=`(
171ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
181ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
191ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
201ba4a712SPawel Jakub Dawidek  echo "config:"
211ba4a712SPawel Jakub Dawidek  echo "	NAME          STATE   READ WRITE CKSUM"
221ba4a712SPawel Jakub Dawidek  echo "	${name0}      ONLINE     0     0     0"
231ba4a712SPawel Jakub Dawidek  echo "	  mirror      ONLINE     0     0     0"
241ba4a712SPawel Jakub Dawidek  echo "	    ${disk0}  ONLINE     0     0     0"
251ba4a712SPawel Jakub Dawidek  echo "	    ${disk1}  ONLINE     0     0     0"
261ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
271ba4a712SPawel Jakub Dawidek)`
281ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
291ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
301ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name0}
311ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} destroy ${name0}
321ba4a712SPawel Jakub Dawidek
331ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} ${disk2} ${disk3} ${disk4}
341ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name0}
351ba4a712SPawel Jakub Dawidekexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
361ba4a712SPawel Jakub Dawidekexp=`(
371ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
381ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
391ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
401ba4a712SPawel Jakub Dawidek  echo "config:"
411ba4a712SPawel Jakub Dawidek  echo "	NAME          STATE   READ WRITE CKSUM"
421ba4a712SPawel Jakub Dawidek  echo "	${name0}      ONLINE     0     0     0"
431ba4a712SPawel Jakub Dawidek  echo "	  mirror      ONLINE     0     0     0"
441ba4a712SPawel Jakub Dawidek  echo "	    ${disk0}  ONLINE     0     0     0"
451ba4a712SPawel Jakub Dawidek  echo "	    ${disk1}  ONLINE     0     0     0"
461ba4a712SPawel Jakub Dawidek  echo "	    ${disk2}  ONLINE     0     0     0"
471ba4a712SPawel Jakub Dawidek  echo "	    ${disk3}  ONLINE     0     0     0"
481ba4a712SPawel Jakub Dawidek  echo "	    ${disk4}  ONLINE     0     0     0"
491ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
501ba4a712SPawel Jakub Dawidek)`
511ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
521ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
531ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name0}
541ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} destroy ${name0}
551ba4a712SPawel Jakub Dawidek
561ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} mirror ${disk2} ${disk3} mirror ${disk4} ${disk5}
571ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} status -x ${name0}
581ba4a712SPawel Jakub Dawidekexpect "pool '${name0}' is healthy" ${ZPOOL} status -x ${name0}
591ba4a712SPawel Jakub Dawidekexp=`(
601ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
611ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
621ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
631ba4a712SPawel Jakub Dawidek  echo "config:"
641ba4a712SPawel Jakub Dawidek  echo "	NAME          STATE   READ WRITE CKSUM"
651ba4a712SPawel Jakub Dawidek  echo "	${name0}      ONLINE     0     0     0"
661ba4a712SPawel Jakub Dawidek  echo "	  mirror      ONLINE     0     0     0"
671ba4a712SPawel Jakub Dawidek  echo "	    ${disk0}  ONLINE     0     0     0"
681ba4a712SPawel Jakub Dawidek  echo "	    ${disk1}  ONLINE     0     0     0"
691ba4a712SPawel Jakub Dawidek  echo "	  mirror      ONLINE     0     0     0"
701ba4a712SPawel Jakub Dawidek  echo "	    ${disk2}  ONLINE     0     0     0"
711ba4a712SPawel Jakub Dawidek  echo "	    ${disk3}  ONLINE     0     0     0"
721ba4a712SPawel Jakub Dawidek  echo "	  mirror      ONLINE     0     0     0"
731ba4a712SPawel Jakub Dawidek  echo "	    ${disk4}  ONLINE     0     0     0"
741ba4a712SPawel Jakub Dawidek  echo "	    ${disk5}  ONLINE     0     0     0"
751ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
761ba4a712SPawel Jakub Dawidek)`
771ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
781ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
791ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name0}
801ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} destroy ${name0}
811ba4a712SPawel Jakub Dawidek
821ba4a712SPawel Jakub Dawidekdisks_destroy
83