diff --git a/trunner/harness/psh.py b/trunner/harness/psh.py index faab06a3d..a0f0cd401 100644 --- a/trunner/harness/psh.py +++ b/trunner/harness/psh.py @@ -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!",