From 709aa5a567b5f1b9cfd5e16517b39c10e9550f7a Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Tue, 14 Oct 2025 10:48:33 +0200 Subject: [PATCH 1/2] [ot] python/qemu: ot.pyot: fix up some typos Signed-off-by: Emmanuel Blot --- python/qemu/ot/pyot/executer.py | 4 ++-- python/qemu/ot/pyot/qemu/executer.py | 2 +- python/qemu/ot/pyot/worker.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/qemu/ot/pyot/executer.py b/python/qemu/ot/pyot/executer.py index aeb975d88855a..848f2a7f74bde 100644 --- a/python/qemu/ot/pyot/executer.py +++ b/python/qemu/ot/pyot/executer.py @@ -257,7 +257,7 @@ def run(self, debug: bool, allow_no_test: bool) -> int: self._log.info('%s count: %d', self.RESULT_MAP.get(kind, kind), results[kind]) - # sort by the largest occurence, discarding success + # sort by the largest occurrence, discarding success errors = sorted((x for x in results.items() if x[0] > 0), key=lambda x: -x[1]) # overall return code is the most common error, or success otherwise @@ -307,7 +307,7 @@ def _cleanup_temp_files(self, storage: dict[str, set[str]]) -> None: def _build_command(self, args: Namespace, opts: Optional[list[str]] = None) -> EasyDict[str, Any]: - raise NotImplementedError('Abstact command') + raise NotImplementedError('Abstract command') def _build_test_command(self, filename: str) -> EasyDict[str, Any]: test_name = self.get_test_radix(filename) diff --git a/python/qemu/ot/pyot/qemu/executer.py b/python/qemu/ot/pyot/qemu/executer.py index d1b5e994e2887..94e329f6f9f2f 100644 --- a/python/qemu/ot/pyot/qemu/executer.py +++ b/python/qemu/ot/pyot/qemu/executer.py @@ -103,7 +103,7 @@ def _build_fw_args(self, args: Namespace) \ else: if xtype != 'elf': raise ValueError(f'No support for test type: ' - f'{xtype.upper()}') + f'{xtype.upper()} for {exec_path}') if rom_exec: # generate ROM option(s) for the application itself for chip in range(chiplet_count): diff --git a/python/qemu/ot/pyot/worker.py b/python/qemu/ot/pyot/worker.py index 08e35b66b9e00..15bdbefb5558c 100644 --- a/python/qemu/ot/pyot/worker.py +++ b/python/qemu/ot/pyot/worker.py @@ -63,11 +63,11 @@ def command(self) -> str: return normpath(self._cmd.split(' ', 1)[0]) @property - def first_error(self): + def first_error(self) -> str: """Return the message of the first error, if any.""" return self._first_error - def _run(self): + def _run(self) -> None: self._resume = True if self._sync and not self._sync.is_set(): self._log.info('Waiting for sync') From 23a2f5be15fba195ff2e47355f80ee41b3253b00 Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Tue, 14 Oct 2025 10:31:52 +0200 Subject: [PATCH 2/2] [ot] python/qemu: ot.pyot.executer: fix late variable definition issue _build_test_command may throw an exception before 'pre' context is actually executed. Signed-off-by: Emmanuel Blot --- python/qemu/ot/pyot/executer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/qemu/ot/pyot/executer.py b/python/qemu/ot/pyot/executer.py index 848f2a7f74bde..f7d79151cce05 100644 --- a/python/qemu/ot/pyot/executer.py +++ b/python/qemu/ot/pyot/executer.py @@ -192,10 +192,10 @@ def run(self, debug: bool, allow_no_test: bool) -> int: 'UTFILE': basename(test), }) self._log.info('[TEST %s] (%d/%d)', test_name, tpos, tcount) + context = 'pre' exec_info = self._build_test_command(test) exec_info.test_name = test_name vcplogfile = self._log_vcp_streams(exec_info) - context = 'pre' exec_info.context.execute(context) context = 'with' tret, xtime, err = qot.run(exec_info)