The network application testing project consinst of an easy to use test
framework for IPv4 and IPv6 features in applications and libraries. It
is based on network namespaces and the ptrace()
syscall. Each piece
of software is tested in different network configurations and evaluated
for features and bugs.
Dependencies:
- Python 2.7 (going to support for 3.4)
- python-ptrace 0.8.1
- netresolve-compat from git master
- iproute2 with netns support
You can use the project directly from git. Just clone the repository and run the tests.
git clone https://github.com/pavlix/network-testing.git
cd network-testing
make run
Python distutils are supported so that you can easily package the project for any distribution.
There is a Fedora COPR repository for Fedora and EPEL distributions. Just enable the COPR repository and install the test suite.
dnf copr enable pavlix/network-testing
dnf install network-testing
Then install packages required for your desired test and run the test. You can ask the test driver for the names of the packages required for your desired test.
dnf install `test-client-server --deps ssh`
test-client-server ssh
Alternatively, you may want to install available packages for all tests. In case your version of Fedora doesn't provide some of the packages, those tests would fail.
for pkg in `test-client-server --deps`; do dnf -y install $pkg; done
test-client-server
Test driver for testing client-server applications is located in
network_testing/client_server.py
and the individual tests are defined in
subdirectories of testcases/client-server
directory. Each subdirectory
defines one test case consisting of a client script and a server script.
The test driver is written in Python in order to be reasonably simple
but at the same time have access to all low-level operating system
APIs. It uses the ptrace()
system call via python-ptrace library
to trace the client and server processes. Any subprocesses are traced
as well. The scripts are run in network namespaces configured for
several network configuration scenarios..
Run individual test (for netresolve):
sudo ./test-client-server netresolve
Run all tests:
sudo ./test-client-server
The preferred form of test cases is a pair of short shell scripts that
use exec
to run the client or server scripts in the same process. But
any form of test is supported including scripts in Python and other
languages. For inspiration look at netresolve
, ssh
, python
and
python3-asyncio
testcases.