From 3abb8b4474d08d8142c3206daf3ad67054fd7b9b Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Wed, 30 Aug 2023 19:40:08 +0200 Subject: [PATCH] [ot] scripts/opentitan: pyot: fix @{}/ not being managed for test options. Also fix missing path separator after @{}/ replacement. Signed-off-by: Emmanuel Blot --- scripts/opentitan/pyot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/opentitan/pyot.py b/scripts/opentitan/pyot.py index 2e78e9303e63..d6f4e71fed8d 100755 --- a/scripts/opentitan/pyot.py +++ b/scripts/opentitan/pyot.py @@ -426,7 +426,11 @@ def replace(smo: Match) -> str: if name not in self._dirs: tmp_dir = mkdtemp(prefix='qemu_ot_dir_') self._dirs[name] = tmp_dir - return self._dirs[name] + else: + tmp_dir = self._dirs[name] + if not tmp_dir.endswith(sep): + tmp_dir = f'{tmp_dir}{sep}' + return tmp_dir nvalue = re_sub(r'\@\{(\w*)\}/', replace, value) if nvalue != value: self._log.debug('Interpolate %s with %s', value, nvalue) @@ -1160,6 +1164,7 @@ def _build_test_args(self, test_name: str) \ if opts and not isinstance(opts, list): raise ValueError('fInvalid QEMU options for {test_name}') opts = self.flatten([opt.split(' ') for opt in opts]) + opts = [self._qfm.interpolate_dirs(opt, test_name) for opt in opts] timeout = int(kwargs.get('timeout', DEFAULT_TIMEOUT)) return Namespace(**kwargs), opts or [], timeout