Hi Arne,

[…]

>> 
> The problem with unit tests and existing software is that, if the
> software hasn't been written with testing in mind, it is often hard
> without major refactoring to do the small java style unit tests. Also
> someone has to write these unit tests and free time is currently sparse
> among the OpenVPN developers.

I agree - adding unit tests is difficult, when the project is not designed that 
way. But: Every journey starts with the first step. I am willing to go the 
first step. I just do not want to be alone after that.

> 
> A more realistic first step for OpenVPN is a automated testing suite
> that goes beyond what we have at the moment in shell scripts. Setting up
> a mininet for example and automatically cofingure client and server, and
> see if everything works as expected as an example.
>> 

Now that you mention it: Please find attached my first pre-alpha version of a 
vagrant based test server for t_client.sh ;-)

It compiles & runs an openvpn server suitable for t_client.sh in a VM.

Comments welcome (the scripts will go into a dedicated folder, as will the 
Vagrant file. I’m in the middle of sketching this out)

- copy the Vagrant file in ./tests
- edit t_client.rc (see the diff of t_client.rc-sample)
- compiling/starting the server: see blow/in the Vagrant file
- start t_client.sh

From the Vagrant file:

# * The source tree ("..") is mounted at /openvpn
# * Two scripts are installed in the home directory (after `vagrant ssh`)
#   * rebuild.sh builds the server inside the VM (at ~/openvpn)
#   * start_server.sh starts the server with a configuration from t_client.rc
#
# Use Cases:
# 
# Start the VM:
#  * vagrant up
#
# Login to  the VM:
#  * vagrant ssh
#
# Synchronize local changes into the VM & rebuild the server
#  * (insinde the vm)
#  * ./rebuild.sh
#
# Start the server for t_client tests
#  * (outside of the vm) Modify t_client.rc (REMOTE_IP, REMOTE_PORT, 
SERVER_KEY, SERVER_CERT
#  * (inside the vm) ./rebuild.sh (to sync the changed t_client.rc)
#  * (inside the vm) ./start_server.sh



Attachment: t_client.rc-sample
Description: Binary data

Attachment: Vagrantfile
Description: Binary data

Attachment: t_client.rc
Description: Binary data


[…]

Jens


> I think how to put a testing framework into git is secondary. If unit
> tests are useful in the current state, we can discuss about how to
> include them.
> 
> Arne

Reply via email to