summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-04-29 15:01:56 +0200
committerMatthew Heon <matthew.heon@pm.me>2022-05-03 13:45:35 -0400
commit95633146e08aa0bc81aa3d7949c3ef02f38a2308 (patch)
tree90418ba6a70d7d6232f6128c27b9e6b0f5dc0206 /test/system
parent1cdf18a86b092caf5d23ddf605b23c9c143f270f (diff)
downloadpodman-95633146e08aa0bc81aa3d7949c3ef02f38a2308.tar.gz
podman-95633146e08aa0bc81aa3d7949c3ef02f38a2308.tar.bz2
podman-95633146e08aa0bc81aa3d7949c3ef02f38a2308.zip
libpod: host netns keep same /etc/resolv.conf
When a container is run in the host network namespace we have to keep the same resolv.conf content and not use the systemd-resolve detection logic. But also make sure we still allow --dns options. Fixes #14055 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/500-networking.bats9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index c7007741b..3db0804d1 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -656,6 +656,15 @@ EOF
run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
is "$output" "search dns.podman.*" "correct search domain"
is "$output" ".*nameserver $subnet.1.*" "integrated dns nameserver is set"
+
+ # host network should keep localhost nameservers
+ if grep 127.0.0. /etc/resolv.conf >/dev/null; then
+ run_podman run --network host --rm $IMAGE cat /etc/resolv.conf
+ is "$output" ".*nameserver 127\.0\.0.*" "resolv.conf contains localhost nameserver"
+ fi
+ # host net + dns still works
+ run_podman run --network host --dns 1.1.1.1 --rm $IMAGE cat /etc/resolv.conf
+ is "$output" ".*nameserver 1\.1\.1\.1.*" "resolv.conf contains 1.1.1.1 nameserver"
}
@test "podman run port forward range" {