osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37765?usp=email )
Change subject: testenv: podman.is_running() -> testenv.args.podman ......................................................................
testenv: podman.is_running() -> testenv.args.podman
Use testenv.args.podman instead of testenv.podman.is_running() in all places except for testenv.podman.stop().
- testenv.args.podman is always True when --podman is used.
- testenv.podman.is_running() is only True while the container is currently running.
Most of the time the behavior is the same. But without this patch, when the container crashes, commands would unexpectedly run outside of the container (and then fail on jenkins due to missing programs).
Related: OS#6494 Change-Id: Iea634f5e97d14f1f7e777f4609b9593974964d23 --- M _testenv/testenv/cmd.py M _testenv/testenv/daemons.py 2 files changed, 2 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index 93e4e36..cb8386a 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -82,7 +82,7 @@
def run(cmd, check=True, env={}, no_podman=False, stdin=subprocess.DEVNULL, *args, **kwargs): - if not no_podman and testenv.podman.is_running(): + if not no_podman and testenv.args.podman: return testenv.podman.exec_cmd(cmd, check=check, env=env, *args, **kwargs)
logging.debug(f"+ {cmd}") diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py index 792341c..9e274d9 100644 --- a/_testenv/testenv/daemons.py +++ b/_testenv/testenv/daemons.py @@ -55,7 +55,7 @@ if testenv.args.io_uring: env["LIBOSMO_IO_BACKEND"] = "IO_URING"
- if testenv.podman.is_running(): + if testenv.args.podman: daemons[section] = testenv.podman.exec_cmd_background(cmd, cwd=cwd, env=env) else: logging.debug(f"+ {cmd}")