summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-04 11:49:11 -0500
committerGitHub <noreply@github.com>2022-02-04 11:49:11 -0500
commitec390d5d35cf22345bc96476ba8b978d6e027990 (patch)
tree731b1f36bb10f9206d7d11928ebf18b4ebc19304 /test/system
parent956664f65b5ebcc07a47c4d03c663c32733ed1ad (diff)
parentd733c3baa25be1513e3952e4b8451f57a573dfae (diff)
downloadpodman-ec390d5d35cf22345bc96476ba8b978d6e027990.tar.gz
podman-ec390d5d35cf22345bc96476ba8b978d6e027990.tar.bz2
podman-ec390d5d35cf22345bc96476ba8b978d6e027990.zip
Merge pull request #13143 from Luap99/dns
append podman dns search domain
Diffstat (limited to 'test/system')
-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 9b39ebf97..4b1a22981 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -609,9 +609,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