From patchwork Mon May 5 14:22:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4236 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:e147:b0:656:592e:a137 with SMTP id nw7csp2308138mab; Mon, 5 May 2025 07:23:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUw9Wu83V5K+DQJ2AL5qRbU0egpCuhk1Z3choKDGr650Zn7rXrNoLuBWEd9GjwvFxXUIFl0Lxg5BoE=@openvpn.net X-Google-Smtp-Source: AGHT+IHlCkxXTN/ZNG/mZ1AuCtZviU5iuPZTVQYqiyspK5AQxywtityzjKJinaeBrEn8yXEIJLCA X-Received: by 2002:a05:6808:159a:b0:403:5af1:b05 with SMTP id 5614622812f47-4035af110f2mr3966878b6e.16.1746454982409; Mon, 05 May 2025 07:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746454982; cv=none; d=google.com; s=arc-20240605; b=P7FK9Bw0UenkxwBYO5BmUGWqOsz4AvPhlHGmsbR1cC2BR0FEaoCz40LAAoThJfzMo/ W4skCmzQ/Des5Y3smpVEddcfMFDWfqWDAx81sWdjQijTtQjLbyxtjgo8q1ZK6koLvlVf QqKwhSON6+qVzoPURa3wgn1jFsY4UyainjWLr0o0N6HGUJeatDrxaPgBEH1MKqWCb/vm rTi8pjH+phMtcIk9rgYQZCdmT3qsa6cgy1MNxrwh90AhVJriV2OTGt+ns5RyM4MsBbDN divqm8mTymwmjgoxMRSkkE6VplgXkL9KCJZNzm0NS6B8URITenIT76yLK/31VEa1hwIU cuxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=UPc0PkpyZL9tDEKXBrMgB2YYB7a7IfK6fj/fn6gAQK4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=XrhbFBBkrxKKGmSpRpqqPxSUlHLyCqeSHHCxeJIVBtzr8QlzDd5eK16c4LUtk5Oa+c PXlh+RmwS/LsYZI7iQM25FwiArKWNzy3BlP0WIoH1RChvCMjpfjq8fXaR78h0zASUXXX Bh2ytDgKLaPjZeCIml3k/tY8ZrJCY3vGCPjdhypJLVM7Znr/UjWV9U/mZfiG1qoZcXD2 Y6AI8EAUGyoHQY5rgACdz5rOzBaOqIU3RqkQqkhAA38LsZA2hJms5QxVwMKhM2k0630M wUeAVF7kbYeNNJtGchi9vxm8jgIsoe4UZUpBOYqrWY39pc82SK/au0K6bgXFgAu9r+hf h/xQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=c5Yy1k9W; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=VhpIHacg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CGmqXkfN; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-40346400582si4470526b6e.227.2025.05.05.07.23.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 May 2025 07:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=c5Yy1k9W; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=VhpIHacg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CGmqXkfN; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UPc0PkpyZL9tDEKXBrMgB2YYB7a7IfK6fj/fn6gAQK4=; b=c5Yy1k9Wguy6erdc7Ybv7sTPcU fX3RS4E+8ddT1Alk54u3qHLu1RvYjhHzF8lBpT19wCUYD6kJsUscUExHxWYmLcotJghaalxqWhyBF xkRQwfIZaC4j34ApvHebBgMsCPImANBwoS9BWj2nnkL92NzX+pxKMqTjfwrxxzglOPHY=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uBwif-0004NV-MZ; Mon, 05 May 2025 14:22:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uBwib-0004NI-LT for openvpn-devel@lists.sourceforge.net; Mon, 05 May 2025 14:22:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=h+bf4YeLIzWGXmSjawirHzEXh0VWCjqPSOcUzhY86Dc=; b=VhpIHacg3Bj//UyYrmYQ3C87Ne PBkh0m1OpLiqqEXzPMcAVFXQK0cVkIHcR8HzB9s+ewt2SpwVT/w2IFGXg8Tv37xWQ/bKs3axDj61X d/PWxR4JaaXbGRF4wdE8A0+da5IKJjRYueiAT4xwtXVnVGbXlmA21Mbah0BHHGcRpu6I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=h+bf4YeLIzWGXmSjawirHzEXh0VWCjqPSOcUzhY86Dc=; b=CGmqXkfN6LhmoEPJA+NNS7trBt 9lydHZA8a8UixqJFc94UGBsHgyjYk1frx5Cm4LTnoO6C0pohIyJWte2+2dQJ0beI1VQcbFRcfKiIK gWUloDKGdA8WSNokNppSDe1xL324/28nmurGU8Jt6YIQatkYlLlmTVsiS1NZOfkaowCs=; Received: from [193.149.48.143] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uBwiL-0006yR-0c for openvpn-devel@lists.sourceforge.net; Mon, 05 May 2025 14:22:53 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 545EMPUo024964 for ; Mon, 5 May 2025 16:22:25 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 545EMPLn024963 for openvpn-devel@lists.sourceforge.net; Mon, 5 May 2025 16:22:25 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 5 May 2025 16:22:16 +0200 Message-ID: <20250505142224.24935-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: With the patchsets to add DNS configuration on Unix+MacOS systems, and the addition of test stanzas to excercise and verify the OS specific "dns-updown" script, it becomes important to trace test fail [...] Content analysis details: (1.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.143 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.143 listed in bl.score.senderscore.com] 0.4 NO_DNS_FOR_FROM DNS: Envelope sender has no MX or A DNS records 0.0 SPF_HELO_FAIL SPF: HELO does not match SPF record (fail) [SPF failed: Rejected by SPF record] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uBwiL-0006yR-0c Subject: [Openvpn-devel] [PATCH v3] Add information-gathering about DNS resolvers configured to t_client.sh(.in) X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1831290779510150853?= X-GMAIL-MSGID: =?utf-8?q?1831290779510150853?= With the patchsets to add DNS configuration on Unix+MacOS systems, and the addition of test stanzas to excercise and verify the OS specific "dns-updown" script, it becomes important to trace test failures ("did it not ping because the DNS was not installed, or did something else fail?") and also verify that DNS config is properly restored at the end of each test. Linux is probed with "resolvectl status", if available, and "cat resolv.conf" if not. MacOS uses scutil --dns. All other platforms use "cat resolv.conf" for now (because even if "a tool to maintain DNS config" is available, in the end resolv.conf is always where the final config lands). Include a bit of restructuring to handle linux iproute2 testing in the "Linux" branch, and make the control flow more amenable to having a second case / esac block. Change-Id: I9cae7314203424e4a604073c5445559260172477 Signed-off-by: Gert Doering Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/961 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in index 1ccadeb..7a271b6 100755 --- a/tests/t_client.sh.in +++ b/tests/t_client.sh.in @@ -166,53 +166,71 @@ # this is higly system dependent... get_ifconfig_route() { - # linux / iproute2? (-> if configure got a path) - if [ -n "@IPROUTE@" ] - then - echo "-- linux iproute2 --" - @IPROUTE@ addr show | grep -v valid_lft - @IPROUTE@ route show - @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g' - return - fi - - # try uname - case `uname -s` in + UNAME=`uname -s` + case $UNAME in Linux) - echo "-- linux / ifconfig --" - LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)" - LANG=C @NETSTAT@ -rn -4 -6 - return - ;; + # linux / iproute2? (-> if configure got a path) + if [ -n "@IPROUTE@" ] + then + echo "-- linux iproute2 --" + @IPROUTE@ addr show | grep -v valid_lft + @IPROUTE@ route show + @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g' + else + echo "-- linux / ifconfig --" + LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)" + LANG=C @NETSTAT@ -rn -4 -6 + fi + ;; FreeBSD|NetBSD|Darwin) echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --" @IFCONFIG@ -a | egrep "(flags=|inet)" @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' - return ;; OpenBSD) echo "-- OpenBSD --" @IFCONFIG@ -a | egrep "(flags=|inet)" | \ sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//' @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }' - return ;; SunOS) echo "-- Solaris --" @IFCONFIG@ -a | egrep "(flags=|inet)" @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' - return ;; AIX) echo "-- AIX --" @IFCONFIG@ -a | egrep "(flags=|inet)" @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }' - return ;; + *) + echo "get_ifconfig_route(): no idea how to get info on your OS (`uname -s`). FAIL." >&2 + exit 20 + ;; esac - echo "get_ifconfig_route(): no idea how to get info on your OS. FAIL." >&2 - exit 20 + # another round of per-platform information gathering, for DNS info + # for most of the platforms "cat /etc/resolv.conf" is good enough + # except Linux and MacOS + case $UNAME in + Linux) + if [ -x /usr/bin/resolvectl ] ; then + echo "-- linux resolvectl --" + resolvectl status + else + echo "-- linux resolv.conf --" + cat /etc/resolv.conf + fi + ;; + Darwin) + echo "-- MacOS scutil --dns" + scutil --dns + ;; + *) + echo "-- resolv.conf --" + cat /etc/resolv.conf + ;; + esac } # ----------------------------------------------------------