From: Brian Behlendorf Date: Fri, 3 Aug 2018 17:21:50 +0000 (-0700) Subject: ZTS: Fix zfs_create_007_pos X-Git-Tag: zfs-0.8.0-rc1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6da0998f592a322ca045dec1c9db61333c9936dc;p=zfs 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 Reviewed-by: George Melikov Reviewed by: John Kennedy Signed-off-by: Brian Behlendorf Closes #7763 --- diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh index 747f6d2f0..c49c77703 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_007_pos.ksh @@ -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