From de099c81b5e47ab3869a5d2733595471e359b2a3 Mon Sep 17 00:00:00 2001 From: Chetan Singh Date: Tue, 3 Mar 2026 15:39:30 +0530 Subject: [PATCH] (dt) : add parser support for capsule ondisk var test * add new capsule on disk var test support in json and html * make overall results string consistent for all cases in python script Change-Id: Ic168c615371a0569250908b590f2ddda99134505 --- .../capsule_ondisk_reporting_vars_check.py | 6 ++-- .../standalone_tests/logs_to_json.py | 32 ++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/common/linux_scripts/capsule_ondisk_reporting_vars_check.py b/common/linux_scripts/capsule_ondisk_reporting_vars_check.py index 7c9a3879..5fe5069e 100755 --- a/common/linux_scripts/capsule_ondisk_reporting_vars_check.py +++ b/common/linux_scripts/capsule_ondisk_reporting_vars_check.py @@ -369,7 +369,8 @@ def main(): log("================================================================================================") if not os.path.isdir(EFIVAR_PATH): - log(f"RESULTS: {EFIVAR_PATH} not present. Please ensure efivarfs is enabled and mounted - WARNING") + log(f"INFO: {EFIVAR_PATH} not present. Please ensure efivarfs is enabled and mounted - WARNING") + log("RESULTS: Overall Capsule On-Disk Update Reporting Variables Result: WARNING") return 1 on_disk_supported, os_indications_value = os_indications_supports_ondisk() @@ -379,7 +380,8 @@ def main(): log(f"INFO: OsIndicationsSupported value: 0x{os_indications_value:X}") if not on_disk_supported: - log("RESULTS: Capsule on-disk reporting variables test is not applicable - SKIPPED") + log("INFO: Capsule on-disk reporting variables test is not applicable - SKIPPED") + log("RESULTS: Overall Capsule On-Disk Update Reporting Variables Result: SKIPPED") return 2 log("INFO: OsIndicationsSupported indicates capsule on-disk support; running recommended checks") diff --git a/common/log_parser/standalone_tests/logs_to_json.py b/common/log_parser/standalone_tests/logs_to_json.py index fd0b34b2..672c56fa 100755 --- a/common/log_parser/standalone_tests/logs_to_json.py +++ b/common/log_parser/standalone_tests/logs_to_json.py @@ -728,6 +728,8 @@ def read_file_lines(path, encoding='utf-8'): def add_subtest(desc, status, reason=""): nonlocal subtest_number + if status.lower() == "warning": + status = "WARNINGS" sub = create_subtest(subtest_number, desc, status, reason) current_test["subtests"].append(sub) update_suite_summary(current_test["test_suite_summary"], status) @@ -822,7 +824,8 @@ def add_subtest(desc, status, reason=""): line = results_lines[i].strip() sanity_match = re.match(r"Testing\s+signed_capsule\.bin\s+sanity", line, re.IGNORECASE) esrt_match = re.match(r"(Testing|Test:\s+Testing)\s+ESRT\s+FW\s+version\s+update", line, re.IGNORECASE) - + capsule_ondisk_match = re.match(r"(Testing|Test:\s+Testing)\s+Capsule\s+On\s*-\s*Disk\s+Update\s+Reporting\s+Variables", + line, re.IGNORECASE) if sanity_match: test_desc = line test_info = "" @@ -882,6 +885,33 @@ def add_subtest(desc, status, reason=""): else: result = "FAILED" if any_failed else "PASSED" add_subtest(test_desc, result, reason=test_info_lines) + + elif capsule_ondisk_match: + test_desc = "Testing Capsule On-Disk Update Reporting Variables" + test_info_lines = [] + result = "FAILED" + i += 2 + overall_re = re.compile( + r"^RESULTS:\s*Overall\s+Capsule\s+On\-Disk\s+Update\s+Reporting\s+Variables\s+Result\s*:\s*([A-Za-z_]+)\b", + re.IGNORECASE) + + prefix_re = re.compile(r"^(INFO|RESULTS):\s*", re.IGNORECASE) + while i < len(results_lines): + cur_raw = results_lines[i].rstrip("\n") + cur = cur_raw.strip() + + m = overall_re.match(cur) + if m: + # include the overall line in the captured block (optional) + test_info_lines.append(prefix_re.sub("", cur_raw.strip())) + result = m.group(1).upper() + break + # capture everything in the block + cleaned = prefix_re.sub("", cur_raw.strip()) + test_info_lines.append(cleaned) + i += 1 + add_subtest(test_desc, result, reason=test_info_lines) + i += 1 # >>> REMOVE EMPTY REASON ARRAYS <<<