summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-02-04 15:48:41 +0100
committerMatthew Heon <matthew.heon@pm.me>2022-02-10 13:54:18 -0500
commitbcd5f5ead7b432f8a5f6c5438b5aa81134718c12 (patch)
tree25fb29eda13c90856eb38fd76c29614b1dc23743 /test
parentb1bf91a22a8d5d4d676e48efa2073944baff14c1 (diff)
downloadpodman-bcd5f5ead7b432f8a5f6c5438b5aa81134718c12.tar.gz
podman-bcd5f5ead7b432f8a5f6c5438b5aa81134718c12.tar.bz2
podman-bcd5f5ead7b432f8a5f6c5438b5aa81134718c12.zip
append podman dns search domain
Append the podman dns seach domain to the host search domains when we use the dnsname/aardvark server. Previously it would only use podman seach domains and discard the host domains. Fixes #13103 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/500-networking.bats24
1 files changed, 21 insertions, 3 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 9f70c1c6c..b49f141dc 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -605,9 +605,27 @@ load helpers
"8.8.8.8",
]
EOF
- CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep "example.com" /etc/resolv.conf
- CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep $searchIP /etc/resolv.conf
- is "$output" "nameserver $searchIP" "Should only be one $searchIP not multiple"
+
+ local nl="
+"
+
+ CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search example.com$nl.*" "correct seach domain"
+ is "$output" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
+
+ # create network with dns
+ local netname=testnet-$(random_string 10)
+ local subnet=$(random_rfc1918_subnet)
+ run_podman network create --subnet "$subnet.0/24" $netname
+ # custom server overwrites the network dns server
+ CONTAINERS_CONF=$containersconf run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search example.com$nl.*" "correct seach domain"
+ is "$output" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
+
+ # we should use the integrated dns server
+ run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search dns.podman.*" "correct seach domain"
+ is "$output" ".*nameserver $subnet.1.*" "integrated dns nameserver is set"
}
# vim: filetype=sh