diff options
author | candychencan <[email protected]> | 2016-09-22 04:51:53 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-21 13:51:53 -0700 |
commit | 84347be0986fc0ba99ebb577357328c1e3f50a68 (patch) | |
tree | 340ad13c06fcd9a5a374c2ae5b14e8a670aa6a39 | |
parent | 66e93f5e4e1a6c573fc57f9f76eb09c6cffd085e (diff) |
Fix zfs_destroy_001_pos.ksh
Due to how the Linux VFS was designed busy mount points
cannot be destroyed even when given the force option. Update
the zfs_destroy_001_pos test case to expect this behavior when
running under Linux.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: candychencan <[email protected]>
Closes #5132
-rw-r--r-- | tests/runfiles/linux.run | 7 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh | 25 |
2 files changed, 22 insertions, 10 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index b31724a2f..7d55a25a1 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -95,7 +95,6 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos', 'zfs_create_013_pos'] # DISABLED: -# zfs_destroy_001_pos - busy mountpoint behavior # zfs_destroy_005_neg - busy mountpoint behavior # zfs_destroy_008_pos - busy mountpoint behavior # zfs_destroy_009_pos - busy mountpoint behavior @@ -104,9 +103,9 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos', # zfs_destroy_012_pos - busy mountpoint behavior # zfs_destroy_013_neg - busy mountpoint behavior [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_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_006_neg', 'zfs_destroy_007_neg', + 'zfs_destroy_014_pos', 'zfs_destroy_015_pos', 'zfs_destroy_016_pos'] # DISABLED: # zfs_get_004_pos - nested pools diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh index 4aef51e0a..e942eaebf 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_destroy_001_pos.ksh @@ -126,7 +126,7 @@ function test_n_check "(pidlist: $pidlist)" [[ -z $pidlist ]] && \ log_fail "Failure from $MKBUSY" - log_must $ZFS destroy -rR $dtst + log_must_busy $ZFS destroy -rR $dtst log_must $ZFS snapshot $dtst fi ;; @@ -137,13 +137,24 @@ function test_n_check log_note "$MKBUSY $mpt_dir (pidlist: $pidlist)" [[ -z $pidlist ]] && \ log_fail "Failure from $MKBUSY" - log_must $ZFS destroy -rR $dtst - log_must $ZFS snapshot $dtst + if is_linux ; then + log_mustnot $ZFS destroy -rR $dtst + else + log_must $ZFS destroy -rR $dtst + log_must $ZFS snapshot $dtst + fi fi ;; *) log_fail "Unsupported dataset: '$dtst'." esac + # Kill any lingering instances of mkbusy, and clear the list. + if is_linux ; then + [[ -z $pidlist ]] || log_must $KILL -TERM $pidlist + pidlist="" + log_mustnot $PGREP -fl $MKBUSY + fi + # Firstly, umount ufs filesystem which was created by zfs volume. if is_global_zone; then log_must $UMOUNT -f $TESTDIR1 @@ -153,9 +164,11 @@ function test_n_check log_must $ZFS destroy $opt $dtst # Kill any lingering instances of mkbusy, and clear the list. - [[ -z $pidlist ]] || log_must $KILL -TERM $pidlist - pidlist="" - log_mustnot $PGREP -fl $MKBUSY + if ! is_linux ; then + [[ -z $pidlist ]] || log_must $KILL -TERM $pidlist + pidlist="" + log_mustnot $PGREP -fl $MKBUSY + fi case $dtst in $CTR) check_dataset datasetnonexists \ |