@samitouri / QOSamiQemu / commits / c5ecd377a0

tests/docker: add support for podman remote access

When a developer's environment is already within a podman container it is not possible to use 'podman' again to create containers. It will usually result in wierd errors such as: Error: fatal error, invalid internal status, unable to create a new pause process: cannot re-exec process to join the existing user namespace. Try running "podman system migrate" and if that doesn't work reboot to recover Podman offers the ability to talk to a daemon outside the container, however, which could be leveraged by QEMU. This can be used by invoking "podman --remote", or equivalently the separate "podman-remote" binary: https://github.com/containers/podman/blob/main/docs/tutorials/remote_client.md The current 'podman version' check is insufficient to detect the inability to launch containers, so it is replaced with the stronger 'podman info' check. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260210163556.713841-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>

Daniel P. Berrangé committed Feb 10, 2026 at 16:35 UTC c5ecd377a016997f093801685a73303980be3ec4
1 file changed +6 -4
tests/docker/docker.py
+6 -4
@@ -76,14 +76,16 @@ def _guess_engine_command():
76 commands = []
77
78 if USE_ENGINE in [EngineEnum.AUTO, EngineEnum.PODMAN]:
79 - commands += [["podman"]]
79 + commands += [["podman"], ["podman-remote"], ["podman", "--remote"]]
80 if USE_ENGINE in [EngineEnum.AUTO, EngineEnum.DOCKER]:
81 commands += [["docker"], ["sudo", "-n", "docker"]]
82 for cmd in commands:
83 try:
84 - # docker version will return the client details in stdout
85 - # but still report a status of 1 if it can't contact the daemon
86 - if subprocess.call(cmd + ["version"],
84 + # 'version' is not sufficient to prove a working binary
85 + # for podman. 'info' is a stronger check that is more
86 + # likely to correlate with ability to create containers,
87 + # and required to detect the need for podman remote
88 + if subprocess.call(cmd + ["info"],
89 stdout=DEVNULL, stderr=DEVNULL) == 0:
90 return cmd
91 except OSError: