inte/networking: TestDisableIPv6OnInterface: add '-c1' to ping

If the DNS name still resolves to an IP address, and that address is
assigned to a running container, the ping command will run indefinitely
and the test suite will time out for 10 mins.

This is confusing, as it looks like a daemon hang, or a test suite hang,
whereas it's just a test failure. Add '-c1' to ping to make it return
immediately.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
This commit is contained in:
Albin Kerouanton
2025-11-13 17:06:03 +01:00
parent 47bd247d4d
commit 53ea70ea46

View File

@@ -1092,7 +1092,7 @@ func TestDisableIPv6OnInterface(t *testing.T) {
// There should not be an IPv6 DNS or /etc/hosts entry.
runRes := container.RunAttach(ctx, t, c,
container.WithNetworkMode(tc.netName),
container.WithCmd("ping", "-6", ctrName),
container.WithCmd("ping", "-6", "-c1", ctrName),
)
assert.Check(t, is.Equal(runRes.ExitCode, 1))
assert.Check(t, is.Contains(runRes.Stderr.String(), "bad address"))