osmith submitted this change.

View Change

Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified
testenv/podman: use explicit no_podman=True

Add an explicit no_podman=True to the commands that are meant to run
outside of the podman container. Previously it was implicit by relying
on logic in testenv.cmd.run, which would run the commands outside of
podman unless the podman container was running.

In the next patch I will remove the implicit logic, because it could
lead to the bug of running commands outside of the container by accident
if the container crashed.

Related: OS#6494
Change-Id: I41afe6d6b565a8e8c384229ee44f1b75f25c0a4b
---
M _testenv/testenv/podman.py
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index bda6f9d..a972d95 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -22,13 +22,14 @@


def image_exists():
- return testenv.cmd.run(["podman", "image", "exists", image_name], check=False).returncode == 0
+ return testenv.cmd.run(["podman", "image", "exists", image_name], check=False, no_podman=True).returncode == 0


def image_up_to_date():
history = testenv.cmd.run(
["podman", "history", image_name, "--format", "json"],
capture_output=True,
+ no_podman=True,
text=True,
)
created = json.loads(history.stdout)[0]["created"].split(".", 1)[0]
@@ -69,7 +70,8 @@
"-t",
image_name,
os.path.join(testenv.data_dir, "podman"),
- ]
+ ],
+ no_podman=True,
)



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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I41afe6d6b565a8e8c384229ee44f1b75f25c0a4b
Gerrit-Change-Number: 37766
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>