Changeset 5fd0170 in mod_gnutls
- Timestamp:
- Jan 2, 2020, 2:51:05 PM (3 years ago)
- Branches:
- asyncio, main, master, proxy-ticket
- Children:
- 4411426
- Parents:
- 5d5a7c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/README
r5d5a7c8 r5fd0170 47 47 Please add more tests! 48 48 49 The simplest way to add a test is (from test/): 49 The simplest way to add a test is (from the directory containing this 50 file): 50 51 51 52 ./newtest … … 53 54 This will prompt you for a simple name for the test and then copy a 54 55 starting set of files from tests/00_basic, and create a script which 55 you can add to TESTS in Makefile.am when your test is ready for 56 inclusion in the test suite. 56 you can add to the test_scripts variable in Makefile.am when your test 57 is ready for inclusion in the test suite. The files in the test 58 directory must be added to EXTRA_DIST in tests/Makefile.am. 57 59 58 60 … … 60 62 ============== 61 63 62 Each test consists of a script in test/ and a directory in 63 test/tests/, which the test suite uses to spin up an isolated Apache 64 instance or two (for proxy tests) and try to connect to it with 65 gnutls-cli and make a simple HTTP 1.1 or 1.0 request. 64 Each test consists of a script in the directory containing this README 65 and a directory in tests/, which the test suite uses to spin up an 66 isolated Apache instance (or more, for tests that need a proxy or OCSP 67 responder) and try to connect to it with gnutls-cli and make a simple 68 HTTP 1.1 or 1.0 request. 66 69 67 70 Test directories usually contain the following files: … … 69 72 * apache.conf -- Apache configuration to be used 70 73 71 * gnutls-cli.args -- the arguments to pass to gnutls-cli 72 73 * input -- the full HTTP request (including the final blank line) 74 * test.yml -- Defines the client connection(s) including parameters 75 for gnutls-cli, the request(s), and expected response(s) 74 76 75 77 * backend.conf [optional] -- Apache configuration for the proxy 76 78 backend server, if any 77 79 78 * output [optional] -- the lines of this file will be checked against 79 the same number of lines at the end of the output produced by the 80 gnutls-cli process. "Date" and "Server" headers are filtered from 81 the response because they are expected to change between runs 82 (date) or builds (server version). 80 * ocsp.conf [optional] -- Apache configuration for the OCSP 81 responder, if any 83 82 84 83 * fail.server [optional] -- if this file exists, it means we expect … … 86 85 configuration problem. 87 86 88 * fail.client [optional] -- if this file exists, it means we expect 89 the client to fail to fetch its file. If you already have 90 fail.server, do not also specify this; we know that a failed server 91 should result in a failed file retrieval. 87 * hooks.py [optional] -- Defines hook functions that modify or 88 override the default behavior of runtest.py 92 89 93 The "runtest s" script is used to start one Apache instance andsend a94 request based on the files described above. Note that some tests take95 additional steps, e.g. starting another server to act as proxy 96 backend, and at least one does not use "runtests" at all.90 The "runtest.py" program is used to start the required services send a 91 request (or more) based on the files described above. Note that 92 currently some tests take additional steps in their test scripts, 93 though hooks.py is the preferred mechanism. 97 94 98 95 By default (if "unshare" is available and has the permissions required 99 96 to create network and user namespaces), each test case is run inside 100 97 its own network namespace. This avoids address and port conflicts with 101 other tests as well has the host system. 98 other tests as well has the host system. Otherwise the tests use a 99 lock file to prevent port conflicts between themselves. 102 100 103 When writing your own tests, make sure to call netns_reexec (defined 104 in common.bash) if you need to start any network services outside of 105 runtests (which will create the namespace if it doesn't exist 106 already). However, some architectures might not support namespaces, so 107 traditional locking (using flock) and serial execution are still 108 supported. 109 101 When writing your own tests, make sure to call runtest.py through 102 netns_py.bash like the current tests do to ensure compatibility with 103 the namespace and lock file mechanisms. 110 104 111 105 Robustness and Tuning … … 118 112 * They need a functioning loopback device. 119 113 120 * They expect (by default) to have port 9932 [TEST_PORT] available 114 * They expect to have ports 9932 (TEST_PORT as defined in 115 Makefile.am) through 9936 available for test services to bind to, 121 116 and open for connections on the addresses listed in TEST_IP. 122 117 … … 129 124 130 125 * If a machine is particularly slow or under heavy load, it's 131 possible that these tests will fail for timing 132 reasons. [TEST_QUERY_TIMEOUT (timeout for the HTTPS request in 133 seconds)] 126 possible that tests fail for timing reasons. [TEST_QUERY_TIMEOUT 127 (timeout for the HTTPS request in seconds)] 134 128 135 129 The first two of these issues are avoided when the tests are isolated
Note: See TracChangeset
for help on using the changeset viewer.