Skip to contentSkip to conversation

Tips for testing

Openvpn-devel Pete Nelson 2 participants 4 messages Apr 8, 2022 – Apr 9, 2022

lore
Share & tools
lore
#0 lore raw

Hello, devs.
I'm looking for tips on testing a dev branch of openvpn. I see I can fork the github repo and enable actions to test that it builds on various OSs, but what do you guys do for functional testing? Do you run a bunch of VMs or docker containers and have them connect to each other? Any tips, scripts, or setups you can share would be appreciated. Regards,
--
Pete

#1 lore raw

Hi,

Quoted 5 lines · Pete Nelson

I'm looking for tips on testing a dev branch of openvpn. I see I can fork the github repo and enable actions to test that it builds on various OSs, but what do you guys do for functional testing? Do you run a bunch of VMs or docker containers and have them connect to each other? Any tips, scripts, or setups you can share would be appreciated.

This is... complicated.

The openvpn tree itself brings a test script, "t_client.sh", which runs a number of OpenVPN instances, verifies that they come up, interface IPs are "as expected", and then runs pings to see if the tunnel works. There are no pre-defined tests, as you need a server side to run the test against (but see tests/t_client.rc-sample). If a t_client.rc file exists, this is run as part of "make check".

I run a number of server side instances (2.2, 2.3, 2.4, master, tun, tap, udp, tcp, ...) that the official buildbot army connects to, so we know that all "normal" things should work.

In addition to that, I run "server side tests" where 1x/day a "master" checkout is installed on a dedicated server test VM, and then the driver script ssh's out to a dedicated client and runs 2.2, 2.3, 2.4, 2.5 and master clients against this newly built server. This setup also includes lots of plugin tests (plugin_auth_pam, succeeding and failing, client-connect plugin, sync/deferred, ...) - but unfortunately this is not in a state easily shared. The client side for this runs a modified t_client.sh which can handle "expect fail". Need to clean this up and include in the main repo...

My tests focus on network/transport though. Steffan runs a test rig (... that he wanted to share, but had no time yet) which focuses more on TLS behaviour - valid cert, invalid cert, expired cert, CRL, ... - this can not be done properly with t_client.sh "as is" has no "this test is expected to fail" logic yet.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#2 lore raw

Hi.

Quoted 7 lines · Gert Doering

The openvpn tree itself brings a test script, "t_client.sh", which runs a number of OpenVPN instances, verifies that they come up, interface IPs are "as expected", and then runs pings to see if the tunnel works. There are no pre-defined tests, as you need a server side to run the test against (but see tests/t_client.rc-sample). If a t_client.rc file exists, this is run as part of "make check".

I didn't expect there to be a "run this script to test all scenarios" even though I was secretly hoping for that. I'll look into the t_client.sh script; that's at least a start.

It sounds like a framework that runs some basic client and server tests, say based on docker, may be a welcome contribution.

Thanks.
--
Pete

#3 lore raw

Hi,

Quoted 2 lines · Pete Nelson

It sounds like a framework that runs some basic client and server tests, say based on docker, may be a welcome contribution.

There are a few more basic tests (t_lpback.sh, t_cltsrv.sh) to do "basic client/server TLS test" and "basic crypto" - but there certainly is room for tests that "just work and excercise code" without having to setup extra VMs.

(My stuff - t_client.sh - uses only basic shell because it needs to run these tests on all the supported OSes except Windows)

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...