test/e2e: fix podman run check dns flake

For unknown reasons systemd-resolved sometimes responds with NXDOMAIN
instead REFUSED which it seems to use by default for a local name
without domain part. So the fact that this works at all right now is
super weird.

In any case we just want to make sure the name did not get resolved so
allow both here to fix the flake.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2025-06-25 16:58:10 +02:00
parent 7780e28b45
commit b5783ae1fb
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 4 additions and 1 deletions

View File

@ -1166,7 +1166,10 @@ EXPOSE 2004-2005/tcp`, ALPINE)
session = podmanTest.Podman([]string{"run", "--name", "con3", "--pod", pod2, CITEST_IMAGE, "nslookup", "con1."})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitWithError(1, ""))
Expect(session.OutputToString()).To(ContainSubstring("NXDOMAIN"))
// This flakes on debian with systemd-resolved, also resolved behavior between A and AAAA lookups differ:
// https://github.com/systemd/systemd/issues/37969
// In short we can get NXDOMAIN or REFUSED as reply. Both seems fine for the purpose of a negative lookup.
Expect(session.OutputToString()).To(Or(ContainSubstring("NXDOMAIN"), ContainSubstring("REFUSED")))
session = podmanTest.Podman([]string{"run", "--name", "con4", "--network", net, CITEST_IMAGE, "nslookup", pod2 + ".dns.podman"})
session.WaitWithDefaultTimeout()