]> granicus.if.org Git - zfs/commitdiff
ZTS: Fix zfs_create_007_pos
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 3 Aug 2018 17:21:50 +0000 (10:21 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Aug 2018 17:21:50 +0000 (10:21 -0700)
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

tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh

index 747f6d2f0ead18bdd1d1fd718251ab7c2313a9b8..c49c77703409078b016b40eae4bfd416d0acddab 100755 (executable)
@@ -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