-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-sbsa.py
executable file
·100 lines (76 loc) · 3.2 KB
/
check-sbsa.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/python3
import bsa
def check_tag(tag, failed):
try:
for bsa_test_id in tags_to_tests[tag]["bsa"]:
if bsa_test_id not in checked_tests["bsa"]:
checked_tests["bsa"].append(bsa_test_id)
# if 'ignore_skipped' is set then we can ignore that test
# when it gets skipped
# - no NS EL2-Virt timer on v8.0 cpus
# - LPA on non-LPA cpus
# - 16550 UART
if ('ignore_skipped' in status_bsa[bsa_test_id] and
status_bsa[bsa_test_id]['status'][cpu] == "SKIPPED"):
continue
if status_bsa[bsa_test_id]['status'][cpu] not in ["PASS"]:
print(f"- BSA test {bsa_test_id} for "
f"{status_bsa[bsa_test_id]['tags']} "
f"({status_bsa[bsa_test_id]['title']}) "
f"failed")
failed = True
for sbsa_test_id in tags_to_tests[tag]["sbsa"]:
if sbsa_test_id not in checked_tests["sbsa"]:
checked_tests["sbsa"].append(sbsa_test_id)
if status_sbsa[sbsa_test_id]['status'][cpu] in ["FAIL"]:
print(f"- SBSA test {sbsa_test_id} for "
f"{status_sbsa[sbsa_test_id]['tags']} "
f"({status_sbsa[sbsa_test_id]['title']}) failed")
failed = True
except KeyError:
pass
return failed
def check_sbsa_level(cpu, level, previous_level_result):
failed = previous_level_result
print(f"Checking SBSA level {level} for {cpu}")
for category in xbsa_checklist:
for group in xbsa_checklist[category]["groups"]:
for rule in xbsa_checklist[category]["groups"][group]["rules"]:
if rule["required"]["sbsa"] != None:
if level in rule["required"]["sbsa"]:
failed = check_tag(rule["tag"], failed)
if not failed:
print(f"SBSA level {level} for {cpu}: no failures found")
return failed
# some tests lists several tags and we do want to show it once
checked_tests = {"bsa": [], "sbsa": []}
status_bsa, status_sbsa, xbsa_checklist = bsa.load_yamls()
tags_to_tests = bsa.create_map_tags_to_tests(status_bsa, status_sbsa)
# SBSA Level 3 requires Arm v8.0
# SBSA Level 4 requires Arm v8.3
# SBSA Level 5 requires Arm v8.4
# SBSA Level 6 requires Arm v8.5/9.0
# SBSA Level 7 requires Arm v8.6/9.1
cpus = {
# "core name": sbsa level
"cortex-a57": 3,
"cortex-a72": 3,
"neoverse-n1": 3,
"neoverse-v1": 5,
"neoverse-n2": 6,
"max": 99 }
for cpu in cpus:
level_result = False
info_given = False
checked_tests["bsa"].clear()
checked_tests["sbsa"].clear()
for level in range(3, 8):
if (cpus[cpu] < level):
if not info_given:
print(f"{cpu} is too old for SBSA level {level} and above")
info_given = True
continue
level_result = check_sbsa_level(cpu, level, level_result)
print("")
print("------------------------------------------------"
"------------------------------------------------")