]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: Tidy up remaining exceptions
authorSimon Glass <sjg@chromium.org>
Thu, 10 Oct 2024 00:29:04 +0000 (18:29 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 15 Oct 2024 16:24:27 +0000 (10:24 -0600)
Use the new handle_exception() function from ConsoleBase also.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/py/u_boot_console_base.py

index 0be6c760206f9fd80bc6a770c4f5e2ee7c3488e6..aebe0dac0998aa4a5e29c4f8200bf1c5fa4b2fae 100644 (file)
@@ -14,7 +14,7 @@ import pytest
 import re
 import sys
 import u_boot_spawn
-from u_boot_spawn import BootFail, Timeout, Unexpected
+from u_boot_spawn import BootFail, Timeout, Unexpected, handle_exception
 
 # Regexes for text we expect U-Boot to send to the console.
 pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
@@ -293,12 +293,12 @@ class ConsoleBase(object):
             # indentation.
             return self.p.before.strip('\r\n')
         except Timeout as exc:
-            self.log.error(str(exc))
-            self.cleanup_spawn()
+            handle_exception(self.config, self, self.log, exc, 'Lab failure',
+                             True)
             raise
-        except BootFail as ex:
-            self.log.error(str(ex))
-            self.cleanup_spawn()
+        except BootFail as exc:
+            handle_exception(self.config, self, self.log, exc, 'Boot fail',
+                             True, self.get_spawn_output())
             raise
         finally:
             self.log.timestamp()