From patchwork Tue Jun 18 06:34:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 759 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id MLRdDiwTCV25eAAAIUCqbw for ; Tue, 18 Jun 2019 12:37:00 -0400 Received: from proxy8.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id 6KQ1CywTCV0qVwAAovjBpQ ; Tue, 18 Jun 2019 12:37:00 -0400 Received: from smtp24.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.iad3b.rsapps.net with LMTP id oB05BCwTCV2SIwAAoCsc3g ; Tue, 18 Jun 2019 12:37:00 -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: smtp24.gate.iad3b.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: 4ac417b6-91e7-11e9-b634-525400892b35-1-1 Received: from [216.105.38.7] ([216.105.38.7:60902] helo=lists.sourceforge.net) by smtp24.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 98/3A-12519-B23190D5; Tue, 18 Jun 2019 12:36:59 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hdH5J-0000zM-67; Tue, 18 Jun 2019 16:35:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hdH5G-0000z2-P5 for openvpn-devel@lists.sourceforge.net; Tue, 18 Jun 2019 16:35:46 +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=QJzoauysEa+BXxh6whAVbr6i1jm1WheXLqz/FByeFUE=; b=FE87Y1X3jOnnnmvO4KXr34ydLz 663b65L3VoWFoyo+4o59jWrQIXmC78+KlqYiBHIMcZOYmxlmRELtw7j92v3VofowX1P4L35944Y4O xP9I3i2f/cRuYjBO0XRJHjVCKU92AQOYEB+Y0NE8z1ty70zANeqRzdY4WDILIstoqaLc=; 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=QJzoauysEa+BXxh6whAVbr6i1jm1WheXLqz/FByeFUE=; b=Z xk26MDD7OyiGpzOPinBsiJb7kNEHVugXT9TqsSO3rRX/M4Y81YVtVOGI4FkorbDEwjBTCrIFjKom2 X192a4bgszgrCK664pJkiSlZjQLER6Tjos/2hjGpd4lmi+3are8cKaC4BUIMc60WaqNUkezBdzhUl N7R8yX0qteK33kUc=; 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.90_1) id 1hdH5D-003GGJ-PI for openvpn-devel@lists.sourceforge.net; Tue, 18 Jun 2019 16:35:45 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Tue, 18 Jun 2019 18:34:35 +0200 Message-Id: <20190618163435.26431-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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] 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: makefile.am] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1hdH5D-003GGJ-PI Subject: [Openvpn-devel] [PATCH v2] t_net.sh: fixes for the networking test script 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 From: Antonio Quartulli 1) Building the networking unit-test when SITNL is not enabled does not make much sense right now. Make compilation dependent on having SITNL configured. 2) Remove some no-op mock_msg function calls. 3) Remove obsolete comment and declarations Signed-off-by: Antonio Quartulli Acked-by: David Sommerseth --- Changes from v1: - get rid of LD_LIBRARY_PATH: consensus is to have cmocka installed system-wide tests/t_net.sh | 6 +----- tests/unit_tests/openvpn/Makefile.am | 2 ++ tests/unit_tests/openvpn/test_networking.c | 16 ---------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/tests/t_net.sh b/tests/t_net.sh index 70e8517d..18799d12 100755 --- a/tests/t_net.sh +++ b/tests/t_net.sh @@ -4,9 +4,6 @@ IFACE="dummy0" UNIT_TEST="./unit_tests/openvpn/networking_testdriver" MAX_TEST=${1:-7} -KILL_EXEC=`which kill` -CC=${CC:-gcc} - srcdir="${srcdir:-.}" top_builddir="${top_builddir:-..}" openvpn="${top_builddir}/src/openvpn/openvpn" @@ -99,8 +96,7 @@ fi # Ensure PREFER_KSU is in a known state PREFER_KSU="${PREFER_KSU:-0}" -# make sure we have permissions to run ifconfig/route from OpenVPN -# can't use "id -u" here - doesn't work on Solaris +# make sure we have permissions to run the networking unit-test ID=`id` if expr "$ID" : "uid=0" >/dev/null then : diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index e61c57c4..d015b293 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -78,6 +78,7 @@ tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \ $(openvpn_srcdir)/platform.c \ $(openvpn_srcdir)/run_command.c +if HAVE_SITNL networking_testdriver_CFLAGS = @TEST_CFLAGS@ \ -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) \ $(OPTIONAL_CRYPTO_CFLAGS) @@ -92,3 +93,4 @@ networking_testdriver_SOURCES = test_networking.c mock_msg.c \ $(openvpn_srcdir)/otime.c \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c +endif diff --git a/tests/unit_tests/openvpn/test_networking.c b/tests/unit_tests/openvpn/test_networking.c index 6c50da92..22d8babe 100644 --- a/tests/unit_tests/openvpn/test_networking.c +++ b/tests/unit_tests/openvpn/test_networking.c @@ -2,13 +2,9 @@ #include "syshead.h" #include "networking.h" -#include "mock_msg.h" - static char *iface = "dummy0"; -#ifdef ENABLE_SITNL - static int net__iface_up(bool up) { @@ -177,8 +173,6 @@ main(int argc, char *argv[]) { int test; - mock_set_debug_level(10); - if (argc < 2) { usage(argv[0]); @@ -223,13 +217,3 @@ main(int argc, char *argv[]) usage(argv[0]); return -1; } - -#else - -int -main(int argc, char *argv[]) -{ - return 0; -} - -#endif /* ENABLE_SITNL */