From 6da0998f592a322ca045dec1c9db61333c9936dc Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 3 Aug 2018 10:21:50 -0700 Subject: [PATCH] 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 --- .../functional/cli_root/zfs_create/zfs_create_007_pos.ksh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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