The *--dev null test suite* is primary targeted at testing client connections
to the "just compiled" version of OpenVPN. The name is derived from "null"
device type in OpenVPN. In particular, when *--dev null --ifconfig-noexec* is
used in OpenVPN client configuration one does not need to run OpenVPN with root
privileges because interface, routing, etc. configuration is not done at all.
This is still enough to ensure that the OpenVPN client can connect to a server
instance.
The main features of the test suite:
* Parallelized for fairly high performance
* Mostly operating-system agnostic
* Tested on Fedora Linux 38/39/40 and FreeBSD 14
* POSIX-compliant
* Tested and known to work with Bash, Dash, Ksh, Yash and FreeBSD's default /bin/sh
* Uses the sample certificates and keys
* Supports running multiple servers and clients
* Supports running servers directly as root and with sudo
* Supports using different OpenVPN client versions
* The "current" (just compiled) version
* Any other OpenVPN versions that is present on the filesystem
* Support testing for success as well as failure
* 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
Prerequisites
-------------
Running the test suite requires the following:
**bash* for running the tests
* root-level privileges for launching the servers
* run as root
* a privilege escalation tool (sudo, doas, su) and the permission to become root
The test suite is completely parallelized to allow running a large number of
server and client combinations quickly.
A normal test run looks like this:
#. Server instances start
#. Brief wait
#. Client instances start
#. Tests run
#. Client instances stop
#. Brief wait
#. Server instances stop
The tests suite is launched via "make check":
* make check
* t_server_null.sh
* t_server_null_server.sh
* Launches the compiled OpenVPN server instances as root (if necessary with sudo or su) in the background. The servers are killed using their management interface once all clients have exited.
* 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.
Configuration
-------------
The test suite reads its configuration from two files:
**tests/t_server_null_defaults.rc:* default test configuration that should work on any system
**tests/t_server_null.rc:* a local configuration file; can be used to add additional tests or override settings from the default test configuration. Must be present or tests will be skipped, but can be an empty file.
The configuration syntax is very similar to *t_client.rc*. New server instances can be