Skip to content

Commit

Permalink
trunner: assert jffs2 via output instead of time
Browse files Browse the repository at this point in the history
JIRA: CI-375
  • Loading branch information
maska989 committed Oct 25, 2023
1 parent a37c915 commit 290f7d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 13 additions & 3 deletions trunner/harness/plo.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,24 @@ def erase(self, device: str, offset: int, size: int, timeout: Optional[int] = No
e.cmd = cmd
raise e

def jffs2(self, device: str, erase: bool, cleanmarkers: PloJffs2CleanmarkerSpec, timeout: Optional[int] = None):
def jffs2(self, device: str, erase: bool, cleanmarkers: PloJffs2CleanmarkerSpec, timeout: int):
"""Performs jffs2 command."""

block_count = cleanmarkers.number_of_blocks

cmd = f"jffs2 -d {device} -c {cleanmarkers}"
if erase:
cmd += " -e"

self.cmd(cmd, timeout)
self.send_cmd(cmd)

for i in range(0, block_count):
try:
self.dut.expect(f"(jffs2: block {i}/{block_count})", timeout=timeout) == 0
except pexpect.TIMEOUT as e:
raise PloError("\nWrong jffs2 command output!", cmd=cmd, output=self.dut.before) from e

self._assert_prompt()

def app(
self, device: str, file: str, imap: str, dmap: str, exec: bool = False
Expand Down Expand Up @@ -220,7 +230,7 @@ class PloJffsImageProperty(PloImageProperty):

flash_device_id: str
cleanmarkers_args: PloJffs2CleanmarkerSpec
timeout: int
timeout: Optional[int] = 1


class PloImageLoader(TerminalHarness, PloInterface):
Expand Down
1 change: 0 additions & 1 deletion trunner/target/armv7a9.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class Zynq7000ZedboardTarget(ARMv7A9Target):
block_size=0x10000,
cleanmarker_size=0x10,
),
timeout=140,
)
name = "armv7a9-zynq7000-zedboard"

Expand Down

0 comments on commit 290f7d2

Please sign in to comment.