Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions common/linux_scripts/capsule_ondisk_reporting_vars_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
Expand Down
32 changes: 31 additions & 1 deletion common/log_parser/standalone_tests/logs_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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 <<<
Expand Down