systems: retrofit dns options test to honor other search domains

Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
Aditya R 2023-01-23 10:52:33 +05:30 committed by Chris Evich
parent 5b91570291
commit 8e30083705
No known key found for this signature in database
GPG key ID: 03EDC70FD578067F

View file

@ -664,7 +664,7 @@ EOF
"
CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE cat /etc/resolv.conf
is "$output" "search example.com$nl.*" "correct search domain"
is "$output" "search example.com.*" "correct search 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
@ -673,9 +673,13 @@ EOF
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 search 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"
is "$output" "search example.com.*" "correct search domain"
local store=$output
if is_netavark; then
is "$store" ".*nameserver $subnet.1.*" "integrated dns nameserver is set"
else
is "$store" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
fi
# we should use the integrated dns server
run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
is "$output" "search dns.podman.*" "correct search domain"