ZTS: Fix zfs_create_007_pos

It's possible for an unrelated process, like blkid, to have the
volume open when 'zfs destroy' is run.  Switch the cleanup function
to the destroy_dataset() helper which handles this case by retrying
the destroy when the dataset is busy.

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7763
This commit is contained in:
Brian Behlendorf 2018-08-03 10:21:50 -07:00 committed by GitHub
parent 62840030a7
commit 6da0998f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -49,10 +49,8 @@ verify_runnable "global"
function cleanup
{
datasetexists $TESTPOOL/$TESTVOL && \
log_must zfs destroy -f $TESTPOOL/$TESTVOL
datasetexists $TESTPOOL/$TESTVOL1 && \
log_must zfs destroy -f $TESTPOOL/$TESTVOL1
destroy_dataset $TESTPOOL/$TESTVOL
destroy_dataset $TESTPOOL/$TESTVOL1
}
log_onexit cleanup