Skip to content

Commit 2812eb2

Browse files
committed
improve formatting
Signed-off-by: Zen <[email protected]>
1 parent 1e1ea03 commit 2812eb2

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/ugrd/base/test.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,18 @@ def test_image(self):
100100
stdout = results.stdout.decode('utf-8').split('\r\n')
101101
self.logger.debug("QEMU output: %s", stdout)
102102

103-
if self['test_flag'] in stdout:
104-
self.logger.info("Test passed")
105-
else:
106-
self.logger.error("Test failed")
107-
self.logger.error("QEMU stdout:\n%s", stdout)
108-
109103
# Get the time of the kernel panic
110104
for line in stdout:
111105
if line.endswith('exitcode=0x00000000'):
112106
panic_time = line.split(']')[0][1:].strip()
113-
return self.logger.info("Test took: %s", panic_time)
114-
self.logger.warning("Unable to determine test duration from panic message.")
107+
self.logger.info("Test took: %s", panic_time)
108+
break
109+
else:
110+
self.logger.warning("Unable to determine test duration from panic message.")
115111

112+
if self['test_flag'] in stdout:
113+
self.logger.info("Test passed")
114+
else:
115+
self.logger.error("Test failed")
116+
self.logger.error("QEMU stdout:\n%s", stdout)
117+
raise RuntimeError("Test failed")

src/ugrd/initramfs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def run_tests(self) -> None:
244244
self.logger.debug("No tests executed.")
245245

246246
def _log_run(self, logline) -> None:
247-
self.logger.info(f"== | {logline}")
247+
self.logger.info(f"-- | {logline}")
248248

249249
def __str__(self) -> str:
250250
return str(self.config_dict)

0 commit comments

Comments
 (0)