Skip to content

Commit b8e6401

Browse files
authored
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
1 parent 6b2e720 commit b8e6401

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/zfs-tests/tests/functional/procfs/pool_state.ksh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ function cleanup
6161
log_must rm -f $BACKUP
6262
fi
6363

64-
# Our disk is back. Now we can clear errors and destroy the
65-
# pool cleanly.
66-
log_must zpool clear $TESTPOOL2
64+
if poolexists $TESTPOOL2 ; then
65+
# Our disk is back. Now we can clear errors and destroy the
66+
# pool cleanly.
67+
log_must zpool clear $TESTPOOL2
6768

68-
# Now that the disk is back and errors cleared, wait for our
69-
# hung 'zpool scrub' to finish.
70-
wait
69+
# Now that the disk is back and errors cleared, wait for our
70+
# hung 'zpool scrub' to finish.
71+
wait
7172

72-
destroy_pool $TESTPOOL2
73-
log_must rm $REALDISK
73+
destroy_pool $TESTPOOL2
74+
fi
75+
log_must rm -f $REALDISK
7476
unload_scsi_debug
7577
fi
7678
}

0 commit comments

Comments
 (0)