Skip to content

Commit

Permalink
contest: remote: export 'namify' to fetcher
Browse files Browse the repository at this point in the history
It sounds interesting to avoid using spaces and other unwanted chars in
test names. This is currently done for the kselftests, but others might
need the same treatment, e.g. in kUnit tests.

To help with that, the 'namify' helper is exported to fetcher.py.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Jun 11, 2024
1 parent 7d8e296 commit f3dca98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions contest/remote/lib/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,10 @@ def _run_once(self):
def run(self):
while self.life.next_poll():
self._run_once()


def namify(what):
name = re.sub(r'[^0-9a-zA-Z]+', '-', what)
if name[-1] == '-':
name = name[:-1]
return name
9 changes: 1 addition & 8 deletions contest/remote/vmksft-p.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from core import NipaLifetime
from lib import wait_loadavg
from lib import CbArg
from lib import Fetcher
from lib import Fetcher, namify
from lib import VM, new_vm, guess_indicators


Expand Down Expand Up @@ -58,13 +58,6 @@
"""


def namify(what):
name = re.sub(r'[^0-9a-zA-Z]+', '-', what)
if name[-1] == '-':
name = name[:-1]
return name


def get_prog_list(vm, target):
tmpdir = tempfile.mkdtemp()
vm.tree_cmd(f"make -C tools/testing/selftests/ TARGETS={target} INSTALL_PATH={tmpdir} install")
Expand Down

0 comments on commit f3dca98

Please sign in to comment.