Skip to content

Commit

Permalink
testing: litevm: fix litevm runner
Browse files Browse the repository at this point in the history
It got broken by the removal of tox. It also needs to handle CTF in the
same run for some cases too. Fix it all up.

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
  • Loading branch information
brenns10 committed Oct 30, 2024
1 parent 720269a commit 597def6
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions testing/litevm/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import subprocess
import sys
import tempfile
from itertools import combinations
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict
Expand Down Expand Up @@ -391,28 +390,30 @@ def main():
"-rP",
]
ctf_enabled = [False]
if args.ctf:
if args.with_ctf:
ctf_enabled.append(True)
for k, ctf in combinations(TEST_KERNELS, ctf_enabled):
k.cache_dir = args.yum_cache_dir
for k in TEST_KERNELS:
if args.kernel and not fnmatch.fnmatch(k.slug(), args.kernel):
continue
if ctf:
section_name = f"uek{k.uek_ver}_CTF"
section_text = f"Run tests on UEK{k.uek_ver} with CTF"
# add the CTF argument here
run_cmd = cmd + ["--ctf"]
else:
section_name = f"uek{k.uek_ver}"
section_text = f"Run tests on UEK{k.uek_ver}"
run_cmd = cmd
with ci_section(section_name, section_text):
k.cache_dir = args.yum_cache_dir
with ci_section(f"uek{k.uek_ver}_fetch", f"Fetching UEK {k.uek_ver}"):
release = k.latest_release()
extract_dir = args.extract_dir / release
run_vm(k, args.extract_dir, [run_cmd])
if args.delete_after_test:
shutil.rmtree(extract_dir)
k.delete_cache()
extract_dir = args.extract_dir / release
for ctf in ctf_enabled:
if ctf:
section_name = f"uek{k.uek_ver}_CTF"
section_text = f"Run tests on UEK{k.uek_ver} with CTF"
# add the CTF argument here
run_cmd = cmd + ["--ctf"]
else:
section_name = f"uek{k.uek_ver}"
section_text = f"Run tests on UEK{k.uek_ver}"
run_cmd = cmd
with ci_section(section_name, section_text):
run_vm(k, args.extract_dir, [run_cmd])
if args.delete_after_test:
shutil.rmtree(extract_dir)
k.delete_cache()


if __name__ == "__main__":
Expand Down

0 comments on commit 597def6

Please sign in to comment.