mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
test: Check exit status in run_and_log_expect_exception()
This check was missed. Add it and make the message more verbose.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
Fixes: 9e17b034
(test/py: Provide a way to check that a command fails)
This commit is contained in:
parent
bcbd0c8fe1
commit
7f64b1874c
2 changed files with 5 additions and 1 deletions
|
@ -201,9 +201,11 @@ def run_and_log_expect_exception(u_boot_console, cmd, retcode, msg):
|
|||
runner = u_boot_console.log.get_runner(cmd[0], sys.stdout)
|
||||
runner.run(cmd)
|
||||
except Exception as e:
|
||||
assert(retcode == runner.exit_status)
|
||||
assert(msg in runner.output)
|
||||
else:
|
||||
raise Exception('Expected exception, but not raised')
|
||||
raise Exception("Expected an exception with retcode %d message '%s',"
|
||||
"but it was not raised" % (retcode, msg))
|
||||
finally:
|
||||
runner.close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue