From patchwork Fri Jul 17 06:02:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1294 X-Patchwork-Delegate: gert@greenie.muc.de Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id mC7kBCTMEV+KNwAAIUCqbw for ; Fri, 17 Jul 2020 12:04:52 -0400 Received: from proxy17.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id KNObBCTMEV8/ZQAAovjBpQ ; Fri, 17 Jul 2020 12:04:52 -0400 Received: from smtp3.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.ord1d.rsapps.net with LMTP id 0ETJAyTMEV/7AgAAWC7mWg ; Fri, 17 Jul 2020 12:04:52 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp3.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 3e76de16-c847-11ea-9662-5254006d4589-1-1 Received: from [216.105.38.7] ([216.105.38.7:45326] helo=lists.sourceforge.net) by smtp3.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 77/72-32040-22CC11F5; Fri, 17 Jul 2020 12:04:51 -0400 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.90_1) (envelope-from ) id 1jwSqM-0001la-CJ; Fri, 17 Jul 2020 16:04:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwSqK-0001lM-Vk for openvpn-devel@lists.sourceforge.net; Fri, 17 Jul 2020 16:04:12 +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:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f6py7b6USUD239G9zluhW/uNayYdeXVAXUijEwvHnK0=; b=eNJEsEVK1a7mv+qlzmdcL8WkpJ Fiw36ueg9yW/TJhvvXwWJk6v8Si5dr16ZAKz3J5WxhH6hcMRu8iG6Iccblob1K1/5aidp4JTiUF6s 8EUNWdLW1WVCNqVZaLDgNrDhPmm+eEbNyrHzN2ewrKtFahere5saNgN1OUdgmRp4JEPM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=f6py7b6USUD239G9zluhW/uNayYdeXVAXUijEwvHnK0=; b=i Rp1Sec6LYGlrFZWD2fitPZfzeaepUIcdYmJQGEAGEuDJ78bGY/BwHpitQvbTdKG+WipmQtMQyLZXL xNUPiNChlS69oFl4blWm8RxBtGpo7AEb8WeN6sc7n7W0XYJaqSgfYJghBH6i1+/Sj6ofqyZwt0OGp yTiiw2K4YpoEmji0=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jwSqJ-007bNI-0O for openvpn-devel@lists.sourceforge.net; Fri, 17 Jul 2020 16:04:12 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 17 Jul 2020 18:02:31 +0200 Message-Id: <20200717160231.12042-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: unstable.cc] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jwSqJ-007bNI-0O Subject: [Openvpn-devel] [PATCH] t_net.sh: drop hard dependency on t_client.rc 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Right now t_net.sh depends on t_client.rc in order to source the RUN_SUDO variable only. However, t_client.rc is something that a few people only have configured and thus this would result in t_net.sh almost never executed even if it just could. Drop dependency on t_client.rc by falling back to RUN_SUDO=sudo when the file is missing. The assignment is made as conditional so that a user can still override RUN_SUDO by speciying an alternate string on the command line. While at it, reword the error message to better match the current logic flow. Signed-off-by: Antonio Quartulli --- tests/t_net.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/t_net.sh b/tests/t_net.sh index c67c3df2..63732db9 100755 --- a/tests/t_net.sh +++ b/tests/t_net.sh @@ -77,9 +77,7 @@ if [ -r "${top_builddir}"/t_client.rc ]; then elif [ -r "${srcdir}"/t_client.rc ]; then . "${srcdir}"/t_client.rc else - echo "$0: cannot find 't_client.rc' in build dir ('${top_builddir}')" >&2 - echo "$0: or source directory ('${srcdir}'). SKIPPING TEST." >&2 - exit 77 + RUN_SUDO="${RUN_SUDO:-sudo}" fi if [ ! -x "$openvpn" ]; then @@ -117,8 +115,7 @@ else if [ -z "$RUN_SUDO" ] then - echo "$0: this test must run be as root, or RUN_SUDO=... " >&2 - echo " must be set correctly in 't_client.rc'. SKIP." >&2 + echo "$0: using t_client.rc, but RUN_SUDO=... is not defined correctly. SKIP. " >&2 exit 77 else # check that we can run the unit-test binary with sudo