summaryrefslogtreecommitdiff
path: root/test/py/u_boot_spawn.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-10-09 18:29:02 -0600
committerTom Rini <trini@konsulko.com>2024-10-15 10:24:27 -0600
commit681b8f86e4719ba4d8d0bd4f8b6be056277499f6 (patch)
tree5801cb9941e9774c9b693b5580f16f340a1c5444 /test/py/u_boot_spawn.py
parente4ad90149cee8e98d4a881ef535f50ef2cffa168 (diff)
test: Separate out the exception handling
The tests currently catch a very broad Exception in each case. This is thrown even in the event of a coding error. We want to handle exceptions differently depending on their severity, so that we can avoid hour-long delays waiting for a board that is clearly broken. As a first step, create some new exception types, separating out those which are simply an unexpected result from executed a command, from those which indicate some kind of hardware failure. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r--test/py/u_boot_spawn.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py
index 69a2cd55816..bcba7b5cd43 100644
--- a/test/py/u_boot_spawn.py
+++ b/test/py/u_boot_spawn.py
@@ -16,6 +16,17 @@ import traceback
class Timeout(Exception):
"""An exception sub-class that indicates that a timeout occurred."""
+class BootFail(Exception):
+ """An exception sub-class that indicates that a boot failure occurred.
+
+ This is used when a bad pattern is seen when waiting for the boot prompt.
+ It is regarded as fatal, to avoid trying to boot the again and again to no
+ avail.
+ """
+
+class Unexpected(Exception):
+ """An exception sub-class that indicates that unexpected test was seen."""
+
class Spawn:
"""Represents the stdio of a freshly created sub-process. Commands may be
sent to the process, and responses waited for.