source: mod_gnutls/test/README @ e78bc78

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

Adjust test tools and documentation to split tests and moved test dir

Paths, descriptions and an error message were adjusted in README and
setup. A bigger change was needed in the "newtest" script, which now
creates a script for "make check" to call. This script is not
automatically added to the list of tests in Makefile.am, but the user is
advised to add it when ready.

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