summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2021-01-28 04:33:30 +0300
committerGitHub <[email protected]>2021-01-27 17:33:30 -0800
commitb8e6401b794be9e8188d595d64f98b560d50cb6e (patch)
tree4b83f8f43d9d1ad7d78a2460086a6b61aae189f8
parent6b2e7203ae5c90fb9fb1ef353fdc18372f36d11f (diff)
ZTS: pool_state test check for pool existence in cleanup
If there is no scsi_debug module, then this test must be skipped, in this case cleanup routine should be prepared for absent pool. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #11534
-rwxr-xr-xtests/zfs-tests/tests/functional/procfs/pool_state.ksh18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/zfs-tests/tests/functional/procfs/pool_state.ksh b/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
index f4df839be..080fdddb2 100755
--- a/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
+++ b/tests/zfs-tests/tests/functional/procfs/pool_state.ksh
@@ -61,16 +61,18 @@ function cleanup
log_must rm -f $BACKUP
fi
- # Our disk is back. Now we can clear errors and destroy the
- # pool cleanly.
- log_must zpool clear $TESTPOOL2
+ if poolexists $TESTPOOL2 ; then
+ # Our disk is back. Now we can clear errors and destroy the
+ # pool cleanly.
+ log_must zpool clear $TESTPOOL2
- # Now that the disk is back and errors cleared, wait for our
- # hung 'zpool scrub' to finish.
- wait
+ # Now that the disk is back and errors cleared, wait for our
+ # hung 'zpool scrub' to finish.
+ wait
- destroy_pool $TESTPOOL2
- log_must rm $REALDISK
+ destroy_pool $TESTPOOL2
+ fi
+ log_must rm -f $REALDISK
unload_scsi_debug
fi
}