From: "mattock (Code Review)" Date: Fri, 22 Nov 2024 06:40:27 +0000 In-Reply-To: References: Reply-To: samuli@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <5a57d12dfb9760493e4fa5c2217e3b09cc43ee5e-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9Vjw0tRk17Q="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Add lwip support to t_server_null List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --9Vjw0tRk17Q= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, mattock, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/811?usp=3Demail to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: Add lwip support to t_server_null ...................................................................... Add lwip support to t_server_null Change-Id: Ie63f302402f469c3aa48ac146ca6b8c029f0d250 Signed-off-by: Samuli Sepp=C3=A4nen --- 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, 145 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/11/811/3 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 defaul= t /bin/sh * Uses the sample certificates and keys @@ -31,6 +31,7 @@ * Test cases (client configurations) and server setups (server configurati= ons) are stored in a configuration file, i.e. data and code have been separ= ated * Configuration file format is nearly identical to t_client.rc configurati= on * Supports a set of default tests, overriding default test settings and ad= ding 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 f= or 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 ov= pnlwip ping tests (if any), wait for clients to exit and then check test re= sults 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=3D"1 2 5 9" +Client ping tests that use ovpnlwip can be added similarly: + + TEST_NAME_9L=3D"t_server_null_client.sh-openvpn_current_udp_custom_lwip" + SHOULD_PASS_9L=3D"yes" + CLIENT_EXEC_9L=3D"${CLIENT_EXEC}" + CLIENT_CONF_9L=3D"${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: withou= t 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 ovpnl= wip +ping tests get the IP addresses to ping from the \*.ips files created by t= he +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..a07c4b7 --- /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 wh= en +# the OpenVPN process is backgrounded for parallel tests. +MY_PPID=3D`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=3D0 +maxcount=3D15 +while [ $count -le $maxcount ]; do + if pgrep fping > /dev/null 2>&1; then + echo "Waiting for fping to exit ($count/$maxcount)" + count=3D$(( 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..77e1cc5 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=3D"$1" + + if echo "$test_name"|grep -q _lwip; then + if [ "$has_lwipovpn" =3D "no" ]; then + return 1 + fi + fi + + return 0 +} + launch_client() { test_name=3D$1 log=3D"${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" =3D "yes" ]; then + lwip_client_count=3D$(echo "$lwip_test_names"|wc -w|tr -d " ") + else + lwip_client_count=3D0 + fi + + if [ $lwip_client_count -eq 0 ]; then + return 0 + fi + + count=3D0 + maxcount=3D10 + while [ $count -le $maxcount ]; do + lwip_client_ips=3D$(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=3D$(( count + 1)) + sleep 1 + else + echo "$lwip_client_ips/$lwip_client_count LWIP clients up" + break + fi + done + + LWIP_CLIENTS=3D$(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 address= es failed!" + retval=3D1 + fi + fi +} + wait_for_results() { tests_running=3D"yes" @@ -77,7 +124,7 @@ server_max_wait=3D15 while [ $count -lt $server_max_wait ]; do servers_up=3D0 - server_count=3D$(echo $TEST_SERVER_LIST|wc -w) + server_count=3D$(echo "$TEST_SERVER_LIST"|wc -w|tr -d " ") # We need to trim single-quotes because some shells return quoted valu= es # and some don't. Using "set -o posix" which would resolve this proble= m is @@ -85,8 +132,8 @@ # # While inactive server configurations may get checked they won't incr= ease # the active server count as the processes won't be running. - for i in `set|grep 'SERVER_NAME_'|cut -d "=3D" -f 2|tr -d "[\']"`; do - server_pid=3D$(cat $i.pid 2> /dev/null) + for i in $(set|grep 'SERVER_NAME_'|cut -d "=3D" -f 2|tr -d "[\']"); do + server_pid=3D$(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_PATH"; then + has_lwipovpn=3D"yes" +else + has_lwipovpn=3D"no" + echo "WARNING: lwipovpn executable is missing: lwip tests will be skip= ped" +fi + +# Remove existing LWIP client IP files. This is to avoid pinging non-exist= ent +# 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=3D"" +lwip_test_names=3D"" for SUF in $TEST_RUN_LIST do eval test_name=3D\"\$TEST_NAME_$SUF\" @@ -125,9 +185,18 @@ eval client_conf=3D\"\$CLIENT_CONF_$SUF\" test_names=3D"${test_names} ${test_name}" - (launch_client "${test_name}" "${client_exec}" "${client_conf}") + + if echo "$test_name"|grep -q _lwip; then + lwip_test_names=3D"${lwip_test_names} ${test_name}" + fi + + if should_run_test "$test_name"; then + (launch_client "${test_name}" "${client_exec}" "${client_conf}") + fi done =20 +ping_lwip_clients + # Wait until all OpenVPN clients have exited (wait_for_results) @@ -137,7 +206,9 @@ eval test_name=3D\"\$TEST_NAME_$SUF\" eval should_pass=3D\"\$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..cb6a2cd 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -19,6 +19,7 @@ SERVER_CERT=3D"${sample_keys}/server.crt" SERVER_KEY=3D"${sample_keys}/server.key" TA=3D"${sample_keys}/ta.key" +LWIPOVPN_PATH=3D"lwipovpn" # Used to detect if graceful kill of any server instance failed during the= test # run @@ -28,7 +29,7 @@ MAX_CLIENTS=3D"10" CLIENT_MATCH=3D"Test-Client" SERVER_EXEC=3D"${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS=3D"--daemon --local 127.0.0.1 --dev tun --topology subnet= --max-clients $MAX_CLIENTS --persist-tun --verb 3" +SERVER_BASE_OPTS=3D"--daemon --local 127.0.0.1 --dev tun --topology subnet= --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_CIPHER_OPTS=3D"" SERVER_CERT_OPTS=3D"--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SE= RVER_KEY} --tls-auth ${TA} 0" SERVER_CONF_BASE=3D"${SERVER_BASE_OPTS} ${SERVER_CIPHER_OPTS} ${SERVER_CER= T_OPTS}" @@ -49,23 +50,37 @@ # Test client configurations CLIENT_EXEC=3D"${top_builddir}/src/openvpn/openvpn" -CLIENT_BASE_OPTS=3D"--client --dev null --ifconfig-noexec --nobind --remot= e-cert-tls server --persist-tun --verb 3 --resolv-retry infinite --connect-= retry-max 3 --server-poll-timeout 5 --explicit-exit-notify 3 --script-secur= ity 2 --up ${srcdir}/null_client_up.sh" +CLIENT_BASE_OPTS=3D"--client --nobind --remote-cert-tls server --persist-t= un --verb 3 --resolv-retry infinite --connect-retry-max 3 --server-poll-tim= eout 5 --explicit-exit-notify 3 --script-security 2" +CLIENT_NULL_OPTS=3D"--dev null --ifconfig-noexec --up ${srcdir}/null_clien= t_up.sh" +CLIENT_LWIP_OPTS=3D"--dev null --dev-node unix:${LWIPOVPN_PATH} --up ${src= dir}/lwip_client_up.sh" + CLIENT_CIPHER_OPTS=3D"" CLIENT_CERT_OPTS=3D"--ca ${CA} --cert ${CLIENT_CERT} --key ${CLIENT_KEY} -= -tls-auth ${TA} 1" -TEST_RUN_LIST=3D"1 2 3" -CLIENT_CONF_BASE=3D"${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} ${CLIENT_CER= T_OPTS}" +TEST_RUN_LIST=3D"1 1L 2 2L 3" +CLIENT_CONF_BASE=3D"${CLIENT_NULL_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_CIPHE= R_OPTS} ${CLIENT_CERT_OPTS}" +CLIENT_CONF_BASE_LWIP=3D"${CLIENT_LWIP_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_= CIPHER_OPTS} ${CLIENT_CERT_OPTS}" TEST_NAME_1=3D"t_server_null_client.sh-openvpn_current_udp" SHOULD_PASS_1=3D"yes" CLIENT_EXEC_1=3D"${CLIENT_EXEC}" CLIENT_CONF_1=3D"${CLIENT_CONF_BASE} --remote 127.0.0.1 1194 udp --proto u= dp" +TEST_NAME_1L=3D"t_server_null_client.sh-openvpn_current_udp_lwip" +SHOULD_PASS_1L=3D"yes" +CLIENT_EXEC_1L=3D"${CLIENT_EXEC}" +CLIENT_CONF_1L=3D"${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1194 udp --p= roto udp" + TEST_NAME_2=3D"t_server_null_client.sh-openvpn_current_tcp" SHOULD_PASS_2=3D"yes" CLIENT_EXEC_2=3D"${CLIENT_EXEC}" CLIENT_CONF_2=3D"${CLIENT_CONF_BASE} --remote 127.0.0.1 1195 tcp --proto t= cp" +TEST_NAME_2L=3D"t_server_null_client.sh-openvpn_current_tcp_lwip" +SHOULD_PASS_2L=3D"yes" +CLIENT_EXEC_2L=3D"${CLIENT_EXEC}" +CLIENT_CONF_2L=3D"${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1195 tcp --p= roto tcp" + TEST_NAME_3=3D"t_server_null_client.sh-openvpn_current_udp_fail" SHOULD_PASS_3=3D"no" CLIENT_EXEC_3=3D"${CLIENT_EXEC}" -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/811?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie63f302402f469c3aa48ac146ca6b8c029f0d250 Gerrit-Change-Number: 811 Gerrit-PatchSet: 3 Gerrit-Owner: mattock Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: mattock Gerrit-MessageType: newpatchset --9Vjw0tRk17Q= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, mattock, plaisthos.=

mattock uploaded patch set #3 to this change.

View Change<= /a>

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

Add lwip support to t_server_null

Chan= ge-Id: Ie63f302402f469c3aa48ac146ca6b8c029f0d250
Signed-off-by: Samuli S= epp=C3=A4nen <samuli.seppanen@...277...>
---
M doc/t_server_nul= l.rst
A tests/lwip_client_up.sh
M tests/t_server_null_client.sh
M = tests/t_server_null_default.rc
4 files changed, 145 insertions(+), 13 de= letions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/c=
hanges/11/811/3
diff --git a/doc/t_server_null.rst b/doc/t_server_n=
ull.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 agn= ostic
-* Tested on Fedo= ra 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 a= nd 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) an= d server setups (server configurations) are stored in a configuration file,= i.e. data and code have been separated
* Configuration fi= le format is nearly identical to t_client.rc configuration
= * Supports a set of default tests, overriding default test settings and ad= ding local tests
+* S= upports 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 +7= 9,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 c= lient kills itself after some delay using an "--up" script.

+ * Waits until serve= rs 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 clien= t log files. Each client kills itself after some delay using an "--up&= quot; script.
+

Configuration
-------------<= /span>
@@ -116,6 +119,19 @@

T= EST_RUN_LIST=3D"1 2 5 9"

+Client ping tests that use ovpnlwip can b= e added similarly:
+<= /span>
+ TEST_NAME_9L=3D&qu= ot;t_server_null_client.sh-openvpn_current_udp_custom_lwip"
= + SHOULD_PASS_9L=3D"yes&q= uot;
+ CLIENT_EXEC_9= L=3D"${CLIENT_EXEC}"
+ CLIENT_CONF_9L=3D"${CLIENT_CONF_BASE_LWIP} --remote 127.0= .0.1 1194 udp --proto udp"
+
+Note th= at all ovpnlwip test names need to include a "_lwip" suffix: with= out if
+ping tests wo= n't get activated. Also note that the *tests* directory needs to=
+have the lwipovpn executab= le or ovpnlwip tests will get skipped. The ovpnlwip
+ping tests get the IP addresses to ping f= rom the \*.ips files created by the
+lwip_client_up.sh script --up script.
+
Stress-testing the --de= v null test suite
----------------------------------------=

diff --git a/tests/lwip_client_up.sh b/t= ests/lwip_client_up.sh
new file mode 100755
index 0000000..a07c4b7

--- /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_na= me.ips; then
+ ech= o -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=3D`cat $pid`
+
+# Allow OpenVPN to finish initializing while waiting in the backgroun= d and then
+# killing= the process gracefully. Also wait for fping tests to finish.
+(sleep 5

+
+count=3D0
+maxcount=3D15
+whil= e [ $count -le $maxcount ]; do
+ if pgrep fping > /dev/null 2>&1; then
+ echo "Waiting for f= ping to exit ($count/$maxcount)"
+ count=3D$(( count + 1))
+ sleep 1
+ else
+ echo "fping not running anymore"+ break
+ fi
+done
+
+kill -1= 5 $MY_PPID
+) &
diff --git a/tests/t_server_null_client.sh b/tests/t_server_= null_client.sh
index 2210e63..77e1cc5 100755
--- a/tests/t_server_null_client.sh

+++ b/tests/t_server_= null_client.sh
@@ -1,5 +1,17 @@
#!/bin/sh<= /span>

+sh= ould_run_test() {
+ = test_name=3D"$1"
+
+ if ech= o "$test_name"|grep -q _lwip; then
+ if [ "$has_lwipovpn" =3D "n= o" ]; then
+ = return 1
+ = fi
+ fi

+
+ return 0
+}
+
launch_client() {
test_name=3D= $1
log=3D"${test_name}.log"
= @@ -13,10 +25,45 @@
"${client_exec}" \
$client_conf \
--writepid &quo= t;${pid}" \
- = --setenv pid $pid \
+ --setenv test_name "$test_name" \<= /span>
--log "${t_server_null_logdir}/${log}" &= amp;
}

+ping_lwip_clients() {
+ if [ "$has_lwipovpn" =3D "yes&qu= ot; ]; then
+ = lwip_client_count=3D$(echo "$lwip_test_names"|wc -w|tr -d " = ")
+ else
+ lwip_client_cou= nt=3D0
+ fi=
+
+ if [ $lwip_client_count -eq 0 ]; then
+ return 0=
+ fi
+
+ count=3D0
+ maxcount=3D10
+ while [ $count -le $maxcount ]; do
+ lwip_client_ips=3D$(cat ./*.ips 2>/d= ev/null|wc -w|tr -d " ")
+ if [ $lwip_client_ips -lt $lwip_client_count ]; then=
+ echo &q= uot;Waiting for LWIP clients to start up ($count/$maxcount)"+ count=3D$(( count= + 1))
+ s= leep 1
+ else<= /span>
+ echo &qu= ot;$lwip_client_ips/$lwip_client_count LWIP clients up"
+ break

+ fi
+ done
+
+= LWIP_CLIENTS=3D$(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 ad= dresses failed!"
+ retval=3D1
+ fi
+ = fi
+}
+

wait_for_results(= ) {
tests_running=3D"yes"
<= /span>
@@ -77,7 +124,7 @@
server_max_wait=3D15

while [ $count -lt $server_max_wait ]; do
= servers_up=3D0
- = server_count=3D$(echo $TEST_SERVER_LIST|wc -w)
+ server_count=3D$(echo "$TEST_SERVER_LIS= T"|wc -w|tr -d " ")

#= We need to trim single-quotes because some shells return quoted values
# and some don't. Using "set -o posix" whic= h would resolve this problem is
@@ -85,8 +132,8 @@ #
# While inactive server configurations = may get checked they won't increase
# the active s= erver count as the processes won't be running.
- for i in `set|grep 'SERVER_NAME_'|= cut -d "=3D" -f 2|tr -d "[\']"`; do
- server_pid=3D$(cat $i.pid 2&g= t; /dev/null)

+ fo= r i in $(set|grep 'SERVER_NAME_'|cut -d "=3D" -f 2|tr -d = "[\']"); do
+ server_pid=3D$(cat "$i.pid" 2> /dev/null)=
if [ -z "$server_pid" ] ; then
continue
fi
@@ -111,= 6 +158,18 @@
fi
done
=
+# Check for presen= ce of the lwipovpn executable
+if test -r "$LWIPOVPN_PATH"; then
+ has_lwipovpn=3D"yes"=
+else
+ has_lwipovpn=3D"no"<= br>+ echo "WARNING: lwi= povpn executable is missing: lwip tests will be skipped"
+fi
+
+# Remove existing LWIP client IP files. This is to avoid pinging non-= existent
+# IP addres= ses when tests are disabled.
+$RUN_SUDO rm -f ./*.ips
+
# Wait a while to let server processes to se= ttle down
sleep 1

@@ -11= 8,6 +177,7 @@
# is used later to determine when all OpenVP= N clients have exited and it is
# safe to check the test r= esults.
test_names=3D""
+lwip_test_names=3D""
for SUF in $TEST_RUN_LIST
do
eval= test_name=3D\"\$TEST_NAME_$SUF\"
@@ -125,9 +185,= 18 @@
eval client_conf=3D\"\$CLIENT_CONF_$SUF\&qu= ot;

test_names=3D"${test_names}= ${test_name}"
- = (launch_client "${test_name}" "${client_exec}" "= ${client_conf}")
+
+ if echo "= ;$test_name"|grep -q _lwip; then
+ lwip_test_names=3D"${lwip_test_names} ${test= _name}"
+ fi<= /span>
+
+ if should_run_test "$test_name= "; then
+ = (launch_client "${test_name}" "${client_exec}" "$= {client_conf}")
= + fi
done

+ping_lwip_clients
+
# Wait until all OpenVPN client= s have exited
(wait_for_results)
<= br>@@ -137,7 +206,9 @@
eval test_name=3D\"\= $TEST_NAME_$SUF\"
eval should_pass=3D\"\$SHO= ULD_PASS_$SUF\"

- get_client_test_result "${test_name}" "= ${should_pass}"
= + if should_run_test "$test_name"; then
+ get_client_test_result "${te= st_name}" "${should_pass}"
+ fi
done
=
exit $retval
diff --git a/tests/t_server_null_de= fault.rc b/tests/t_server_null_default.rc
index cbf4877..cb= 6a2cd 100755
--- a/tests/t_server_null_default.rc+++ b/tests/t_server_null_default.rc
@@ -19,6 +19,7 = @@
SERVER_CERT=3D"${sample_keys}/server.crt"

SERVER_KEY=3D"${sample_keys}/server.key"
= TA=3D"${sample_keys}/ta.key"
+LWIPOVPN_PATH=3D"lwipovpn"

# Used to detect if graceful kill of any server inst= ance failed during the test
# run
@@ -28,7= +29,7 @@
MAX_CLIENTS=3D"10"
CL= IENT_MATCH=3D"Test-Client"
SERVER_EXEC=3D"$= {top_builddir}/src/openvpn/openvpn"
-SERVER_BASE_OPTS=3D"--daemon --local 127.0.0.1 --de= v tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3&q= uot;
+SERVER_BASE_OPT= S=3D"--daemon --local 127.0.0.1 --dev tun --topology subnet --max-clie= nts $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn"
SERVER_CIPHER_OPTS=3D""
SERVER_CERT_OPTS=3D&q= uot;--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-a= uth ${TA} 0"
SERVER_CONF_BASE=3D"${SERVER_BASE_O= PTS} ${SERVER_CIPHER_OPTS} ${SERVER_CERT_OPTS}"
@@ -49= ,23 +50,37 @@

# Test client configuratio= ns
CLIENT_EXEC=3D"${top_builddir}/src/openvpn/openvpn= "
-CLIENT_BASE_OPT= S=3D"--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=3D"--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=3D= "--dev null --ifconfig-noexec --up ${srcdir}/null_client_up.sh"
+CLIENT_LWIP_OPTS=3D&q= uot;--dev null --dev-node unix:${LWIPOVPN_PATH} --up ${srcdir}/lwip_client_= up.sh"
+<= br> CLIENT_CIPHER_OPTS=3D""
CLIENT_CERT_OP= TS=3D"--ca ${CA} --cert ${CLIENT_CERT} --key ${CLIENT_KEY} --tls-auth = ${TA} 1"

-TEST_RUN_LIST=3D"1 2 3"
-CLIENT_CONF_BASE=3D"${CLIENT_BASE_OPTS} ${CLIENT= _CIPHER_OPTS} ${CLIENT_CERT_OPTS}"
+TEST_RUN_LIST=3D"1 1L 2 2L 3"
+CLIENT_CONF_BASE=3D"${CLIENT_N= ULL_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} ${CLIENT_CERT_OPTS}&quo= t;

+CLIENT_CONF_BASE_= LWIP=3D"${CLIENT_LWIP_OPTS} ${CLIENT_BASE_OPTS} ${CLIENT_CIPHER_OPTS} = ${CLIENT_CERT_OPTS}"

TEST_NAME_1=3D= "t_server_null_client.sh-openvpn_current_udp"
SH= OULD_PASS_1=3D"yes"
CLIENT_EXEC_1=3D"${CLIE= NT_EXEC}"
CLIENT_CONF_1=3D"${CLIENT_CONF_BASE} -= -remote 127.0.0.1 1194 udp --proto udp"

+TEST_NAME_1L=3D"t_server_nu= ll_client.sh-openvpn_current_udp_lwip"
+SHOULD_PASS_1L=3D"yes"
+CLIENT_EXEC_1L=3D"${CLIENT_EXEC}&= quot;
+CLIENT_CONF_1L= =3D"${CLIENT_CONF_BASE_LWIP} --remote 127.0.0.1 1194 udp --proto udp&q= uot;
+
TEST_NAME_2=3D"t_server_null_client.sh-openvpn_current_tcp"

SHOULD_PASS_2=3D"yes"
CLIENT_EXEC= _2=3D"${CLIENT_EXEC}"
CLIENT_CONF_2=3D"${CL= IENT_CONF_BASE} --remote 127.0.0.1 1195 tcp --proto tcp"

+TEST_NAME_2L=3D= "t_server_null_client.sh-openvpn_current_tcp_lwip"
+SHOULD_PASS_2L=3D"yes"
+CLIENT_EXEC_2L=3D&quo= t;${CLIENT_EXEC}"
+
TEST_NAME_3=3D"t_server_null_client.sh-openvpn_cur= rent_udp_fail"
SHOULD_PASS_3=3D"no"<= br> CLIENT_EXEC_3=3D"${CLIENT_EXEC}"

To view, visit change 811. To unsubscribe, or for help writing mai= l filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie63f302402f469c3aa48ac146ca= 6b8c029f0d250
Gerrit-Change-Number: 811
Gerrit-PatchSet: 3
Gerrit-Owner: mattock <samuli@...515...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: mattock <samuli@...515...= >
Gerrit-MessageType: newpatchset
--9Vjw0tRk17Q=--