]>
Commit | Line | Data |
---|---|---|
997358a6 | 1 | |
232af2fa TB |
2 | ------------------------------ |
3 | strongSwan Integration Tests | |
4 | ------------------------------ | |
997358a6 MW |
5 | |
6 | ||
7 | Contents | |
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 |
16 | 1. Building the testing environment |
17 | -------------------------------- | |
997358a6 | 18 | |
232af2fa TB |
19 | The testing environment can be built with the "make-testing" script after |
20 | adjusting the variables in the testing.conf file. By default everything is | |
21 | built when executing the script. Setting any of the ENABLE_BUILD_* variables | |
22 | in the configuration file to "no" will not build those parts. | |
997358a6 | 23 | |
997358a6 | 24 | |
232af2fa TB |
25 | 2. Starting up the testing environment |
26 | ----------------------------------- | |
997358a6 | 27 | |
232af2fa TB |
28 | When the strongSwan testing environment has been put into place by running |
29 | the "make-testing" script you are ready to start up the KVM instances by | |
30 | executing the "start-testing" script. | |
997358a6 | 31 | |
997358a6 | 32 | |
232af2fa | 33 | 3. Running the automated tests |
997358a6 MW |
34 | --------------------------- |
35 | ||
36 | The script | |
37 | ||
38 | ./do-tests <testnames> | |
39 | ||
232af2fa TB |
40 | runs the automated tests. If the <testnames> argument is omitted all tests |
41 | are executed, otherwise only the tests listed will be run as shown in the | |
42 | example below: | |
997358a6 | 43 | |
232af2fa | 44 | ./do-tests ikev2/net2net-psk ikev2/net2net-cert |
997358a6 MW |
45 | |
46 | Each 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 |
62 | The test results and configuration files for all tests are stored in a |
63 | folder labeled with the current date and time in the $TESTRESULTSDIR directory. | |
997358a6 | 64 | |
232af2fa TB |
65 | The same results are also automatically transferred to the Apache server |
66 | running 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 |
71 | 4. Manual testing |
72 | -------------- | |
997358a6 | 73 | |
232af2fa TB |
74 | Instead of running tests automatically with "do-tests" it is possible to |
75 | preload a test scenario with the script: | |
997358a6 | 76 | |
232af2fa | 77 | scripts/load-testconfig <testname> |
997358a6 | 78 | |
232af2fa TB |
79 | Individual configuration files can be changed and any command can be executed by |
80 | logging into a guest host directly (via SSH or a console window). No password | |
81 | is 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 | |
83 | recompile these components. | |
997358a6 | 84 | |
232af2fa TB |
85 | After you have finished testing, the default configuration can be restored |
86 | with the following command (newly created files have to be deleted manually) | |
997358a6 | 87 | |
232af2fa | 88 | scripts/restore-defaults |