Skip to contentSkip to conversation

Test documentation: What does t_cltsrv.sh do?

Openvpn-devel Jens Neuhalfen 2 participants 3 messages May 21, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

in my quest to bring better testability to OpenVPN I am documenting some of the test cases.

* t_client.sh runs connect & ping tests against servers
* t_lpback.sh runs the built-in crypto tests
* Can anybody tell me what ’t_cltsrv.sh’ tests?

Cheers
Jens

#1 lore raw

Hi,

Quoted 3 lines · Jens Neuhalfen

* t_client.sh runs connect & ping tests against servers
* t_lpback.sh runs the built-in crypto tests
* Can anybody tell me what ???t_cltsrv.sh??? tests?

It's a basic TLS test that does not need external test infrastructure - basically, it runs a test server and test client that talk to each other via 127.0.0.1, eventually timeout and exit.

This is good to quickly see if we broke TLS handshaking (on some platform or build combination) without having to setup a "proper" test server.

t_client.sh does full "see if ifconfig+route works, if everything is properly cleaned up afterwards, and data transfer works" - but needs root (or sudo) privileges to test that, and a properly set up test rig.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw

Gert,

please be so kind and review this README intended to go in openvpn/tests

OpenVPN tests
=============

OpenVPN utilizes three types of tests
* Unit testing with cmocka
* Loopback integration testing
* VM/Server based integration testing

## Unit testing

Unit testing is described in [unit_tests](unit_tests).

## Loopback Integration testing

Loopback based tests run tests build into openvpn or tsts that do not need to establish a tunnel with the clients packets routed through, e.g. to test that TLS handshake works.

| Test             | Script                     | Tests what                   |
|------------------|----------------------------|------------------------------|
| TLS Handshake    | [t_cltsrv.sh](t_cltsrv.sh) | Loopback TLS handshake       |
| Crypto Loopback  | [t_lpback.sh](t_lpback.sh) | openvpn --test-crypto        |

### t_cltsrv.sh

t_cltsrv.sh is a basic TLS test that does not need external test infrastructure - basically, it runs a test server and test client that talk to each other via 127.0.0.1, eventually timeout and exit.

This is good to quickly see if we broke TLS handshaking (on some platform or build combination) without having to setup a "proper" test server.

## Integration testing with dedicated servers

More extensive tests need need a dedicated test-server instance.

### Non-Standalone

These tests need some counterpart OpenVPN instance that is not definied by the tests.

| Test             | Script                     | Tests what                   |
|------------------|----------------------------|------------------------------|
| connectivity     | [t_client.sh](t_client.sh) | Connectivity through tunnel  |

#### t_client.sh

t_client.sh does full "see if ifconfig+route works, if everything is properly cleaned up afterwards, and data transfer works" - but needs root (or sudo) privileges to test that, and a properly set up test rig.

### VM based

Integration testing with VMs is described in [server](server).

Cheers
Jens