test/system: Consolidate "External resolver" pasta tests

The idea behind the "External resolver" tests is simply to check that we
can contact a nameserver, regardless of this configuration.  To this end
the "IPv4" version looks up 127.0.0.1 which RFC1912[0] suggests should
always be resolvable.

The IPv6 version instead looks up [::1].  While it makes sense for
that to be resolvable in a similar way, there appear to be quite a few
nameservers which do not resolve it, making this test flaky.
Furthermore the idea behind resolving [::1] is that it should make
nslookup prefer to resolve over IPv6.  That appears to be very
unreliable at best.  Since making a different query doesn't actually
exercise anything different in pasta, drop the test.

The remaining IPv4 test isn't really specific to an "external" resolver,
it's simply checking that we can contact some sort of resolver with the
default podman configuration.  Rename accordingly, and run it regardless of
IPv4 connectivity on the host: we can still query a nameserver about an
IPv4 address, even if we only have IPv6 connectivity ourselves.

[0] https://datatracker.ietf.org/doc/html/rfc1912#section-4.1

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson
2024-07-19 09:43:56 +10:00
parent 85045406b5
commit 6c79fe292b

View File

@@ -434,24 +434,13 @@ function pasta_test_do() {
### DNS ########################################################################
@test "External resolver, IPv4" {
skip_if_no_ipv4 "IPv4 not routable on the host"
@test "Basic nameserver lookup" {
run_podman '?' run --rm --net=pasta $IMAGE nslookup 127.0.0.1
assert "$output" =~ "1.0.0.127.in-addr.arpa" \
"127.0.0.1 not resolved"
}
@test "External resolver, IPv6" {
skip_if_no_ipv6 "IPv6 not routable on the host"
run_podman '?' run --rm --net=pasta $IMAGE nslookup ::1
assert "$output" =~ "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" \
"::1 not resolved"
}
@test "Default nameserver forwarding" {
skip_if_no_ipv4 "IPv4 not routable on the host"