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]*\\))')
# 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()