diff options
author | John Wren Kennedy <[email protected]> | 2019-04-12 11:07:20 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-04-12 10:07:20 -0700 |
commit | 9e3485abfcff126654c98aa64512505e603215d0 (patch) | |
tree | 5a10567b7db2a571bc66702137e0c9dd90702ab3 | |
parent | b31cf30a155d10e6f4a6dc4941e5b4720c4f2daf (diff) |
ZTS: Make fault cleanup function more robust
The cleanup function of auto_online_001_pos does not account for the
possibility that the test may fail while a disk is still removed. If
the test run is using real disks, cleanup should involve restoring any
that are missing.
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: John Kennedy <[email protected]>
Closes #8579
-rwxr-xr-x | tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh index beff5dc87..bc925bc91 100755 --- a/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh @@ -21,6 +21,7 @@ # # # Copyright (c) 2016, 2017 by Intel Corporation. All rights reserved. +# Copyright (c) 2019 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -54,6 +55,15 @@ fi function cleanup { + typeset disk + + # Replace any disk that may have been removed at failure time. + for disk in $DISK1 $DISK2 $DISK3; do + # Skip loop devices and devices that currently exist. + is_loop_device $disk && continue + is_real_device $disk && continue + insert_disk $disk $(get_scsi_host $disk) + done destroy_pool $TESTPOOL unload_scsi_debug } |