]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: Fix zfs_create_013_pos
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 30 Aug 2018 20:38:09 +0000 (13:38 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Aug 2018 20:38:09 +0000 (13:38 -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: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7847

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

index b24d39fd402226d9aecd71d9e3071ed888ebb88a..993c6436a7b19b53d334eff9716fde6d98ac6673 100755 (executable)
@@ -48,8 +48,7 @@ function cleanup
 {
        typeset -i j=0
        while [[ $j -lt ${#size[*]} ]]; do
-               datasetexists $TESTPOOL/${LONGFSNAME}${size[j]} && \
-                   log_must zfs destroy $TESTPOOL/${LONGFSNAME}${size[j]}
+               destroy_dataset $TESTPOOL/${LONGFSNAME}${size[j]}
                ((j = j + 1))
        done
 }