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 feb36e4fe6
("Implement TLS API Support"), extracting only the test fix portion.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar 2026-02-09 16:56:28 +05:30
parent fedda4a758
commit fbeee68b18
No known key found for this signature in database
GPG key ID: 1C1EDD7CC7C3A0DD

View file

@ -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