]> granicus.if.org Git - zfs/commitdiff
ZTS: Fix snapshot_009_pos, snapshot_010_pos
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 Oct 2018 00:15:57 +0000 (17:15 -0700)
committerGitHub <noreply@github.com>
Tue, 2 Oct 2018 00:15:57 +0000 (17:15 -0700)
Mitigate the likelihood of the newly created volumes being busy
when the 'zfs destroy -r' is issued by waiting for udev to settle.
Since this is not a iron clad fix I've added the test case to
the known list of possible failures and referenced issue #7961.

Finally, in the case this test does fail fix the cleanup logic
so subsequent tests won't incorrectly fail.

Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7961
Closes #7962

tests/test-runner/bin/zts-report.py
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh

index 2cf2eb9412ca5e454c344371a5c9ec8257228db7..d4e743a171a9d17c073745f07c4e6731fec42f15 100755 (executable)
@@ -264,6 +264,8 @@ maybe = {
     'rsend/rsend_024_pos': ['FAIL', '5665'],
     'rsend/send-c_volume': ['FAIL', '6087'],
     'snapshot/clone_001_pos': ['FAIL', known_reason],
+    'snapshot/snapshot_009_pos': ['FAIL', '7961'],
+    'snapshot/snapshot_010_pos': ['FAIL', '7961'],
     'snapused/snapused_004_pos': ['FAIL', '5513'],
     'tmpfile/setup': ['SKIP', tmpfile_reason],
     'threadsappend/threadsappend_001_pos': ['FAIL', '6136'],
index e5a3d63a40d3bf98c11651414e7c921b878227c7..608f4f29b1fd1bde9335cd047c3dcbace973dabe 100644 (file)
@@ -642,7 +642,7 @@ function destroy_snapshot
        typeset snap=${1:-$TESTPOOL/$TESTFS@$TESTSNAP}
 
        if ! snapexists $snap; then
-               log_fail "'$snap' does not existed."
+               log_fail "'$snap' does not exist."
        fi
 
        #
index 9266691247cfa0e96bb120deabb8045336ebc715..6607d4ca497448e8552c9665eedbc63ff5995860 100755 (executable)
@@ -52,18 +52,15 @@ function cleanup
        typeset snap
 
        for ds in $ctr/$TESTVOL1 $ctr/$TESTCLONE; do
-               datasetexists $ds && \
-                       log_must zfs destroy -f $ds
+               destroy_dataset $ds "-rf"
        done
 
        for snap in $ctr/$TESTFS1@$TESTSNAP1 \
                $snappool $snapvol $snapctr $snapctrvol \
                $snapctrclone $snapctrfs
        do
-               snapexists $snap && \
-                       log_must zfs destroy -rf $snap
+               snapexists $snap && destroy_dataset $snap "-rf"
        done
-
 }
 
 log_assert "Verify snapshot -r can correctly create a snapshot tree."
@@ -91,6 +88,7 @@ else
 fi
 
 log_must zfs snapshot -r $snappool
+log_must block_device_wait
 
 #verify the snapshot -r results
 for snap in $snappool $snapfs $snapvol $snapctr $snapctrvol \
index e0849493db3c17b74187bd3d9fc5c7bacff84bb5..0f876ad6d61e1ca1576478100a66f2a0e108a5c2 100755 (executable)
@@ -49,15 +49,13 @@ function cleanup
 {
        typeset snap
 
-       datasetexists $ctrvol && \
-               log_must zfs destroy -f $ctrvol
+       destroy_dataset $ctrvol "-rf"
 
        for snap in $ctrfs@$TESTSNAP1 \
                $snappool $snapvol $snapctr $snapctrvol \
                $snapctrclone $snapctrfs
        do
-               snapexists $snap && \
-                       log_must zfs destroy -rf $snap
+               snapexists $snap && destroy_dataset $snap "-rf"
        done
 
 }
@@ -85,6 +83,7 @@ else
 fi
 
 log_must zfs snapshot -r $snappool
+log_must block_device_wait
 
 #select the $TESTCTR as destroy point, $TESTCTR is a child of $TESTPOOL
 log_must zfs destroy -r $snapctr