xref: /freebsd/tools/regression/zfs/zpool/remove/cache.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..9"
71ba4a712SPawel Jakub Dawidek
81ba4a712SPawel Jakub Dawidekdisks_create 4
91ba4a712SPawel Jakub Dawideknames_create 1
101ba4a712SPawel Jakub Dawidek
111ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} create ${name0} ${disk0} cache ${disk1}
121ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} add ${name0} cache ${disk2} ${disk3}
131ba4a712SPawel Jakub Dawidekexp=`(
141ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
151ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
161ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
171ba4a712SPawel Jakub Dawidek  echo "config:"
181ba4a712SPawel Jakub Dawidek  echo "	NAME        STATE   READ WRITE CKSUM"
191ba4a712SPawel Jakub Dawidek  echo "	${name0}    ONLINE     0     0     0"
201ba4a712SPawel Jakub Dawidek  echo "	  ${disk0}  ONLINE     0     0     0"
211ba4a712SPawel Jakub Dawidek  echo "	cache"
221ba4a712SPawel Jakub Dawidek  echo "	  ${disk1}  ONLINE     0     0     0"
231ba4a712SPawel Jakub Dawidek  echo "	  ${disk2}  ONLINE     0     0     0"
241ba4a712SPawel Jakub Dawidek  echo "	  ${disk3}  ONLINE     0     0     0"
251ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
261ba4a712SPawel Jakub Dawidek)`
271ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
281ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} remove ${name0} ${disk1} ${disk2}
291ba4a712SPawel Jakub Dawidekexp=`(
301ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
311ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
321ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
331ba4a712SPawel Jakub Dawidek  echo "config:"
341ba4a712SPawel Jakub Dawidek  echo "	NAME        STATE   READ WRITE CKSUM"
351ba4a712SPawel Jakub Dawidek  echo "	${name0}    ONLINE     0     0     0"
361ba4a712SPawel Jakub Dawidek  echo "	  ${disk0}  ONLINE     0     0     0"
371ba4a712SPawel Jakub Dawidek  echo "	cache"
381ba4a712SPawel Jakub Dawidek  echo "	  ${disk3}  ONLINE     0     0     0"
391ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
401ba4a712SPawel Jakub Dawidek)`
411ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
421ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} remove ${name0} ${disk3}
431ba4a712SPawel Jakub Dawidekexp=`(
441ba4a712SPawel Jakub Dawidek  echo "  pool: ${name0}"
451ba4a712SPawel Jakub Dawidek  echo " state: ONLINE"
461ba4a712SPawel Jakub Dawidek  echo " scrub: none requested"
471ba4a712SPawel Jakub Dawidek  echo "config:"
481ba4a712SPawel Jakub Dawidek  echo "	NAME        STATE   READ WRITE CKSUM"
491ba4a712SPawel Jakub Dawidek  echo "	${name0}    ONLINE     0     0     0"
501ba4a712SPawel Jakub Dawidek  echo "	  ${disk0}  ONLINE     0     0     0"
511ba4a712SPawel Jakub Dawidek  echo "errors: No known data errors"
521ba4a712SPawel Jakub Dawidek)`
531ba4a712SPawel Jakub Dawidekexpect "${exp}" ${ZPOOL} status ${name0}
541ba4a712SPawel Jakub Dawidekexpect_ok ${ZPOOL} destroy ${name0}
551ba4a712SPawel Jakub Dawidekexpect_fl ${ZPOOL} status -x ${name0}
561ba4a712SPawel Jakub Dawidek
571ba4a712SPawel Jakub Dawidekdisks_destroy
58