source: mod_gnutls/t/README @ 0f5c9e1

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

Let Automake handle the test directory

Instead of running the test script run_tests.sh in the top level
directory, move it to t/ and let make check call it there. Using
Automake in t/ requires moving the hand written makefile that manages
the actual tests out of the way. The result is that all test related
files are kept in t/, including test results.

This will make it easier to replace the monolithic test script
run_tests.sh with individual test cases managed by make.

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