source: mod_gnutls/test/README @ 7813802

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 7813802 was 7813802, checked in by Thomas Klute <thomas2.klute@…>, 5 years ago

Test suite: Use AP_LIBEXECDIR to find Apache modules

Distributions install Apache modules to different locations, so hard
coded paths will cause problems. Use the module directory detected by
./configure instead.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1Unit Tests for Apache's mod_gnutls
2==================================
3
4Initial Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
5
6There are a lot of ways that a TLS-capable web server can go wrong.  I
7want to at least test for some basic/common configurations.
8
9
10Running the tests
11=================
12
13from the top level of the source, or from test/ (where this README is),
14just run:
15
16 make check
17
18from test/ you can also run specific tests by passing their script
19names to make in the TESTS variable:
20
21 TESTS="test-03_cachetimeout_in_vhost.bash" make -e check
22
23This should be handy when you're just trying to experiment with a new
24test and don't want to wait for the full test suite to run.
25
26
27Adding a Test
28=============
29
30Please add more tests!
31
32The simplest way to add a test is (from test/):
33
34 ./newtest
35
36This will prompt you for a simple name for the test and then copy a
37starting set of files from tests/00_basic, and create a script which
38you can add to TESTS in Makefile.am when your test is ready for
39inclusion in the test suite.
40
41
42Implementation
43==============
44
45Each test consists of a directory in test/tests/, which will cause the
46test suite to spin up an isolated apache instance and try to connect
47to it with gnutls-cli and make a simple HTTP 1.1 request.
48
49By default, these tests are expected to succeed, by having
50
51In each directory, you can put the following files:
52
53 * apache.conf --  the apache configuration to be used
54
55 * gnutls-cli.args --  the arguments to pass to gnutls-cli
56
57 * input -- the full HTTP request (including the final blank line)
58
59 * output [optional] -- the lines of this file will be checked against
60   the same number of lines at the end of the output produced by the
61   gnutls-cli process.
62
63 * fail.server [optional] -- if this file exists, it means we expect
64   the web server to fail to even start due to some serious
65   configuration problem.
66
67 * fail.client [optional] -- if this file exists, it means we expect
68   the client to fail to fetch its file.  If you already have
69   fail.server, do not also specify this; we know that a failed server
70   should result in a failed file retrieval.
71
72
73Robustness and Tuning
74=====================
75
76These tests aren't nearly as robust as i'd like them to be, but they
77work for the moment and they're better than no tests at all.
78
79Here are some things that you might want to tune based on your
80expected setup (along with the variables that can be passed to "make
81check" to adjust them):
82
83 * they need a functioning loopback device and expect (by default) to
84   have IPv6 functionality. [TEST_IP]
85
86 * they expect (by default) the IPv6 loopback to have port 9932
87   open. [TEST_PORT]
88
89 * if a machine is particularly slow or under heavy load, it's
90   possible that these tests will fail for timing
91   reasons. [TEST_QUERY_DELAY (seconds for the http request to be sent
92   and responded to)] and [TEST_GAP (seconds to wait between tests)]
93
94 * they assume that the name "localhost" is associated with the IPv6
95   loopback address [TEST_HOST]
Note: See TracBrowser for help on using the repository browser.