Skip to content

Commit

Permalink
rh_kselftests_vm.mm: updates the pattern based on the guest OS version
Browse files Browse the repository at this point in the history
The output of the selftests changes, for RHEL 8 versions, it
seems to not contain hastags '#' at the beggining of each line.
Opportunistically, increase the RPM download timeout.

Signed-off-by: mcasquer <mcasquer@redhat.com>
  • Loading branch information
mcasquer committed Feb 12, 2025
1 parent 879c7d7 commit 3465091
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions qemu/tests/cfg/rh_kselftests_vm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
kselftests_path = "/usr/libexec/kselftests"
variants:
- mm:
summary_pattern = "\# SUMMARY.+"
RHEL.8:
summary_pattern = "SUMMARY.+"
s390x:
kvm_module_parameters = 'hpage=1'
whitelist = "hugetlb_fault_after_madv"
Expand Down
9 changes: 5 additions & 4 deletions qemu/tests/rh_kselftests_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(test, params, env):
session.cmd("cd %s" % kernel_path)
session.cmd(
"brew download-build --rpm kernel-selftests-internal-%s.rpm" % kernel_version,
180,
240,
)

error_context.context("Install the RPM", test.log.debug)
Expand All @@ -41,14 +41,15 @@ def run(test, params, env):
s, o = session.cmd_status_output(tests_execution_cmd, 180)
test.log.info("The selftests results: %s", o)

summary = re.findall(r"\# SUMMARY.+", o)
num_failed_tests = int(re.findall(r"FAIL\=\d+", str(summary))[0].split("=")[1])
fail_match = re.search(r"SUMMARY:.+FAIL=(?P<fail>\d+?)", o)
num_failed_tests = int(fail_match.group("fail"))
test.log.debug("Number of failed tests: %d", num_failed_tests)

if num_failed_tests != 0:
test.fail("Failed selftests found in the execution")

num_skipped_tests = int(re.findall(r"SKIP\=\d+", str(summary))[0].split("=")[1])
skip_match = re.search(r"SUMMARY:.+SKIP=(?P<skip>\d+?)", o)
num_skipped_tests = int(skip_match.group("skip"))
test.log.debug("Number of skipped tests: %d", num_skipped_tests)

skipped_list = []
Expand Down

0 comments on commit 3465091

Please sign in to comment.