diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-11-15 11:29:29 -0500 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2021-11-21 22:58:57 +0800 |
commit | 2d5e3202bb9389811d7fd3c6cdfa2bfd7da2a4a1 (patch) | |
tree | 0da7dab62bb413ce8dea1d6c7f6bed021b84218b | |
parent | 78c4d738fe365f186ff6795c68244a08037afcc5 (diff) | |
download | xfstests-dev-2d5e3202bb9389811d7fd3c6cdfa2bfd7da2a4a1.tar.gz |
fstests: detect btrfs compression and disable certain tests
Our nightly xfstests runs exposed a set of tests that always fail if we
have compression enabled. This is because compression obviously messes
with the amount of data space allocated on disk, and these tests are
testing either that quota is doing the correct thing, or that we're able
to completely fill the file system.
Add a helper to check to see if we have any of our compression related
mount options set and simply _not_run for these specific tests.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r-- | common/btrfs | 7 | ||||
-rw-r--r-- | common/rc | 11 | ||||
-rwxr-xr-x | tests/btrfs/126 | 4 | ||||
-rwxr-xr-x | tests/btrfs/139 | 4 | ||||
-rwxr-xr-x | tests/btrfs/230 | 4 | ||||
-rwxr-xr-x | tests/btrfs/232 | 4 | ||||
-rwxr-xr-x | tests/btrfs/237 | 4 | ||||
-rwxr-xr-x | tests/generic/275 | 4 | ||||
-rwxr-xr-x | tests/generic/427 | 4 |
9 files changed, 46 insertions, 0 deletions
diff --git a/common/btrfs b/common/btrfs index cd053d3b28..fe5985663a 100644 --- a/common/btrfs +++ b/common/btrfs @@ -113,6 +113,13 @@ _require_btrfs_fs_sysfs() } +_require_btrfs_no_compress() +{ + if _normalize_mount_options | grep -q "compress"; then + _notrun "This test requires no compression enabled" + fi +} + _check_btrfs_filesystem() { device=$1 @@ -1687,6 +1687,17 @@ _require_scratch_nolvm() [ $? -eq 0 ] && _notrun "test requires a non-lvm scratch device" } +_require_no_compress() +{ + case "$FSTYP" in + btrfs) + _require_btrfs_no_compress + ;; + *) + ;; + esac +} + # we need the scratch device and it should be checked post test. _require_scratch() { diff --git a/tests/btrfs/126 b/tests/btrfs/126 index a13a0a6e8e..2b0edb65b4 100755 --- a/tests/btrfs/126 +++ b/tests/btrfs/126 @@ -19,6 +19,10 @@ _supported_fs btrfs _require_scratch _require_btrfs_qgroup_report +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + _scratch_mkfs >/dev/null # Use enospc_debug mount option to trigger restrict space info check _scratch_mount "-o enospc_debug" diff --git a/tests/btrfs/139 b/tests/btrfs/139 index 7760182aa4..c4b09f9fc1 100755 --- a/tests/btrfs/139 +++ b/tests/btrfs/139 @@ -19,6 +19,10 @@ _supported_fs btrfs # We at least need 2GB of free space on $SCRATCH_DEV _require_scratch_size $((2 * 1024 * 1024)) +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/230 b/tests/btrfs/230 index 2daacfbeeb..46b0c63693 100755 --- a/tests/btrfs/230 +++ b/tests/btrfs/230 @@ -17,6 +17,10 @@ _begin_fstest auto quick qgroup limit _supported_fs btrfs +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + # Need at least 2GiB _require_scratch_size $((2 * 1024 * 1024)) _scratch_mkfs > /dev/null 2>&1 diff --git a/tests/btrfs/232 b/tests/btrfs/232 index 8691a508d3..02c7e49de8 100755 --- a/tests/btrfs/232 +++ b/tests/btrfs/232 @@ -33,6 +33,10 @@ writer() _supported_fs btrfs +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + _require_scratch_size $((2 * 1024 * 1024)) _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/237 b/tests/btrfs/237 index 5994edf8b1..5168777ee1 100755 --- a/tests/btrfs/237 +++ b/tests/btrfs/237 @@ -24,6 +24,10 @@ _require_btrfs_command filesystem sync _require_command "$BLKZONE_PROG" blkzone _require_zoned_device "$SCRATCH_DEV" +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + get_data_bg() { $BTRFS_UTIL_PROG inspect-internal dump-tree -t CHUNK $SCRATCH_DEV |\ diff --git a/tests/generic/275 b/tests/generic/275 index bf0aa2b380..6189edca2f 100755 --- a/tests/generic/275 +++ b/tests/generic/275 @@ -25,6 +25,10 @@ _cleanup() _supported_fs generic _require_scratch +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + echo "------------------------------" echo "write until ENOSPC test" echo "------------------------------" diff --git a/tests/generic/427 b/tests/generic/427 index 0f99c1b271..26385d36e1 100755 --- a/tests/generic/427 +++ b/tests/generic/427 @@ -22,6 +22,10 @@ _require_scratch _require_test_program "feature" _require_aiodio aio-dio-eof-race +# This test requires specific data space usage, skip if we have compression +# enabled. +_require_no_compress + # limit the filesystem size, to save the time of filling filesystem _scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 _scratch_mount |