Skip to content

Commit

Permalink
trunner: add capability to assert sending long commands due to ash li…
Browse files Browse the repository at this point in the history
…ne wrap up

JIRA: CI-307
  • Loading branch information
adamdebek committed Dec 6, 2023
1 parent 5eb8dc1 commit 9193843
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fs_mark/fs_mark_clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ int remove_dir_recursive(const char *dirPath)
return -1;
}
}

return ret;
}

int main(int argc, char **argv)
Expand Down
10 changes: 9 additions & 1 deletion trunner/harness/psh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ def __call__(self, result: TestResult) -> TestResult:
if self.cmd is not None:
self.dut.send(self.cmd + "\n")
try:
self.dut.expect(f"{self.cmd}(\r+)\n")
# ash wraps up lines longer than 80 characters
if len(self.cmd) <= 80 - len(self.prompt):
self.dut.expect(f"{self.cmd}(\r+)\n")
else:
full_cmd = ""
while full_cmd not in self.cmd:
self.dut.expect("(\r+)\n")
full_cmd += self.dut.before

except (pexpect.TIMEOUT, pexpect.EOF) as e:
raise ShellError(
msg="Couldn't find the echoed command!",
Expand Down

0 comments on commit 9193843

Please sign in to comment.