From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id A2E365A004E for ; Thu, 25 Jul 2024 08:50:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1721890244; bh=0KPX/x/OqrRzBgVxUpeaZVV26Ojjs/E247k0r3WGO+w=; h=From:To:Cc:Subject:Date:From; b=Pm9H6IGYbs53rB9FDvUucm0Zj4G6SYL7Lai2jazhJDxc++066z9K66/DKTRZQ31F7 TCRpw+1cKknYalwqvBw7W0R/ffPASSd1EicT/o4ycbD0xeTWNqZkeGRv0yZFonpwj0 O/P990lBCxOOPsUgEPU8iPVbyDWVFzogb3jrej6WjMurAO2Qd1qVIMg7sxZKsjzepl bEjEgYVmWdZaYfI8/YXY1hLJIEifzfe4zajGNiJPrJ/KGOvaRU4X4qrSJY60PKaD0M +DbdAR7FCsKfm/IbsBHPlde97GjMPcDPF+2TER8TDdcgvP0H9o71HY/JRDEdfjDigE KqfuDClujJtpg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WV1jw2lPjz4wnt; Thu, 25 Jul 2024 16:50:44 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH] test: Fix spurious test failure with systemd-resolved Date: Thu, 25 Jul 2024 16:50:42 +1000 Message-ID: <20240725065042.2731382-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ONYWQTGD632AK55WHRUWR5FLEB4JGCDJ X-Message-ID-Hash: ONYWQTGD632AK55WHRUWR5FLEB4JGCDJ X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: systemd-resolved has the rather strange behaviour of listening on the non-standard loopback address 127.0.0.53. Various changes we've made in passt mean that we now usually work fine on a host using systemd-resolved. However our tests still fail in this case. We have a special case for when the guest's resolv.conf needs to differ from the host's because the resolver is on a host loopback address. However, we only consider the case where the host resolver is on 127.0.0.1, not other loopback addresses. Correct this with a different test condition. Signed-off-by: David Gibson --- test/passt/dhcp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/passt/dhcp b/test/passt/dhcp index 3ec2faf2..e05a4bb1 100644 --- a/test/passt/dhcp +++ b/test/passt/dhcp @@ -38,7 +38,7 @@ check [ __MTU__ = 65520 ] test DHCP: DNS gout DNS sed -n 's/^nameserver \([0-9]*\.\)\(.*\)/\1\2/p' /etc/resolv.conf | tr '\n' ',' | sed 's/,$//;s/$/\n/' hout HOST_DNS sed -n 's/^nameserver \([0-9]*\.\)\(.*\)/\1\2/p' /etc/resolv.conf | head -n3 | tr '\n' ',' | sed 's/,$//;s/$/\n/' -check [ "__DNS__" = "__HOST_DNS__" ] || [ "__DNS__" = "__HOST_GW__" -a "__HOST_DNS__" = "127.0.0.1" ] +check [ "__DNS__" = "__HOST_DNS__" ] || ( [ "__DNS__" = "__HOST_GW__" ] && expr "__HOST_DNS__" : "127[.]" ) # FQDNs should be terminated by dots, but the guest DHCP client might omit them: # strip them first -- 2.45.2