diff options
| -rw-r--r-- | meta/lib/oeqa/core/target/ssh.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py index 8b5c450a05..0ac3ae4388 100644 --- a/meta/lib/oeqa/core/target/ssh.py +++ b/meta/lib/oeqa/core/target/ssh.py | |||
| @@ -55,7 +55,7 @@ class OESSHTarget(OETarget): | |||
| 55 | def stop(self, **kwargs): | 55 | def stop(self, **kwargs): |
| 56 | pass | 56 | pass |
| 57 | 57 | ||
| 58 | def _run(self, command, timeout=None, ignore_status=True, raw=False): | 58 | def _run(self, command, timeout=None, ignore_status=True, raw=False, ignore_ssh_fails=False): |
| 59 | """ | 59 | """ |
| 60 | Runs command in target using SSHProcess. | 60 | Runs command in target using SSHProcess. |
| 61 | """ | 61 | """ |
| @@ -66,13 +66,17 @@ class OESSHTarget(OETarget): | |||
| 66 | self.logger.debug("[Command returned '%d' after %.2f seconds]" | 66 | self.logger.debug("[Command returned '%d' after %.2f seconds]" |
| 67 | "" % (status, time.time() - starttime)) | 67 | "" % (status, time.time() - starttime)) |
| 68 | 68 | ||
| 69 | if status and not ignore_status: | 69 | if status == 255 and not ignore_ssh_fails: |
| 70 | raise AssertionError("ssh exited with status '255' for command " | ||
| 71 | "'%s': this is likely an SSH failure\n%s" | ||
| 72 | % (command, output)) | ||
| 73 | elif status and not ignore_status: | ||
| 70 | raise AssertionError("Command '%s' returned non-zero exit " | 74 | raise AssertionError("Command '%s' returned non-zero exit " |
| 71 | "status %d:\n%s" % (command, status, output)) | 75 | "status %d:\n%s" % (command, status, output)) |
| 72 | 76 | ||
| 73 | return (status, output) | 77 | return (status, output) |
| 74 | 78 | ||
| 75 | def run(self, command, timeout=None, ignore_status=True, raw=False): | 79 | def run(self, command, timeout=None, ignore_status=True, raw=False, ignore_ssh_fails=False): |
| 76 | """ | 80 | """ |
| 77 | Runs command in target. | 81 | Runs command in target. |
| 78 | 82 | ||
| @@ -91,7 +95,7 @@ class OESSHTarget(OETarget): | |||
| 91 | else: | 95 | else: |
| 92 | processTimeout = self.timeout | 96 | processTimeout = self.timeout |
| 93 | 97 | ||
| 94 | status, output = self._run(sshCmd, processTimeout, ignore_status, raw) | 98 | status, output = self._run(sshCmd, processTimeout, ignore_status, raw, ignore_ssh_fails) |
| 95 | if len(output) > (64 * 1024): | 99 | if len(output) > (64 * 1024): |
| 96 | self.logger.debug('Command: %s\nStatus: %d Output length: %s\n' % (command, status, len(output))) | 100 | self.logger.debug('Command: %s\nStatus: %d Output length: %s\n' % (command, status, len(output))) |
| 97 | else: | 101 | else: |
