From fbeee68b187cfd8cf88efebaf7080a88265c795d Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 9 Feb 2026 16:56:28 +0530 Subject: [PATCH] test/system: fix flaky "podman-remote: non-default connection" test The test was failing intermittently when run under `make remotesystem` because the remotesystem test harness sets PODMAN_SOCKET in the environment. After removing all named connections, the test expected `podman-remote --remote ps` to fail with exit code 125, but it succeeded (exit 0) by falling back to the PODMAN_SOCKET environment variable. Fix by unsetting PODMAN_SOCKET in a subshell before testing for absence of default connection, ensuring the test works correctly in both local and remotesystem environments. Partial cherry-pick of commit feb36e4fe672f899303f8aeddf7663cf70d2b17b ("Implement TLS API Support"), extracting only the test fix portion. Signed-off-by: Lokesh Mandvekar --- test/system/272-system-connection.bats | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/system/272-system-connection.bats b/test/system/272-system-connection.bats index c826da6e53..4e65083e6a 100644 --- a/test/system/272-system-connection.bats +++ b/test/system/272-system-connection.bats @@ -232,9 +232,14 @@ $c2[ ]\+tcp://localhost:54321[ ]\+true" \ run_podman system connection rm env-override run_podman system connection rm cli-override - _run_podman_remote 125 --remote ps - assert "$output" =~ "/run/[a-z0-9/]*podman/podman.sock"\ - "test absence of default connection" + # Test absence of default connection + # Unset PODMAN_SOCKET to avoid false positives when running under remotesystem + ( + unset PODMAN_SOCKET + _run_podman_remote 125 --remote ps + assert "$output" =~ "/run/[a-z0-9/]*podman/podman.sock"\ + "test absence of default connection" + ) } # vim: filetype=sh