diff --git a/python/qemu/ot/pyot/executer.py b/python/qemu/ot/pyot/executer.py index 10162562a05ed..aeb975d88855a 100644 --- a/python/qemu/ot/pyot/executer.py +++ b/python/qemu/ot/pyot/executer.py @@ -215,7 +215,7 @@ def run(self, debug: bool, allow_no_test: bool) -> int: err = exec_info.context.first_error if not tret: context = 'post' - exec_info.context.execute(context, 'post') + exec_info.context.execute(context, tret) # pylint: disable=broad-except except Exception as exc: self._log.critical('%s', str(exc)) @@ -470,7 +470,7 @@ def _build_test_args(self, test_name: str) \ kwargs = dict(self._args.__dict__) test_cfg = tests_cfg.get(test_name, {}) if test_cfg is None: - # does not default to an empty dict to differenciate empty from + # does not default to an empty dict to differentiate empty from # inexistent test configuration self._log.debug('No configuration for test %s', test_name) opts = None diff --git a/python/qemu/ot/pyot/qemu/executer.py b/python/qemu/ot/pyot/qemu/executer.py index ffbeb338fb6dc..d1b5e994e2887 100644 --- a/python/qemu/ot/pyot/qemu/executer.py +++ b/python/qemu/ot/pyot/qemu/executer.py @@ -17,7 +17,7 @@ from ot.util.misc import EasyDict from ..executer import Executer -from .wrapper import Wrapper +from .wrapper import QEMUWrapper class QEMUExecuter(Executer): @@ -36,7 +36,7 @@ class QEMUExecuter(Executer): } """Shortcut names for QEMU log sources.""" - WRAPPER = Wrapper + WRAPPER = QEMUWrapper """QEMU wrapper.""" def _build_fw_args(self, args: Namespace) \ diff --git a/python/qemu/ot/pyot/wrapper.py b/python/qemu/ot/pyot/wrapper.py index 7ede6aee0a600..88e88f4bffb60 100644 --- a/python/qemu/ot/pyot/wrapper.py +++ b/python/qemu/ot/pyot/wrapper.py @@ -22,7 +22,7 @@ import sys from ot.util.log import ColorLogFormatter -from ot.util.misc import EasyDict +from ot.util.misc import EasyDict, split_map_join from .util import ExecTime, LogMessageClassifier @@ -137,7 +137,8 @@ def trig_match(bline): app_exec=host_app_exec) try: workdir = dirname(tdef.command[0]) - log.debug('Executing %s as %s', self.NAME, ' '.join(tdef.command)) + tdef_cli = self._simplify_cli(tdef.command) + log.debug('Executing %s as %s', self.NAME, tdef_cli) env = dict(environ) if tdef.asan: # note cannot use a FileManager temp file here, as the full @@ -386,6 +387,16 @@ def classify_log(cls, line: str, default: int = logging.ERROR, return logging.DEBUG return default + def _simplify_cli(self, args: list[str]) -> str: + """Shorten the test execution command line.""" + if self._debug: + # do not simplify the argument line if debug mode is enabled + return ' '.join(args) + return ' '.join(split_map_join(',', arg, + lambda part: split_map_join('=', part, + basename)) + for arg in args) + def _colorize_vcp_log(self, vcplogname: str, lognames: list[str]) -> None: vlog = logging.getLogger(vcplogname) clr_fmt = None