Changeset 0da2c5d in mod_gnutls
- Timestamp:
- Jan 9, 2020, 4:37:31 PM (3 years ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 221ffe5
- Parents:
- 478767a
- Location:
- test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
test/Makefile.am
r478767a r0da2c5d 6 6 chmod a+x $@ 7 7 8 check_SCRIPTS= test-00_basic.bash \8 test_scripts = test-00_basic.bash \ 9 9 test-01_serverwide_priorities.bash \ 10 10 test-02_cache_in_vhost.bash \ … … 22 22 test-14_resume_session.bash 23 23 if USE_MSVA 24 check_SCRIPTS+= test-15_basic_msva.bash25 endif 26 check_SCRIPTS+= test-16_view-status.bash \24 test_scripts += test-15_basic_msva.bash 25 endif 26 test_scripts += test-16_view-status.bash \ 27 27 test-17_cgi_vars_large_cert.bash \ 28 28 test-18_client_verification_wrong_cert.bash \ … … 44 44 test-34_TLS_reverse_proxy_h2.bash 45 45 46 MOSTLYCLEANFILES = $( check_SCRIPTS)46 MOSTLYCLEANFILES = $(test_scripts) 47 47 dist_check_SCRIPTS = netns_py.bash test-template.bash.in 48 48 49 49 TEST_EXTENSIONS = .bash .py 50 50 PY_LOG_COMPILER = $(PYTHON) 51 TESTS = doctest-mgstest.py $( check_SCRIPTS)51 TESTS = doctest-mgstest.py $(test_scripts) 52 52 53 53 check_PROGRAMS = pgpcrc -
test/README.md
r478767a r0da2c5d 26 26 27 27 This should be handy when you're just trying to experiment with a new 28 test and don't want to wait for the full test suite to run. 28 test and don't want to wait for the full test suite to run. Note that 29 the test scripts are generated by `make`, using the names of 30 directories in `tests/`. 29 31 30 32 The default configuration assumes that a loopback device with IPv4 and 31 33 IPv6 support is available (`TEST_IP="[::1] 127.0.0.1"`) and that 32 `TEST_HOST="localhost"` resolves to at least one of these33 addresses. If this does not apply to your system, you can pass 34 different values to`./configure`, e.g. to use IPv4 only:34 `TEST_HOST="localhost"` resolves to both of these addresses. If this 35 does not apply to your system, you can pass different values to 36 `./configure`, e.g. to use IPv4 only: 35 37 36 38 ```bash … … 49 51 50 52 51 ## Adding a Test52 53 Please add more tests!54 55 The simplest way to add a test is (from the directory containing this56 file):57 58 ```bash59 $ ./newtest60 ```61 62 This will prompt you for a simple name for the test, copy a starting63 set of files from `tests/00_basic`, and create a script which you can64 add to the `test_scripts` variable in `Makefile.am` when your test is65 ready for inclusion in the test suite. The files in the test directory66 must be added to `EXTRA_DIST` in `tests/Makefile.am`.67 68 69 53 ## Implementation 70 54 71 Each test consists of a script in the directory containing this README72 and a directory in tests/, which the test suite uses to spin up an 73 isolated Apache instance (or more, for tests that need a proxy or OCSP 74 responder) and try to connect to it with gnutls-cli and make a simple 75 HTTP 1.1 or 1.0 request.55 Each test is defined by a directory in tests/, which the test suite 56 uses to spin up an isolated Apache instance (or more, for tests that 57 need a proxy or OCSP responder) and try to connect to it with 58 gnutls-cli and make a simple HTTP 1.1 or 1.0 request. Make generates a 59 minimal test script to start each test from `test-template.bash.in`. 76 60 77 61 Test directories usually contain the following files: … … 101 85 The [`runtest.py`](./runtest.py) program is used to start the required 102 86 services send a request (or more) based on the files described 103 above. Note that currently some tests take additional steps in their 104 test scripts, though `hooks.py` is the preferred mechanism. 87 above. 105 88 106 89 By default (if the `unshare` command is available and has the … … 111 94 themselves. 112 95 113 When writing your own tests, make sure to call `runtest.py` through114 `netns_py.bash` like the current tests do to ensure compatibility with115 the namespace and lock file mechanisms.116 96 117 97 ## Robustness and Tuning … … 162 142 `--disable-flock` to `./configure`. This will force serial execution 163 143 of tests, including environment setup. 144 145 146 ## Adding a Test 147 148 Please add more tests! 149 150 The simplest way to add a test is (from the directory containing this 151 file): 152 153 ```bash 154 $ ./newtest 155 ``` 156 157 This will prompt you for a simple name for the test, copy a starting 158 set of files from `tests/00_basic`, and tell you the test script name 159 you can use to run the test and add to the `test_scripts` variable in 160 `Makefile.am` when your test is ready for inclusion in the test 161 suite. The files in the test directory must be added to `EXTRA_DIST` 162 in `tests/Makefile.am`. -
test/newtest
r478767a r0da2c5d 22 22 23 23 cp -a tests/00_basic "tests/$newname" 24 25 # create run script for make check 24 # derive script name, the actual script will be generated by make 26 25 newscript="test-${newname}.bash" 27 cat - >"${newscript}" <<EOF28 #!/bin/bash29 . \${srcdir}/netns_py.bash \${srcdir}/runtest.py --test-number ${newnum}30 EOF31 chmod a+x "${newscript}"32 26 33 27 echo "You can now edit ${newname}." 34 echo "When ready, add ${newscript} to TESTS in Makefile.am." 28 echo "Run the test with TESTS=\"${newscript}\" make -e check." 29 echo "When ready, add ${newscript} to test_scripts in Makefile.am."
Note: See TracChangeset
for help on using the changeset viewer.