ZTS: Fix pool_state cleanup

The externally faulted vdev should be brought back online and have
its errors cleared before the pool is destroyed.  Failure to do so
will leave a vdev with a valid active label.  This vdev may then
not be used to create a new pool without the -f flag potentially
leading to subsequent test failures.

Additionally remove an unreachable log_pass from setup.ksh.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9777
This commit is contained in:
Brian Behlendorf 2019-12-28 08:43:23 -08:00 committed by Tony Hutter
parent 70d2e938b5
commit 756c58cf71
2 changed files with 3 additions and 2 deletions

View File

@ -105,8 +105,10 @@ check_all $TESTPOOL "ONLINE"
# Fault one of the disks, and check that pool is degraded
DISK1=$(echo "$DISKS" | awk '{print $2}')
zpool offline -tf $TESTPOOL $DISK1
log_must zpool offline -tf $TESTPOOL $DISK1
check_all $TESTPOOL "DEGRADED"
log_must zpool online $TESTPOOL $DISK1
log_must zpool clear $TESTPOOL
# Create a new pool out of a scsi_debug disk
TESTPOOL2=testpool2

View File

@ -31,4 +31,3 @@ if ! is_linux ; then
fi
default_mirror_setup $DISKS
log_pass