source: mod_gnutls/test/README @ f9f184f

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

test/Makefile.am: Add target to show AM_TESTS_ENVIRONMENT

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