From 47b2e809e8c8ae627c5c5f17acc4fd96229e0be7 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 30 Dec 2022 14:12:53 -0800 Subject: [PATCH] fuzzy: rework scrub stress output filtering Rework the output filtering functions for scrub stress tests: first, we should use _filter_scratch to avoid leaking the scratch fs details to the output. Second, for scrub and repair, change the filter elements to reflect outputs that don't indicate failure (such as busy resources, preening requests, and insufficient space to do anything). Finally, change the _require function to check that filter functions have been sourced. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- common/fuzzy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index e5283156..94a6ce85 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -323,14 +323,19 @@ _scratch_xfs_fuzz_metadata() { # Filter freeze and thaw loop output so that we don't tarnish the golden output # if the kernel temporarily won't let us freeze. __stress_freeze_filter_output() { - grep -E -v '(Device or resource busy|Invalid argument)' + _filter_scratch | \ + sed -e '/Device or resource busy/d' \ + -e '/Invalid argument/d' } # Filter scrub output so that we don't tarnish the golden output if the fs is # too busy to scrub. Note: Tests should _notrun if the scrub type is not # supported. __stress_scrub_filter_output() { - grep -E -v '(Device or resource busy|Invalid argument)' + _filter_scratch | \ + sed -e '/Device or resource busy/d' \ + -e '/Optimization possible/d' \ + -e '/No space left on device/d' } # Run fs freeze and thaw in a tight loop. @@ -369,6 +374,8 @@ _require_xfs_stress_scrub() { _require_xfs_io_command "scrub" _require_command "$KILLALL_PROG" killall _require_freeze + command -v _filter_scratch &>/dev/null || \ + _notrun 'xfs scrub stress test requires common/filter' } # Make sure we have everything we need to run stress and online repair -- 2.39.5