From patchwork Thu Nov 21 16:55:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3951 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1b0d:b0:5db:37e7:e801 with SMTP id cv13csp447085mab; Thu, 21 Nov 2024 08:55:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU0U0MRTwxIItX9e3/6xptX6vvsQ5L2nRhMnwNTgWXZc/GiFzbwaALIGnfDrxUNhGV1PQbTd0/ntkA=@openvpn.net X-Google-Smtp-Source: AGHT+IGI7bB7LCqYaijrk7Tv+odyzOTy6IxiicnO+U+0r9eVjzF/+4zbx1XX6P9/j5N1i6cNaSNx X-Received: by 2002:a05:6871:3808:b0:295:eb24:71cf with SMTP id 586e51a60fabf-296d9ae3455mr8714821fac.2.1732208152494; Thu, 21 Nov 2024 08:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732208152; cv=none; d=google.com; s=arc-20240605; b=GbLaidkvCZIgorpfgPeOQAOj7UgGBcZ2uVj9bw2pIjZd05jp4LnGRSVaF0sROYkDvO 3j8FJ9KRGQ5zQattajkynYGuy6+qdsDAIMwXo8JBwOzrrUvmvFkIHN/pqlw9mFPQCFkh MN2DVNWUsAAIt5ZemGCVhQcpsQHl33XU2MMGVIt0RQOlwXRGDRSur/A7FjLxebAaIkkn ipw5nmM69pgXIPWhcb2MGs+g36CAeYaS2DgJ81/siMVQI7UraU8z81d6pLZUR1d/qGNb zWQB1ui36vbhAeVRB6umkriKX7heap4Rm6HCKk5s6YRFzyWVvQqBxHlLi6aoVU48bqUU nP5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=PITl2TlVfR62vOt8XyGKayHvB8tlhm3SRzjAiavX+u0=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=YOTWCGHodbZrB/pUJGmEfpx0bKVZcoo0MZ0r9zx50aw0QbRQW3NzL7qqupm7TJio8+ a+jUWR1ACYWsgrMOjJM0BtouLY0XaB3/gQs16WqJ622sQSK4lwrY7jdFWuv3ilM0bXMt 9MIaoT9uQWQX9fUuLJBPrUF2yx9BilVGkeKrdEStHW8z8cyQNZzg+wijUF4/E+RZCzUl 5tWkRz4DcJOSv/fUjJz6458eIwyM/19L+GMrH04+hUgz5zPGL0bFHYHJ5kuZgQ5t34Xs I/W4dW3MBtPWxuI6QHdsgmtEww6VsSSm+wmjtTpYZWbvTKZR5MYCFvqn5gL8swZ1V7as 3jHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ltl9yn9U; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Pdu9bwvY; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=gwzbtd5d; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-2971d5cef2esi5232fac.105.2024.11.21.08.55.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2024 08:55:52 -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=ltl9yn9U; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Pdu9bwvY; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=gwzbtd5d; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tEASu-0005th-FQ; Thu, 21 Nov 2024 16:55:35 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tEASs-0005ta-LI for openvpn-devel@lists.sourceforge.net; Thu, 21 Nov 2024 16:55:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=w/t/N/TEhqZbe/4X1GJOLQt1EQjTBhM7sCs5wnuAKas=; b=ltl9yn9Uj5Z8AGns7IxI1bhwiq 0ZX+fhrAtA1jb2NW7yQL8ya4legkJSOqB69g6Tj+LbyA2b9umvPeBQMH8fPJwCW7BM495uQ3FSbNY 81ywGfNTSGKOirK6i6kI6jTYqgrL6WxkR/1rVr2UM2kii/Uas5GbRTlMJRlnUcfixRyM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=w/t/N/TEhqZbe/4X1GJOLQt1EQjTBhM7sCs5wnuAKas=; b=P du9bwvY3EZDXLf5h8ina6QPq/v+c3fzfrjmqro+ykT6FTwfSGLvRg+o3j9a/c5L2n/+HZOKdvSZkG kXo2acVUhR4ZbIXUU8OAtH/nB11D2MVQ5zb49oGjKIk1OPsucZifjziN000ZHyrz4ewJrkEQn71zH N3frbo2d4oveVc+k=; Received: from mail-wm1-f47.google.com ([209.85.128.47]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tEASq-0006Bg-00 for openvpn-devel@lists.sourceforge.net; Thu, 21 Nov 2024 16:55:33 +0000 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4315f24a6bbso9013395e9.1 for ; Thu, 21 Nov 2024 08:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1732208120; x=1732812920; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=w/t/N/TEhqZbe/4X1GJOLQt1EQjTBhM7sCs5wnuAKas=; b=gwzbtd5d2eZqFXiHT6KBXExNTKqWFEK8f4z5Ca5JcyZFhymitaq6O2HCjwgvjWVlQU jrW4yuG1685B12OvtMKasrKMTCBSUt1/KHG0uTdvuzGxofMFTthQoPnaebp9d+f7XL5a +X2VkNevskusOOkD63pKMiGQo/UKA7gxcHFf2Vuhmvl4Uk58hRFoTySIgTks+zuYsGjM YZz23Ca6qKJvbgtJ5sDhWd5UZsJK1W7ErwkrsWNNHJ6atzA/CUv/bO3RHDNhAbdk5RyI SowhihxI4egXhT7xBlaOVNX3k0QOO3lFCVtqzJ9pfw93+ga/9lPOEsFglMYxx+9oi6mD gjdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732208120; x=1732812920; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w/t/N/TEhqZbe/4X1GJOLQt1EQjTBhM7sCs5wnuAKas=; b=cD6pX6ga1S7b12Pkrl9/Ed3yDXbK/7nPF/fvy9G7Pf7RAqCidd6VRdcWfmVOgTgsbn JTt5w6lqbmVJbt5H7zTibx3+Thyonft4ihpM9mWAQERbaIP0aAXg2PqHxwAIAO9HdYns n9mdXAoGegJqNwwDjwJqRxcvyoc5BDTNRyRca99vJ5iPXaCkv698ab5VC4T95aKbxYsQ 6nt1eiR3KAn73vV0MeBdiQ3mLoey3uZDMxDeQGaHaW/X73KC9GEsFcMmhnns1nBXbshY E66DiUo08vGps36QJ8EjFVNdh9rIqPzYXRMX3SGgAIsD3AxJR5uj8z8sdv9axilUt4V2 v7Cw== X-Gm-Message-State: AOJu0YxdvF82S4aukudicZedxWO6NoCqpDSK92bAJuj+nQZYaB1jleRC j+B34iJ05yQSxXyTg48bzZV2IWww/l/cExgUD5h6toJ8AUMtp9/2nToJHGQ7/5N7zP4d+FY6xA3 l X-Gm-Gg: ASbGncvFI29ih8C3U5kKYgoieD/u/0RBg94K5HLsB8CUNVJoZ8IJrqkEBzu8785zP7p 6cVK8fgPt0Ez5Xo6SY7mE+mZn0nnbNJuMJglfP54U6I1tqbjLXpNgyv9cDcoTWsywjfdQCHzGTw jwvDtB9XItWPQQHUuYKL9LezIsWvjdg9CPD2t2SkWaGbRh7M0dkEBgFXWt6OXXFsP71vo9ahkvO 0bJo2E4y7GTl1SSL3v25eeQdfx5WUx7dPWTdbl30HWe0KhqXnaNdyKhhK7C0uI6wYtLUsL90VI1 TB+tME59Kpt1VSldaO9G0pb6nVJgLT/B9885khiaPg== X-Received: by 2002:a05:600c:3b9d:b0:42f:823d:dde9 with SMTP id 5b1f17b1804b1-4334f01fd05mr60934945e9.21.1732208120161; Thu, 21 Nov 2024 08:55:20 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fbedce3sm9195f8f.97.2024.11.21.08.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 08:55:19 -0800 (PST) From: "mattock (Code Review)" X-Google-Original-From: "mattock (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 21 Nov 2024 16:55:19 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ie63f302402f469c3aa48ac146ca6b8c029f0d250 X-Gerrit-Change-Number: 811 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: f0e96b30c9877f229f72af3f35e39093c9e57028 References: Message-ID: <9375fbe632258a631b9d82979bc18e9f118f75cd-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.47 listed in sa-accredit.habeas.com] 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. [209.85.128.47 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.47 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tEASq-0006Bg-00 Subject: [Openvpn-devel] [M] Change in openvpn[master]: WIP: lwip support to t_server_null 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: , Reply-To: samuli@openvpn.net, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1816351895787639473?= X-GMAIL-MSGID: =?utf-8?q?1816351895787639473?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/811?usp=email to review the following change. Change subject: WIP: lwip support to t_server_null ...................................................................... WIP: lwip support to t_server_null Change-Id: Ie63f302402f469c3aa48ac146ca6b8c029f0d250 Signed-off-by: Samuli Seppänen --- M doc/t_server_null.rst A tests/lwip_client_up.sh M tests/t_server_null_client.sh M tests/t_server_null_default.rc 4 files changed, 144 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/11/811/1 diff --git a/doc/t_server_null.rst b/doc/t_server_null.rst index 5fe9080..022793a 100644 --- a/doc/t_server_null.rst +++ b/doc/t_server_null.rst @@ -16,7 +16,7 @@ * Parallelized for fairly high performance * Mostly operating-system agnostic -* Tested on Fedora Linux 38/39/40 and FreeBSD 14 +* Tested on Fedora Linux 38/39/40, FreeBSD 14, NetBSD 10.0 and OpenBSD 7.5 * POSIX-compliant * Tested and known to work with Bash, Dash, Ksh, Yash and FreeBSD's default /bin/sh * Uses the sample certificates and keys @@ -31,6 +31,7 @@ * Test cases (client configurations) and server setups (server configurations) are stored in a configuration file, i.e. data and code have been separated * Configuration file format is nearly identical to t_client.rc configuration * Supports a set of default tests, overriding default test settings and adding local tests +* Supports client ping tests if ovpnlwip is available Prerequisites ------------- @@ -60,8 +61,9 @@ #. Server instances start #. Brief wait #. Client instances start -#. Tests run +#. ovpnlwip ping tests run #. Client instances stop +#. Test results are collected #. Brief wait #. Server instances stop @@ -77,7 +79,8 @@ * t_server_null_client.sh - * Waits until servers have launched. Then launch all clients, wait for them to exit and then check test results by parsing the client log files. Each client kills itself after some delay using an "--up" script. + * Waits until servers have launched. Then launch all clients, run ovpnlwip ping tests (if any), wait for clients to exit and then check test results by parsing the client log files. Each client kills itself after some delay using an "--up" script. + Configuration ------------- @@ -116,6 +119,19 @@ TEST_RUN_LIST="1 2 5 9" +Client ping tests that use ovpnlwip can be added similarly: + + TEST_NAME_9L="t_server_null_client.sh-openvpn_current_udp_custom_lwip" + SHOULD_PASS_9L="yes" + CLIENT_EXEC_9L="${CLIENT_EXEC}" + CLIENT_CONF_9L="${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1194 udp --proto udp" + +Note that all ovpnlwip test names need to include a "_lwip" suffix: without if +ping tests won't get activated. Also note that the *tests* directory needs to +have the lwipovpn executable or ovpnlwip tests will get skipped. The ovpnlwip +ping tests get the IP addresses to ping from the \*.ips files created by the +lwip_client_up.sh script --up script. + Stress-testing the --dev null test suite ---------------------------------------- diff --git a/tests/lwip_client_up.sh b/tests/lwip_client_up.sh new file mode 100755 index 0000000..0ab6736 --- /dev/null +++ b/tests/lwip_client_up.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Add this client's IP to a file +if ! grep "$ifconfig_local" ./$test_name.ips; then + echo -n "$ifconfig_local " >> ./$test_name.ips +fi + +# Determine the OpenVPN PID from its pid file. This works reliably even when +# the OpenVPN process is backgrounded for parallel tests. +MY_PPID=`cat $pid` + +# Allow OpenVPN to finish initializing while waiting in the background and then +# killing the process gracefully. Also wait for fping tests to finish. +(sleep 5 + +count=0 +maxcount=15 +while [ $count -le $maxcount ]; do + if pgrep fping > /dev/null 2>&1; then + echo "Waiting for fping to exit ($count/$maxcount)" + count=$(( count + 1)) + sleep 1 + else + echo "fping not running anymore" + break + fi +done + +kill -15 $MY_PPID +) & diff --git a/tests/t_server_null_client.sh b/tests/t_server_null_client.sh index 2210e63..98e7985 100755 --- a/tests/t_server_null_client.sh +++ b/tests/t_server_null_client.sh @@ -1,5 +1,17 @@ #!/bin/sh +should_run_test() { + test_name="$1" + + if echo "$test_name"|grep _lwip > /dev/null 2>&1; then + if [ "$has_lwipovpn" = "no" ]; then + return 1 + fi + fi + + return 0 +} + launch_client() { test_name=$1 log="${test_name}.log" @@ -13,10 +25,45 @@ "${client_exec}" \ $client_conf \ --writepid "${pid}" \ - --setenv pid $pid \ + --setenv pid "$pid" \ + --setenv test_name "$test_name" \ --log "${t_server_null_logdir}/${log}" & } +ping_lwip_clients() { + if [ "$has_lwipovpn" = "yes" ]; then + lwip_client_count=$(echo "$lwip_test_names"|wc -w|tr -d " ") + else + lwip_client_count=0 + fi + + if [ $lwip_client_count -eq 0 ]; then + return 0 + fi + + count=0 + maxcount=10 + while [ $count -le $maxcount ]; do + lwip_client_ips=$(cat ./*.ips 2>/dev/null|wc -w|tr -d " ") + if [ $lwip_client_ips -lt $lwip_client_count ]; then + echo "Waiting for LWIP clients to start up ($count/$maxcount)" + count=$(( count + 1)) + sleep 1 + else + echo "$lwip_client_ips/$lwip_client_count LWIP clients up" + break + fi + done + + LWIP_CLIENTS=$(cat ./*.ips 2>/dev/null) + if [ "$LWIP_CLIENTS" ]; then + if ! fping -c 5 $LWIP_CLIENTS; then + echo "ERROR: pinging one or more openvpnlwip client IP addresses failed!" + retval=1 + fi + fi +} + wait_for_results() { tests_running="yes" @@ -77,7 +124,7 @@ server_max_wait=15 while [ $count -lt $server_max_wait ]; do servers_up=0 - server_count=$(echo $TEST_SERVER_LIST|wc -w) + server_count=$(echo "$TEST_SERVER_LIST"|wc -w|tr -d " ") # We need to trim single-quotes because some shells return quoted values # and some don't. Using "set -o posix" which would resolve this problem is @@ -85,8 +132,8 @@ # # While inactive server configurations may get checked they won't increase # the active server count as the processes won't be running. - for i in `set|grep 'SERVER_NAME_'|cut -d "=" -f 2|tr -d "[\']"`; do - server_pid=$(cat $i.pid 2> /dev/null) + for i in $(set|grep 'SERVER_NAME_'|cut -d "=" -f 2|tr -d "[\']"); do + server_pid=$(cat "$i.pid" 2> /dev/null) if [ -z "$server_pid" ] ; then continue fi @@ -111,6 +158,18 @@ fi done +# Check for presence of the lwipovpn executable +if test -r ./lwipovpn; then + has_lwipovpn="yes" +else + has_lwipovpn="no" + echo "WARNING: lwipovpn executable is missing: lwip tests will be skipped" +fi + +# Remove existing LWIP client IP files. This is to avoid pinging non-existent +# IP addresses when tests are disabled. +$RUN_SUDO rm -f ./*.ips + # Wait a while to let server processes to settle down sleep 1 @@ -118,6 +177,7 @@ # is used later to determine when all OpenVPN clients have exited and it is # safe to check the test results. test_names="" +lwip_test_names="" for SUF in $TEST_RUN_LIST do eval test_name=\"\$TEST_NAME_$SUF\" @@ -125,9 +185,18 @@ eval client_conf=\"\$CLIENT_CONF_$SUF\" test_names="${test_names} ${test_name}" - (launch_client "${test_name}" "${client_exec}" "${client_conf}") + + if echo "$test_name"|grep _lwip > /dev/null; then + lwip_test_names="${lwip_test_names} ${test_name}" + fi + + if should_run_test "$test_name"; then + (launch_client "${test_name}" "${client_exec}" "${client_conf}") + fi done +ping_lwip_clients + # Wait until all OpenVPN clients have exited (wait_for_results) @@ -137,7 +206,9 @@ eval test_name=\"\$TEST_NAME_$SUF\" eval should_pass=\"\$SHOULD_PASS_$SUF\" - get_client_test_result "${test_name}" "${should_pass}" + if should_run_test "$test_name"; then + get_client_test_result "${test_name}" "${should_pass}" + fi done exit $retval diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc index cbf4877..e10e504 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -28,7 +28,7 @@ MAX_CLIENTS="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3" +SERVER_BASE_OPTS="--daemon --local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" SERVER_CONF_BASE="${SERVER_BASE_OPTS} ${SERVER_CIPHER_OPTS} ${SERVER_CERT_OPTS}" @@ -49,23 +49,37 @@ # Test client configurations CLIENT_EXEC="${top_builddir}/src/openvpn/openvpn" -CLIENT_BASE_OPTS="--client --dev null --ifconfig-noexec --nobind --remote-cert-tls server --persist-tun --verb 3 --resolv-retry infinite --connect-retry-max 3 --server-poll-timeout 5 --explicit-exit-notify 3 --script-security 2 --up ${srcdir}/null_client_up.sh" +CLIENT_BASE_OPTS="--client --nobind --remote-cert-tls server --persist-tun --verb 3 --resolv-retry infinite --connect-retry-max 3 --server-poll-timeout 5 --explicit-exit-notify 3 --script-security 2" +CLIENT_NULL_OPTS="--dev null --ifconfig-noexec --up ${srcdir}/null_client_up.sh" +CLIENT_LWIP_OPTS="--dev null --dev-node unix:lwipovpn --up ${srcdir}/lwip_client_up.sh" + CLIENT_CIPHER_OPTS="" CLIENT_CERT_OPTS="--ca ${CA} --cert ${CLIENT_CERT} --key ${CLIENT_KEY} --tls-auth ${TA} 1" -TEST_RUN_LIST="1 2 3" -CLIENT_CONF_BASE="${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} ${CLIENT_CERT_OPTS}" +TEST_RUN_LIST="1 1L 2 2L 3" +CLIENT_CONF_BASE="${CLIENT_NULL_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} ${CLIENT_CERT_OPTS}" +CLIENT_CONF_BASE_LWIP="${CLIENT_LWIP_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} ${CLIENT_CERT_OPTS}" TEST_NAME_1="t_server_null_client.sh-openvpn_current_udp" SHOULD_PASS_1="yes" CLIENT_EXEC_1="${CLIENT_EXEC}" CLIENT_CONF_1="${CLIENT_CONF_BASE} --remote 127.0.0.1 1194 udp --proto udp" +TEST_NAME_1L="t_server_null_client.sh-openvpn_current_udp_lwip" +SHOULD_PASS_1L="yes" +CLIENT_EXEC_1L="${CLIENT_EXEC}" +CLIENT_CONF_1L="${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1194 udp --proto udp" + TEST_NAME_2="t_server_null_client.sh-openvpn_current_tcp" SHOULD_PASS_2="yes" CLIENT_EXEC_2="${CLIENT_EXEC}" CLIENT_CONF_2="${CLIENT_CONF_BASE} --remote 127.0.0.1 1195 tcp --proto tcp" +TEST_NAME_2L="t_server_null_client.sh-openvpn_current_tcp_lwip" +SHOULD_PASS_2L="yes" +CLIENT_EXEC_2L="${CLIENT_EXEC}" +CLIENT_CONF_2L="${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1195 tcp --proto tcp" + TEST_NAME_3="t_server_null_client.sh-openvpn_current_udp_fail" SHOULD_PASS_3="no" CLIENT_EXEC_3="${CLIENT_EXEC}"