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 <guss80@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: John Kennedy <john.kennedy@delphix.com>
Closes #8579
#
#
# Copyright (c) 2016, 2017 by Intel Corporation. All rights reserved.
+# Copyright (c) 2019 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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
}