source: mod_gnutls/t/README @ 480aba1

asynciodebian/masterdebian/stretch-backportsjessie-backportsmainmsvaproxy-ticketupstream
Last change on this file since 480aba1 was 4b53371, checked in by Daniel Kahn Gillmor <dkg@…>, 10 years ago

initial testing framework, with one simple test.

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