From 35b7842f6821ecbf019e64204730cc0425ecc331 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 3 May 2017 18:27:59 -0700 Subject: [PATCH] Enable all zfs_destroy test cases * zfs_destroy_001_pos - Unable to reproduce the failures locally. Re-enabled to determine observed buildbot failure rate. * zfs_destroy_005_neg - Updated for expected Linux behavior. Busy mount points, even snapshots, are expected to fail. * zfs_destroy_010_pos - Resolved transient EBUSY with retry. Reviewed-by: Giuseppe Di Natale Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Issue #5635 Issue #5893 Closes #6091 --- tests/runfiles/linux.run | 14 ++++++------- .../zfs_destroy/zfs_destroy_005_neg.ksh | 20 ++++++++++++++----- .../zfs_destroy/zfs_destroy_010_pos.ksh | 2 +- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index cf0dd126f..d8c70ab02 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -99,15 +99,13 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos', 'zfs_create_010_neg', 'zfs_create_011_pos', 'zfs_create_012_pos', 'zfs_create_013_pos', 'zfs_create_014_pos'] -# DISABLED: -# zfs_destroy_005_neg - busy mountpoint behavior -# zfs_destroy_001_pos - https://github.com/zfsonlinux/zfs/issues/5635 [tests/functional/cli_root/zfs_destroy] -tests = ['zfs_destroy_002_pos', 'zfs_destroy_003_pos', - 'zfs_destroy_004_pos','zfs_destroy_006_neg', 'zfs_destroy_007_neg', - 'zfs_destroy_008_pos','zfs_destroy_009_pos', 'zfs_destroy_010_pos', - 'zfs_destroy_011_pos','zfs_destroy_012_pos', 'zfs_destroy_013_neg', - 'zfs_destroy_014_pos','zfs_destroy_015_pos', 'zfs_destroy_016_pos'] +tests = ['zfs_destroy_001_pos', 'zfs_destroy_002_pos', 'zfs_destroy_003_pos', + 'zfs_destroy_004_pos', 'zfs_destroy_005_neg', 'zfs_destroy_006_neg', + 'zfs_destroy_007_neg', 'zfs_destroy_008_pos', 'zfs_destroy_009_pos', + 'zfs_destroy_010_pos', 'zfs_destroy_011_pos', 'zfs_destroy_012_pos', + 'zfs_destroy_013_neg', 'zfs_destroy_014_pos', 'zfs_destroy_015_pos', + 'zfs_destroy_016_pos'] # DISABLED: # zfs_get_004_pos - https://github.com/zfsonlinux/zfs/issues/3484 diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh index 3a9370977..b58f7b325 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh @@ -187,9 +187,12 @@ pidlist="" # # Create the clones for test environment and make the snapshot busy. -# Then verify 'zfs destroy $snap' succeeds without '-f'. # -# Then verify the snapshot and clone are destroyed, but nothing else is. +# For Linux verify 'zfs destroy $snap' fails due to the busy mount point. Then +# verify the snapshot remains and the clone was destroyed, but nothing else is. +# +# Under illumos verify 'zfs destroy $snap' succeeds without '-f'. Then verify +# the snapshot and clone are destroyed, but nothing else is. # mntpt=$(snapshot_mountpoint $FSSNAP) @@ -199,9 +202,16 @@ log_note "mkbusy $mntpt (pidlist: $pidlist)" for option in -R -rR ; do setup_testenv clone - log_must zfs destroy $option $FSSNAP - check_dataset datasetexists $CTR $FS $VOL - check_dataset datasetnonexists $FSSNAP $FSCLONE + + if is_linux; then + log_mustnot zfs destroy $option $FSSNAP + check_dataset datasetexists $CTR $FS $VOL $FSSNAP + check_dataset datasetnonexists $FSCLONE + else + log_must zfs destroy $option $FSSNAP + check_dataset datasetexists $CTR $FS $VOL + check_dataset datasetnonexists $FSSNAP $FSCLONE + fi done log_must kill $pidlist diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh index 05debb5a0..369029775 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_010_pos.ksh @@ -54,7 +54,7 @@ function test_clone_run clone=$(eval echo \$${dstype}CLONE) log_must zfs destroy -d $snap log_must datasetexists $snap - log_must zfs destroy -R $clone + log_must_busy zfs destroy -R $clone log_mustnot datasetexists $snap log_mustnot datasetexists $clone }