Skip to content

Commit

Permalink
twister: treat imgtool image exceeded as flash overflow
Browse files Browse the repository at this point in the history
Twister detects FLASH overflow and skips tests that trigger that
condition by default, but sometimes images are just on the flash size
limit and then overflows at a later stage when imgtool adds a trailer,
which gets detected as a build fail and fails the run.

This detects the imgtool flash overflow together with the normal build
ones, causing the build to be skipped on imgtool flash overflow as well.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri committed Sep 20, 2022
1 parent 9926b90 commit 5598286
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/pylib/twister/twisterlib/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,14 @@ def run_build(self, args=[]):

if log_msg:
overflow_found = re.findall("region `(FLASH|ROM|RAM|ICCM|DCCM|SRAM|dram0_1_seg)' overflowed by", log_msg)
imgtool_overflow_found = re.findall(r"Error: Image size \(.*\) \+ trailer \(.*\) exceeds requested size", log_msg)
if overflow_found and not self.options.overflow_as_errors:
logger.debug("Test skipped due to {} Overflow".format(overflow_found[0]))
self.instance.status = "skipped"
self.instance.reason = "{} overflow".format(overflow_found[0])
elif imgtool_overflow_found and not self.options.overflow_as_errors:
self.instance.status = "skipped"
self.instance.reason = "imgtool overflow"
else:
self.instance.status = "error"
self.instance.reason = "Build failure"
Expand Down

0 comments on commit 5598286

Please sign in to comment.