]> git.ipfire.org Git - thirdparty/strongswan.git/blame - testing/README
swanctl: Fix documentation of default value of hostaccess
[thirdparty/strongswan.git] / testing / README
CommitLineData
997358a6 1
232af2fa
TB
2 ------------------------------
3 strongSwan Integration Tests
4 ------------------------------
997358a6
MW
5
6
7Contents
8--------
9
232af2fa
TB
10 1. Building the testing environment
11 2. Starting up the testing environment
12 3. Running the automated tests
13 4. Manual testing
997358a6
MW
14
15
232af2fa
TB
161. Building the testing environment
17 --------------------------------
997358a6 18
232af2fa
TB
19The testing environment can be built with the "make-testing" script after
20adjusting the variables in the testing.conf file. By default everything is
21built when executing the script. Setting any of the ENABLE_BUILD_* variables
22in the configuration file to "no" will not build those parts.
997358a6 23
997358a6 24
232af2fa
TB
252. Starting up the testing environment
26 -----------------------------------
997358a6 27
232af2fa
TB
28When the strongSwan testing environment has been put into place by running
29the "make-testing" script you are ready to start up the KVM instances by
30executing the "start-testing" script.
997358a6 31
997358a6 32
232af2fa 333. Running the automated tests
997358a6
MW
34 ---------------------------
35
36The script
37
38 ./do-tests <testnames>
39
232af2fa
TB
40runs the automated tests. If the <testnames> argument is omitted all tests
41are executed, otherwise only the tests listed will be run as shown in the
42example below:
997358a6 43
232af2fa 44 ./do-tests ikev2/net2net-psk ikev2/net2net-cert
997358a6
MW
45
46Each test is divided into the following phases:
47
232af2fa 48 * Load the test-specific guest configuration if any is provided.
997358a6 49
232af2fa
TB
50 * Next the "pretest.dat" script found in each test directory is executed.
51 Among other commands, strongSwan is started on the IPsec hosts.
997358a6 52
232af2fa 53 * The "evaltest.dat" script evaluates if the test has been successful.
997358a6 54
232af2fa
TB
55 * The "posttest.dat" script terminates the test e.g. by stopping
56 strongSwan on the IPsec hosts. It is also responsible to cleaning up
57 things (e.g. firewall rules) set up in "pretest.dat".
997358a6 58
232af2fa
TB
59 * Restore the default configuration on every host (new files have to be
60 deleted manually in "posttest.dat").
997358a6 61
232af2fa
TB
62The test results and configuration files for all tests are stored in a
63folder labeled with the current date and time in the $TESTRESULTSDIR directory.
997358a6 64
232af2fa
TB
65The same results are also automatically transferred to the Apache server
66running on guest "winnetou" and can be accessed via the URL
997358a6 67
232af2fa 68 http://192.168.0.150/testresults/
997358a6 69
997358a6 70
232af2fa
TB
714. Manual testing
72 --------------
997358a6 73
232af2fa
TB
74Instead of running tests automatically with "do-tests" it is possible to
75preload a test scenario with the script:
997358a6 76
232af2fa 77 scripts/load-testconfig <testname>
997358a6 78
232af2fa
TB
79Individual configuration files can be changed and any command can be executed by
80logging into a guest host directly (via SSH or a console window). No password
81is required to login as root. The sources for every software built during
82"make-testing" are mounted at /root/shared/, which allows you to change and
83recompile these components.
997358a6 84
232af2fa
TB
85After you have finished testing, the default configuration can be restored
86with the following command (newly created files have to be deleted manually)
997358a6 87
232af2fa 88 scripts/restore-defaults