From b7ab889a7efcd71eed78c55f7619ae29bab774ad Mon Sep 17 00:00:00 2001 From: Aditya R Date: Mon, 23 Jan 2023 10:52:33 +0530 Subject: [PATCH] systems: retrofit dns options test to honor other search domains Signed-off-by: Aditya R --- test/system/500-networking.bats | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 20f25728a6..3b797be089 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -651,7 +651,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 @@ -660,9 +660,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"