mirror of https://github.com/containers/podman.git
Merge pull request #23336 from dgibson/pasta-dns
Fix several reliability problems with pasta DNS handling tests
This commit is contained in:
commit
3fb9619298
|
@ -434,43 +434,52 @@ function pasta_test_do() {
|
||||||
|
|
||||||
### DNS ########################################################################
|
### DNS ########################################################################
|
||||||
|
|
||||||
@test "External resolver, IPv4" {
|
@test "Basic nameserver lookup" {
|
||||||
skip_if_no_ipv4 "IPv4 not routable on the host"
|
run_podman run --rm --net=pasta $IMAGE nslookup l.root-servers.net
|
||||||
|
|
||||||
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" {
|
@test "Default nameserver forwarding" {
|
||||||
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 "Local forwarder, IPv4" {
|
|
||||||
skip_if_no_ipv4 "IPv4 not routable on the host"
|
skip_if_no_ipv4 "IPv4 not routable on the host"
|
||||||
|
|
||||||
# pasta is the default now so no need to set it
|
# pasta is the default now so no need to set it
|
||||||
run_podman run --rm $IMAGE grep nameserver /etc/resolv.conf
|
run_podman run --rm $IMAGE grep nameserver /etc/resolv.conf
|
||||||
assert "${lines[0]}" == "nameserver 169.254.1.1" "default dns forward server"
|
assert "${lines[0]}" == "nameserver 169.254.1.1" "default dns forward server"
|
||||||
|
|
||||||
run_podman run --rm --net=pasta:--dns-forward,198.51.100.1 \
|
|
||||||
$IMAGE nslookup 127.0.0.1 || :
|
|
||||||
assert "$output" =~ "1.0.0.127.in-addr.arpa" "No answer from resolver"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Local forwarder, IPv6" {
|
@test "Custom DNS forward address, IPv4" {
|
||||||
|
skip_if_no_ipv4 "IPv4 not routable on the host"
|
||||||
|
|
||||||
|
local addr=198.51.100.1
|
||||||
|
|
||||||
|
run_podman run --rm --net=pasta:--dns-forward,$addr \
|
||||||
|
$IMAGE grep nameserver /etc/resolv.conf
|
||||||
|
assert "${lines[0]}" == "nameserver $addr" "custom dns forward server"
|
||||||
|
|
||||||
|
run_podman run --rm --net=pasta:--dns-forward,$addr \
|
||||||
|
$IMAGE nslookup l.root-servers.net $addr
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Custom DNS forward address, IPv6" {
|
||||||
skip_if_no_ipv6 "IPv6 not routable on the host"
|
skip_if_no_ipv6 "IPv6 not routable on the host"
|
||||||
|
|
||||||
# TODO: Two issues here:
|
# TODO: In fact, this requires not just IPv6 connectivity on the
|
||||||
|
# host, but an IPv6 reachable nameserver which is harder to
|
||||||
|
# test for. We could remove that requirement if pasta could
|
||||||
|
# forward between IPv4 and IPv6 addresses but as of
|
||||||
|
# 2024_09_06.6b38f07 that's unsupported. Skip the test for
|
||||||
|
# now.
|
||||||
skip "Currently unsupported"
|
skip "Currently unsupported"
|
||||||
# run_podman run --dns 2001:db8::1 \
|
# local addr=2001:db8::1
|
||||||
# --net=pasta:--dns-forward,2001:db8::1 $IMAGE nslookup ::1
|
#
|
||||||
|
# run_podman run --rm --net=pasta:--dns-forward,$addr \
|
||||||
|
# $IMAGE grep nameserver /etc/resolv.conf
|
||||||
|
# assert "${lines[0]}" == "nameserver $addr" "custom dns forward server"
|
||||||
|
# run_podman run --rm --net=pasta:--dns-forward,$addr \
|
||||||
|
# $IMAGE nslookup l.root-servers.net $addr
|
||||||
|
#
|
||||||
|
# TODO: In addition to the IPv6 nameserver requirement above,
|
||||||
|
# there seem to be two problems running this test. It's
|
||||||
|
# unclear if those are in busybox, musl or pasta.
|
||||||
#
|
#
|
||||||
# 1. With this, Podman writes "nameserver 2001:db8::1" to
|
# 1. With this, Podman writes "nameserver 2001:db8::1" to
|
||||||
# /etc/resolv.conf, without zone, and the query originates from ::1.
|
# /etc/resolv.conf, without zone, and the query originates from ::1.
|
||||||
|
|
Loading…
Reference in New Issue