diff options
author | Tom Rini <trini@konsulko.com> | 2024-07-04 09:25:51 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-07-04 09:25:51 -0600 |
commit | e24053d8fb42c909b470e33f19ac71fd718133ce (patch) | |
tree | b69fd2a2ee983403d9ea52b928632dbac3eaff03 /test/py/u_boot_spawn.py | |
parent | 0f073e022ddc5070e5df1d053e4bdc1874fbcc0f (diff) | |
parent | 4a8a54c3f4202482ec4f24a117afc38cf2c0c051 (diff) |
Merge patch series "testb: Various tweaks and fixes for Labgrid"
Simon Glass <sjg@chromium.org> says:
This series includes a number of mostly unrelated changes which are in
service of running U-Boot on a lab using Labgrid.
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r-- | test/py/u_boot_spawn.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 7c48d96210e..97e95e07c80 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -24,18 +24,20 @@ class Spawn: output: accumulated output from expect() """ - def __init__(self, args, cwd=None): + def __init__(self, args, cwd=None, decode_signal=False): """Spawn (fork/exec) the sub-process. Args: args: array of processs arguments. argv[0] is the command to execute. cwd: the directory to run the process in, or None for no change. + decode_signal (bool): True to indicate the exception number when + something goes wrong Returns: Nothing. """ - + self.decode_signal = decode_signal self.waited = False self.exit_code = 0 self.exit_info = '' @@ -197,12 +199,12 @@ class Spawn: # With sandbox, try to detect when U-Boot exits when it # shouldn't and explain why. This is much more friendly than # just dying with an I/O error - if err.errno == 5: # Input/output error + if self.decode_signal and err.errno == 5: # I/O error alive, _, info = self.checkalive() if alive: raise err raise ValueError('U-Boot exited with %s' % info) - raise err + raise if self.logfile_read: self.logfile_read.write(c) self.buf += c |