From patchwork Wed Feb 8 00:59:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 3063 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp4417765dyk; Tue, 7 Feb 2023 17:00:00 -0800 (PST) X-Google-Smtp-Source: AK7set8T4abOxhmnGSJY1xJTfVf8E0su1nd0yFRlI5WtPzp8DQwhqBFFqDbaINyDLFrizOO56eZz X-Received: by 2002:a05:6a20:6906:b0:be:22c5:92df with SMTP id q6-20020a056a20690600b000be22c592dfmr6122006pzj.16.1675818000609; Tue, 07 Feb 2023 17:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675818000; cv=none; d=google.com; s=arc-20160816; b=gY9CE4uu1sJexSpWBoUGH7zbpVmXoNh+JrWbjRvd4T4MPeW9rn7DX6yuy88Xn9+hs2 p1BJ2D42jV578EXNf6yDxoGYG+wNLCYjoYCuIxorQobP3y/oba7oxmRyQSuIG1U2YfZP qN9vTk9GJ4zblLOBkYtApo9uUWm9KlW+GJH8RTjyp6r9c3xxkcsOORvwz8li55CfaM5X PLF2IdUdcNHJnGTYkHnl0r1ewffWwaDpK/6MIYg5Nu8EmiWnungKhUIcJHT2s2Z24Xb6 XMRiFv0/zMCCi7j/YC8CqJxONO6SPVsYIQ/n6VLFhIa2EgNngSl5sdBAQs9QYHsvRA0f d2LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=12CcXyb4DhmBhrsf3bo8+pR3zBofaTFoveqWUxep00M=; b=tdOSpyUnz4c32QWbUs/vuzdQV1yf2xiyZVM5pWUZVxyo3OOwjbeb9UxMJ7XTBOc45D bfF9ECpP87/ZaUgfwI0cErg24iUuE/ak0Kdp27fDDPCn430tT8DyKDXv5CF1oZ7hI1Kb nJMRIHnmwLoUc+vg5hBEDrg9aamx2Ivz2nbFenhCZQA1q0c5x8e0LuwWlAULqlFIoCUD 6zVvwV9obVlApRlQz8pknEMDBFqLDeY1ZEtd7h/6bpoVqPGal7p/ACGeS6v0+EwISwqZ +iuTZxgthjwWwitz4mHiX1JKnlP55ERcadBSni0R/A0jbYl1HryFp4keIRxCyhmyuARj C+ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Xd8aip2i; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=jYUj8LUt; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=JXcxGaYS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id p18-20020a170902e75200b001965837f633si17700842plf.428.2023.02.07.17.00.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2023 17:00:00 -0800 (PST) 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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Xd8aip2i; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=jYUj8LUt; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=JXcxGaYS; 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=QUARANTINE dis=NONE) header.from=gmail.com 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 1pPYoI-0000cv-US; Wed, 08 Feb 2023 00:59:41 +0000 Received: from [172.30.20.202] (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 1pPYoF-0000bp-QP for openvpn-devel@lists.sourceforge.net; Wed, 08 Feb 2023 00:59:38 +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: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=H2MuANlSr8osP0k8XsRBzQ5sQUj+PKHX6eXleoYmd5I=; b=Xd8aip2iCOU4seQLhhk4WKPdGO dtNT+iD90naKSWsgOzSl4BDQHkKZ1Q2toUu9GMtpLwfA136DWD0C7d8adVh0BXbab/OeRjVwbQFVY Xj+gVAFOk5kwG6PvcHHz+MO9KMwVnIIVgx5rA3tsz2b6P3Ta6HqmQ5nnEylnkDu6t0kQ=; 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: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=H2MuANlSr8osP0k8XsRBzQ5sQUj+PKHX6eXleoYmd5I=; b=jYUj8LUtnRqVUOUkNknwLEKvSw /dxItQgIhlk1Q+13yBUQx2errE5BiIMSlvClAbQtqpcUk4FdHwlRmKWRaSMP3OfC1KfbonPqpvmhD d3KviHiIm6yoL6Cz16ck/ozgAcGeOktVCE2R+0/uIKcxxPRaZMmYl3QNOcNkERNytBiY=; Received: from mail-io1-f54.google.com ([209.85.166.54]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1pPYo9-0004W5-T9 for openvpn-devel@lists.sourceforge.net; Wed, 08 Feb 2023 00:59:38 +0000 Received: by mail-io1-f54.google.com with SMTP id 65so6378349iou.3 for ; Tue, 07 Feb 2023 16:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H2MuANlSr8osP0k8XsRBzQ5sQUj+PKHX6eXleoYmd5I=; b=JXcxGaYSi9hbqGEBSG6IG2IRccF4rt/GiQVL2yaTGwMb6tpvYLw1NCJJsQUX91tq5i eg4rUm+OGIKqIShUCghhvXwg6UfcrCOKffonAMS02C/WZVPNcxC6U/5vHrJPcZL6IHcJ HIyloqf6eom6e0u1NJJX3oIgiPExBYdqfO0lBVtYAalNeNMDuHV1AAvHS8bbSKeB0qha BjN/WNZ7VXwJ0QtpVp/H4E2hSGgfwQM00UQUyUfaH3iFXS4MxiNIeswPHQ1/2U69BFYO nh1HlvNlXtBDjlBDV8Mki+6yoGxoJaSLuEdj/YyUTM5fPss2Fbi62m3Vkqxu9HFIYnC+ VUmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H2MuANlSr8osP0k8XsRBzQ5sQUj+PKHX6eXleoYmd5I=; b=SdXM3T3h1byJyjCYEjPJcGcrPuRESzn7uji6NJ/7oj7t+eC4I/wJ0q5xgfTzZOZNYH jumyzsFd7VRKxBoDpg/IOo56P5S9XBi1bkjKWBLgPmnGQezx93IPXjzDcMWuDsLgOfT2 JPjnZixv7Gk+HLK/nxb/8J4JId9F4AJetOnCHylTbVINTKnY9I9UuPlxjKYryTSWsCle i2QIz/KRrdB4Oj8XZohklZtlGJQdCC7Z+2fHrcqI2jI8Qw3/xbB1lqaGChOhqqktSIU5 jcuGJnbh/T0A3EuJEusQ97FKpKbi+4hDPGwRJOivUCdCmMzW/MLRG8831wywWmGR0dFH OXNQ== X-Gm-Message-State: AO0yUKX/GY6bKcbvTJ2wO6eC2rvuz+cxENEWnKuW1D6KFCNgl8W/G77E i7jApccODDtJi8JzdARUu30ELlsuJnU= X-Received: by 2002:a6b:ed05:0:b0:716:8f6a:f480 with SMTP id n5-20020a6bed05000000b007168f6af480mr4114583iog.0.1675817968824; Tue, 07 Feb 2023 16:59:28 -0800 (PST) Received: from uranus.sansel.ca (bras-vprn-tnhlon4053w-lp130-01-70-51-222-66.dsl.bell.ca. [70.51.222.66]) by smtp.gmail.com with ESMTPSA id q13-20020a5d9f0d000000b0071852ebe7e4sm4327758iot.36.2023.02.07.16.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 16:59:28 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Feb 2023 19:59:25 -0500 Message-Id: <20230208005925.393200-1-selva.nair@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230208001819.244694-3-arne@rfc2549.org> References: <20230208001819.244694-3-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: -0.2 (/) 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: From: Selva Nair - Minor changes to the build system to include some dependencies for Windows build - test_tls_crypt not built as it will pull in win32.c and its dependencies Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.54 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1pPYo9-0004W5-T9 Subject: [Openvpn-devel] [PATCH v3 2/3] Build unit tests in mingw Windows build 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?1757219979451623019?= X-GMAIL-MSGID: =?utf-8?q?1757222536009692598?= From: Selva Nair - Minor changes to the build system to include some dependencies for Windows build - test_tls_crypt not built as it will pull in win32.c and its dependencies - If cross-compiling, "make check" will only build the tests but not run any. Copy to Windows and run manually. Executables are in /tests/unit_tests/openvpn/.libs/ and these depend on cmocka.dll in addition to openssl libs that some tests link to. Building with mingw on Windows should run the tests (untested). v2: networking_testdriver was mistakenly enabled to run, while originally it was only set to build. Corrected. v3: exclude check_engine_keys.sh when cross-compiling As suggested by Arne Schwabe Signed-off-by: Selva Nair Acked-By: Arne Schwabe --- configure.ac | 2 ++ tests/Makefile.am | 2 ++ tests/unit_tests/engine-key/Makefile.am | 2 ++ tests/unit_tests/example_test/Makefile.am | 2 ++ tests/unit_tests/openvpn/Makefile.am | 28 +++++++++++++++++++---- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 95d795c3..66ba6f38 100644 --- a/configure.ac +++ b/configure.ac @@ -364,6 +364,8 @@ case "$host" in ;; esac +AM_CONDITIONAL([CROSS_COMPILING], test "${cross_compiling}" = "yes") + PKG_PROG_PKG_CONFIG AC_PROG_CPP AC_PROG_INSTALL diff --git a/tests/Makefile.am b/tests/Makefile.am index 87dd7e17..a46f2573 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,10 +14,12 @@ MAINTAINERCLEANFILES = \ SUBDIRS = unit_tests +if !WIN32 test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh if HAVE_SITNL test_scripts += t_net.sh endif +endif TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)" TESTS = $(test_scripts) diff --git a/tests/unit_tests/engine-key/Makefile.am b/tests/unit_tests/engine-key/Makefile.am index 24622251..0c288857 100644 --- a/tests/unit_tests/engine-key/Makefile.am +++ b/tests/unit_tests/engine-key/Makefile.am @@ -12,7 +12,9 @@ TESTS_ENVIRONMENT = srcdir="$(abs_srcdir)"; \ top_srcdir="$(top_srcdir)"; \ export srcdir builddir top_builddir top_srcdir; +if !CROSS_COMPILING TESTS = check_engine_keys.sh +endif check_engine_keys.sh: $(conffiles) CLEANFILES = \ diff --git a/tests/unit_tests/example_test/Makefile.am b/tests/unit_tests/example_test/Makefile.am index 04a5ad35..24eb0ba1 100644 --- a/tests/unit_tests/example_test/Makefile.am +++ b/tests/unit_tests/example_test/Makefile.am @@ -2,7 +2,9 @@ AUTOMAKE_OPTIONS = foreign check_PROGRAMS = example_testdriver example2_testdriver +if !CROSS_COMPILING TESTS = $(check_PROGRAMS) +endif example_testdriver_CFLAGS = @TEST_CFLAGS@ example_testdriver_LDFLAGS = @TEST_LDFLAGS@ diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index 7720a85d..8d2386e0 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -7,14 +7,22 @@ test_binaries += argv_testdriver buffer_testdriver endif test_binaries += crypto_testdriver packet_id_testdriver auth_token_testdriver ncp_testdriver misc_testdriver \ - pkt_testdriver + pkt_testdriver if HAVE_LD_WRAP_SUPPORT +if !WIN32 test_binaries += tls_crypt_testdriver endif +endif test_binaries += provider_testdriver +if WIN32 +LDADD = -lws2_32 +endif + +if !CROSS_COMPILING TESTS = $(test_binaries) +endif check_PROGRAMS = $(test_binaries) if HAVE_SITNL @@ -31,12 +39,14 @@ argv_testdriver_SOURCES = test_argv.c mock_msg.c mock_msg.h \ mock_get_random.c \ $(openvpn_srcdir)/platform.c \ $(openvpn_srcdir)/buffer.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/argv.c buffer_testdriver_CFLAGS = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir) buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line buffer_testdriver_SOURCES = test_buffer.c mock_msg.c mock_msg.h \ mock_get_random.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/platform.c crypto_testdriver_CFLAGS = @TEST_CFLAGS@ \ @@ -51,6 +61,7 @@ crypto_testdriver_SOURCES = test_crypto.c mock_msg.c mock_msg.h \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c \ $(openvpn_srcdir)/mtu.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/mss.c packet_id_testdriver_CFLAGS = @TEST_CFLAGS@ \ @@ -63,14 +74,14 @@ packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c mock_msg.h \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c \ $(openvpn_srcdir)/reliable.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/session_id.c - pkt_testdriver_CFLAGS = @TEST_CFLAGS@ \ -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@ pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \ -$(openvpn_srcdir)/argv.c \ + $(openvpn_srcdir)/argv.c \ $(openvpn_srcdir)/base64.c \ $(openvpn_srcdir)/buffer.c \ $(openvpn_srcdir)/crypto.c \ @@ -84,9 +95,10 @@ $(openvpn_srcdir)/argv.c \ $(openvpn_srcdir)/run_command.c \ $(openvpn_srcdir)/session_id.c \ $(openvpn_srcdir)/ssl_pkt.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/tls_crypt.c - +if !WIN32 tls_crypt_testdriver_CFLAGS = @TEST_CFLAGS@ \ -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@ \ @@ -106,6 +118,7 @@ tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c \ $(openvpn_srcdir)/run_command.c +endif if HAVE_SITNL networking_testdriver_CFLAGS = @TEST_CFLAGS@ \ @@ -136,6 +149,7 @@ provider_testdriver_SOURCES = test_provider.c mock_msg.c \ $(openvpn_srcdir)/buffer.c \ $(openvpn_srcdir)/base64.c \ mock_get_random.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/platform.c auth_token_testdriver_CFLAGS = @TEST_CFLAGS@ \ @@ -152,6 +166,7 @@ auth_token_testdriver_SOURCES = test_auth_token.c mock_msg.c \ $(openvpn_srcdir)/otime.c \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/base64.c @@ -169,6 +184,8 @@ ncp_testdriver_SOURCES = test_ncp.c mock_msg.c \ $(openvpn_srcdir)/otime.c \ $(openvpn_srcdir)/packet_id.c \ $(openvpn_srcdir)/platform.c \ + $(openvpn_srcdir)/win32-util.c \ + $(compat_srcdir)/compat-strsep.c \ $(openvpn_srcdir)/ssl_util.c misc_testdriver_CFLAGS = @TEST_CFLAGS@ \ @@ -177,8 +194,9 @@ misc_testdriver_CFLAGS = @TEST_CFLAGS@ \ misc_testdriver_LDFLAGS = @TEST_LDFLAGS@ misc_testdriver_SOURCES = test_misc.c mock_msg.c \ - mock_get_random.c \ + mock_get_random.c \ $(openvpn_srcdir)/buffer.c \ $(openvpn_srcdir)/options_util.c \ $(openvpn_srcdir)/ssl_util.c \ + $(openvpn_srcdir)/win32-util.c \ $(openvpn_srcdir)/platform.c