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 <behlendorf1@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #11534
This commit is contained in:
George Melikov 2021-01-28 04:33:30 +03:00 committed by GitHub
parent 6b2e7203ae
commit b8e6401b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -61,6 +61,7 @@ function cleanup
log_must rm -f $BACKUP
fi
if poolexists $TESTPOOL2 ; then
# Our disk is back. Now we can clear errors and destroy the
# pool cleanly.
log_must zpool clear $TESTPOOL2
@ -70,7 +71,8 @@ function cleanup
wait
destroy_pool $TESTPOOL2
log_must rm $REALDISK
fi
log_must rm -f $REALDISK
unload_scsi_debug
fi
}