summaryrefslogtreecommitdiff
path: root/test/system/500-networking.bats
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-08-16 11:03:16 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-08-16 11:30:11 +0200
commit2a8c4144887373dd8c070ac09f33fea7ab764a95 (patch)
tree4216074b83d0c3c516cfb0739e09ca3eaefb7410 /test/system/500-networking.bats
parent5592ac9e236191da654619d1c8505420187766b4 (diff)
downloadpodman-2a8c4144887373dd8c070ac09f33fea7ab764a95.tar.gz
podman-2a8c4144887373dd8c070ac09f33fea7ab764a95.tar.bz2
podman-2a8c4144887373dd8c070ac09f33fea7ab764a95.zip
Fix rootless cni dns without systemd stub resolver
When a host uses systemd-resolved but not the resolved stub resolver the following symlinks are created: `/etc/resolv.conf` -> `/run/systemd/resolve/stub-resolv.conf` -> `/run/systemd/resolve/resolv.conf`. Because the code uses filepath.EvalSymlinks we put the new resolv.conf to `/run/systemd/resolve/resolv.conf` but the `/run/systemd/resolve/stub-resolv.conf` link does not exists in the mount ns. To fix this we will walk the symlinks manually until we reach the first one under `/run` and use this for the resolv.conf file destination. This fixes a regression which was introduced in e73d4829900c. Fixes #11222 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r--test/system/500-networking.bats3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 6ffee7eaf..3ebe45e63 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -210,6 +210,9 @@ load helpers
$IMAGE nc -l -n -v -p $myport
cid="$output"
+ # check that dns is working inside the container
+ run_podman exec $cid nslookup google.com
+
# emit random string, and check it
teststring=$(random_string 30)
echo "$teststring" | nc 127.0.0.1 $myport