osmith has uploaded this change for review.

View Change

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).

Change-Id: Iea634f5e97d14f1f7e777f4609b9593974964d23
---
M _testenv/testenv/cmd.py
M _testenv/testenv/daemons.py
2 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/65/37765/1
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}")

To view, visit change 37765. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iea634f5e97d14f1f7e777f4609b9593974964d23
Gerrit-Change-Number: 37765
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>