aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-08-14 20:31:32 +0300
committerZorro Lang <zlang@kernel.org>2023-08-19 02:47:13 +0800
commit6d63f23987a629b4f7dd6e57e5b67ba37a3b742e (patch)
treea5dd0941656320870be731683f786c28eaf175f1
parentd9b0c584e25b6ce34a3e5a0abe0ba65f52eb48d7 (diff)
downloadxfstests-dev-6d63f23987a629b4f7dd6e57e5b67ba37a3b742e.tar.gz
check: fix parsing expunge file with comments
commit 60054d51 ("check: fix excluded tests are only expunged in the first iteration") change to use exclude_tests array instead of file. The check if a test is in expunge file was using grep -q $TEST_ID FILE so it was checking if the test was a non-exact match to one of the lines, for a common example: "generic/001 # exclude this test" would be a match to test generic/001. The commit regressed this example, because the new code checks for exact match of [ "generic/001" == "generic/001 " ]. Change the code to match a regular expression to deal with this case and any other suffix correctly. NOTE that the original code would have matched test generic/100 with lines like "generic/1000" when we get to 4 digit seqnum, so the regular expression does an exact match to the first word of the line. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-xcheck4
1 files changed, 3 insertions, 1 deletions
diff --git a/check b/check
index 549725eb8d..71b9fbd075 100755
--- a/check
+++ b/check
@@ -592,7 +592,9 @@ _expunge_test()
local TEST_ID="$1"
for f in "${exclude_tests[@]}"; do
- if [ "${TEST_ID}" == "$f" ]; then
+ # $f may contain traling spaces and comments
+ local id_regex="^${TEST_ID}\b"
+ if [[ "$f" =~ ${id_regex} ]]; then
echo " [expunged]"
return 0
fi