@@ -104,44 +104,6 @@ CRB004.201 Slot A Protection (Ubuntu)
104104
105105
106106*** Keywords ***
107- Verify Region Range Protected
108- [Arguments] ${region_name } ${expected_start } ${expected_end }
109- ${readonly_regions } = Get Flashrom Readonly Offsets
110- IF len(${readonly_regions } ) == 0
111- Fail No readonly regions found in flashrom output
112- END
113-
114- ${expected_readonly_bootblock } = Calculate Expected Flashrom Readonly Region
115- ... region_name=${region_name }
116- ... start_offset=${expected_start }
117- ... end_offset=${expected_end }
118-
119- VAR ${expected_readonly_found } = ${FALSE }
120- FOR ${region } IN @{readonly_regions }
121- Log To Console Found readonly region: ${region }
122- Log To Console Expected readonly region: ${expected_readonly_bootblock }
123- ${start_matches } = Evaluate int(${region['start'] } ) == int(${expected_readonly_bootblock['start'] } )
124- ${end_matches } = Evaluate int(${region['end'] } ) == int(${expected_readonly_bootblock['end'] } )
125- IF ${start_matches } and ${end_matches }
126- VAR ${expected_readonly_found } = ${TRUE }
127- BREAK
128- END
129- END
130- IF not ${expected_readonly_found }
131- Fail Expected readonly region ${expected_readonly_bootblock } not found in flashrom output
132- END
133-
134- Calculate Expected Flashrom Readonly Region
135- [Arguments] ${region_name } ${start_offset } ${end_offset }
136- ${flashrom_regions } = Get Flashrom Regions
137- ${bios_start } = Get From Dictionary ${flashrom_regions['${region_name }'] } start
138- ${bios_end } = Get From Dictionary ${flashrom_regions['${region_name }'] } end
139- ${expected_readonly_start } = Evaluate hex(${bios_start } + ${COREBOOT_REDUNDANT_BOOT_BOOTBLOCK_OFFSET.start } )
140- ${expected_readonly_end } = Evaluate hex(${bios_start } + ${COREBOOT_REDUNDANT_BOOT_BOOTBLOCK_OFFSET.end } )
141- ${expected_readonly } = Create Dictionary start=${expected_readonly_start } end=${expected_readonly_end }
142- RETURN ${expected_readonly }
143-
144-
145107Set Attempt Slot B Flag
146108 [Arguments] ${state } =${TRUE }
147109 IF ${state }
@@ -161,29 +123,3 @@ Should Have Booted From Slot
161123 ${out } = Convert To Lower Case ${out }
162124 ${out } = Strip String ${out }
163125 Should Contain ${out } ${slot }
164-
165- Get Flashrom Regions
166- ${output } = Execute Command In Terminal flashrom -p internal
167- ${lines } = Split To Lines ${output }
168- ${dict } = Create Dictionary
169- FOR ${l } IN @{lines }
170- ${m } = Get Regexp Matches ${l } FREG[0-9]+: (.+) region \\((0x[0-9a-f]+)-(0x[0-9a-f]+)\\) is (.+) 1 2 3 4
171- IF ${m } != []
172- ${region } = Create Dictionary start=${m[0][1] } end=${m[0][2] } state=${m[0][3] }
173- Set To Dictionary ${dict } ${m[0][0] } =${region }
174- END
175- END
176- RETURN ${dict }
177-
178- Get Flashrom Readonly Offsets
179- ${output } = Execute Command In Terminal flashrom -p internal
180- ${lines } = Split To Lines ${output }
181- ${list } = Create List
182- FOR ${l } IN @{lines }
183- ${m } = Get Regexp Matches ${l } Warning: (0x[0-9a-f]+)-(0x[0-9a-f]+) is read-only 1 2
184- IF ${m } != []
185- ${region } = Create Dictionary start=${m[0][0] } end=${m[0][1] }
186- Append To List ${list } ${region }
187- END
188- END
189- RETURN ${list }
0 commit comments