Skip to contentSkip to conversation

Change in openvpn[master]: Add t_server_null test suite

Openvpn-devel mattock (Code Review) 1 participant 3 messages Jun 5, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1717583228000.I1b54da258c7d15551b6c3de7522a0d19afdb66de@...2715...

#1 lore raw

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/+/643?usp=email

to review the following change.

Change subject: Add t_server_null test suite
......................................................................

Add t_server_null test suite

Change-Id I1b54da258c7d15551b6c3de7522a0d19afdb66de

---
M .gitignore
A doc/t_server_null.rst
M tests/Makefile.am
A tests/null_client_up.sh
A tests/t_server_null.rc-sample
A tests/t_server_null.sh
A tests/t_server_null_client.sh
A tests/t_server_null_default.rc
A tests/t_server_null_server.sh
A tests/t_server_null_stress.sh

10 files changed, 566 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/643/1

.gitignore +1 -0
index 92d65bf..db8bb73 100644
@@ -55,6 +55,7 @@
 
 tests/t_client.sh
 tests/t_client-*-20??????-??????/
+tests/t_server_null.rc
 t_client.rc
 t_client_ips.rc
 tests/unit_tests/**/*_testdriver
doc/t_server_null.rst new file +146 -0

146 lines not on this page · raw message

tests/Makefile.am +9 -2
index 5e9ad0a..f26b3b8 100644
@@ -15,10 +15,10 @@
 SUBDIRS = unit_tests
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) System Tests'
-LOG_DRIVER = $(SHELL) $(top_srcdir)/forked-test-driver
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/forked-test-driver
 
 if !WIN32
-test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh
+test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh t_server_null.sh
 
 check_PROGRAMS = ntlm_support
 if HAVE_SITNL
@@ -27,6 +27,7 @@
 endif
 
 TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)"
+TEST_EXTENSIONS = .sh
 TESTS = $(test_scripts)
 
 dist_noinst_SCRIPTS = \
@@ -34,8 +35,14 @@
 	t_cltsrv-down.sh \
 	t_lpback.sh \
 	t_net.sh \
+	t_server_null.sh \
+	t_server_null_client.sh \
+	t_server_null_server.sh \
+	t_server_null_default.rc \
 	update_t_client_ips.sh
 
+t_client.log: t_server_null.log
+
 dist_noinst_DATA = \
 	t_client.rc-sample
 
tests/null_client_up.sh new file +11 -0
new file mode 100755
index 0000000..d4df0c6
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# Stop the parent process (openvpn) gracefully after a small delay
+
+# 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.
+(sleep 5 ; kill -15 $MY_PPID) &
tests/t_server_null.rc-sample new file +15 -0
new file mode 100644
index 0000000..28c3773
@@ -0,0 +1,15 @@
+# Uncomment to run tests with sudo
+#SUDO_EXEC=`which sudo`
+#RUN_SUDO="${SUDO_EXEC} -E"
+
+TEST_RUN_LIST="1 2 3 10 11"
+
+TEST_NAME_10="t_server_null_client.sh-openvpn_2_6_8_udp"
+SHOULD_PASS_10="yes"
+CLIENT_EXEC_10="/usr/sbin/openvpn"
+CLIENT_CONF_10="${CLIENT_CONF_BASE} --remote 127.0.0.1 1194 udp --proto udp"
+
+TEST_NAME_11="t_server_null_client.sh-openvpn_2_6_8_tcp"
+SHOULD_PASS_11="yes"
+CLIENT_EXEC_11="/usr/sbin/openvpn"
+CLIENT_CONF_11="${CLIENT_CONF_BASE} --remote 127.0.0.1 1195 tcp --proto tcp"
tests/t_server_null.sh new file +74 -0

74 lines not on this page · raw message

tests/t_server_null_client.sh new file +132 -0

132 lines not on this page · raw message

tests/t_server_null_default.rc new file +66 -0

66 lines not on this page · raw message

tests/t_server_null_server.sh new file +80 -0

80 lines not on this page · raw message

tests/t_server_null_stress.sh new file +32 -0
new file mode 100755
index 0000000..3dc17d9
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+#
+# Run this stress test as root to avoid sudo authorization from timing out.
+
+count=0
+
+. ./t_server_null_default.rc
+
+export pid_files=""
+for SUF in $TEST_SERVER_LIST
+do
+    eval server_name=\"\$SERVER_NAME_$SUF\"
+    pid_files="${pid_files} ./${server_name}.pid"
+done
+
+LOG_BASEDIR="make-check"
+mkdir -p "${LOG_BASEDIR}"
+
+while [ $count -lt 100 ]; do
+    count=$(( count + 1 ))
+    make check TESTS=t_server_null.sh SUBDIRS= > /dev/null 2>&1
+    retval=$?
+
+    echo "Iteration ${count}: return value ${retval}" >> "${LOG_BASEDIR}/make-check.log"
+    if [ $retval -ne 0 ]; then
+	DIR="${LOG_BASEDIR}/make-check-${count}"
+        mkdir -p "${DIR}"
+        cp t_server_null*.log "${DIR}/"
+        cp test-suite.log "${DIR}/"
+        ps aux|grep openvpn|grep -vE '(suppress|grep)' > "${DIR}/psaux"
+    fi
+done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/643?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1b54da258c7d15551b6c3de7522a0d19afdb66de
Gerrit-Change-Number: 643
Gerrit-PatchSet: 1
Gerrit-Owner: mattock <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: mattock, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/643?usp=email )

Change subject: Add t_server_null test suite
......................................................................

Patch Set 2: Code-Review-2

(1 comment)

File tests/t_server_null.sh:

http://gerrit.openvpn.net/c/openvpn/+/643/comment/bd8a5f2e_8165d85d :
PS2, Line 1: #!/usr/bin/env bash
BSD workers are not happy with this

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/643?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1b54da258c7d15551b6c3de7522a0d19afdb66de
Gerrit-Change-Number: 643
Gerrit-PatchSet: 2
Gerrit-Owner: mattock <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: mattock <[email protected]...>
Gerrit-Comment-Date: Wed, 05 Jun 2024 12:35:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: mattock, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/643?usp=email )

Change subject: Add t_server_null test suite
......................................................................

Patch Set 2:

(1 comment)

File tests/t_server_null_client.sh:

http://gerrit.openvpn.net/c/openvpn/+/643/comment/52da0659_0e3d50cb :
PS2, Line 74: # Wait until servers are up. This check is based on the presence of processes This code does not seem to work reliably. I often see something like this in the build logs:

cat: t_server_null_server-1194_udp.pid: No such file or directory
cat: t_server_null_server-1195_tcp.pid: No such file or directory
error: list of process IDs must follow -p
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
OpenVPN test servers up: 0/0

So that means that the servers hadn't created the pid files yet and so the test suceeded? Probably server_count should be based on the amount of defined servers and not server_pids?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/643?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1b54da258c7d15551b6c3de7522a0d19afdb66de
Gerrit-Change-Number: 643
Gerrit-PatchSet: 2
Gerrit-Owner: mattock <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: mattock <[email protected]...>
Gerrit-Comment-Date: Wed, 05 Jun 2024 13:51:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment