Skip to content

Commit 241be9a

Browse files
roxellnuclearcat
authored andcommitted
automated: linux: kselftest: filter skip entries by subsuite
When running a subset of kselftest suites (e.g. kselftest-mm), the existing skipfile logic still applies all entries from skipfile-lkft.yaml, including those unrelated to the selected subsuites. As a result, irrelevant tests (such as those from the breakpoints suite) appear as "skip" in result.json, even though they were not part of the test run. To ensure accurate skip handling, the logic has been updated so that skip entries only apply to tests within the subsuites selected for the current run. Each skip entry is parsed to extract the subsuite name, which is then compared against the entries in TST_CMDFILES. Skip rules are applied only when a match is found, preventing unrelated tests from appearing as "skipped" in the results. This avoids polluting results with unrelated test cases and makes skips more accurate and meaningful. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
1 parent a2d522d commit 241be9a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

automated/linux/kselftest/kselftest.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,18 @@ cp kselftest-list.txt kselftest-list.txt.orig
189189
echo "skiplist:"
190190
echo "========================================"
191191
while read -r skip_regex; do
192-
echo "$skip_regex"
193-
# Remove matching tests from list of tests to run and report it as skipped
194-
perl -i -ne 'if (s|^('"${skip_regex}"')$|\1 skip|) { print STDERR; } else { print; }' kselftest-list.txt 2>>"${RESULT_FILE}"
192+
subsuite="${skip_regex%%:*}"
193+
194+
# Loop through each subsuite in TST_CMDFILES and compare
195+
for selected in ${TST_CMDFILES}; do
196+
if [ "${subsuite}" = "${selected}" ]; then
197+
echo "$skip_regex"
198+
# Remove matching tests from list of tests to run and report it as skipped
199+
perl -i -ne 'if (s|^('"${skip_regex}"')$|\1 skip|) { print STDERR; } else { print; }' \
200+
kselftest-list.txt 2>>"${RESULT_FILE}"
201+
break
202+
fi
203+
done
195204
done < "${skips}"
196205
echo "========================================"
197206
rm -f "${skips}"

0 commit comments

Comments
 (0)