Changeset 0da2c5d in mod_gnutls


Ignore:
Timestamp:
Jan 9, 2020, 4:37:31 PM (11 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master, proxy-ticket
Children:
221ffe5
Parents:
478767a
Message:

Test suite: Update README and newtest script

Location:
test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • test/Makefile.am

    r478767a r0da2c5d  
    66        chmod a+x $@
    77
    8 check_SCRIPTS = test-00_basic.bash \
     8test_scripts = test-00_basic.bash \
    99        test-01_serverwide_priorities.bash \
    1010        test-02_cache_in_vhost.bash \
     
    2222        test-14_resume_session.bash
    2323if USE_MSVA
    24 check_SCRIPTS += test-15_basic_msva.bash
    25 endif
    26 check_SCRIPTS += test-16_view-status.bash \
     24test_scripts += test-15_basic_msva.bash
     25endif
     26test_scripts += test-16_view-status.bash \
    2727        test-17_cgi_vars_large_cert.bash \
    2828        test-18_client_verification_wrong_cert.bash \
     
    4444        test-34_TLS_reverse_proxy_h2.bash
    4545
    46 MOSTLYCLEANFILES = $(check_SCRIPTS)
     46MOSTLYCLEANFILES = $(test_scripts)
    4747dist_check_SCRIPTS = netns_py.bash test-template.bash.in
    4848
    4949TEST_EXTENSIONS = .bash .py
    5050PY_LOG_COMPILER = $(PYTHON)
    51 TESTS = doctest-mgstest.py $(check_SCRIPTS)
     51TESTS = doctest-mgstest.py $(test_scripts)
    5252
    5353check_PROGRAMS = pgpcrc
  • test/README.md

    r478767a r0da2c5d  
    2626
    2727This 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.
     28test and don't want to wait for the full test suite to run. Note that
     29the test scripts are generated by `make`, using the names of
     30directories in `tests/`.
    2931
    3032The default configuration assumes that a loopback device with IPv4 and
    3133IPv6 support is available (`TEST_IP="[::1] 127.0.0.1"`) and that
    32 `TEST_HOST="localhost"` resolves to at least one of these
    33 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
     35does not apply to your system, you can pass different values to
     36`./configure`, e.g. to use IPv4 only:
    3537
    3638```bash
     
    4951
    5052
    51 ## Adding a Test
    52 
    53 Please add more tests!
    54 
    55 The simplest way to add a test is (from the directory containing this
    56 file):
    57 
    58 ```bash
    59 $ ./newtest
    60 ```
    61 
    62 This will prompt you for a simple name for the test, copy a starting
    63 set of files from `tests/00_basic`, and create a script which you can
    64 add to the `test_scripts` variable in `Makefile.am` when your test is
    65 ready for inclusion in the test suite. The files in the test directory
    66 must be added to `EXTRA_DIST` in `tests/Makefile.am`.
    67 
    68 
    6953## Implementation
    7054
    71 Each test consists of a script in the directory containing this README
    72 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.
     55Each test is defined by a directory in tests/, which the test suite
     56uses to spin up an isolated Apache instance (or more, for tests that
     57need a proxy or OCSP responder) and try to connect to it with
     58gnutls-cli and make a simple HTTP 1.1 or 1.0 request. Make generates a
     59minimal test script to start each test from `test-template.bash.in`.
    7660
    7761Test directories usually contain the following files:
     
    10185The [`runtest.py`](./runtest.py) program is used to start the required
    10286services 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.
     87above.
    10588
    10689By default (if the `unshare` command is available and has the
     
    11194themselves.
    11295
    113 When writing your own tests, make sure to call `runtest.py` through
    114 `netns_py.bash` like the current tests do to ensure compatibility with
    115 the namespace and lock file mechanisms.
    11696
    11797## Robustness and Tuning
     
    162142`--disable-flock` to `./configure`. This will force serial execution
    163143of tests, including environment setup.
     144
     145
     146## Adding a Test
     147
     148Please add more tests!
     149
     150The simplest way to add a test is (from the directory containing this
     151file):
     152
     153```bash
     154$ ./newtest
     155```
     156
     157This will prompt you for a simple name for the test, copy a starting
     158set of files from `tests/00_basic`, and tell you the test script name
     159you 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
     161suite. The files in the test directory must be added to `EXTRA_DIST`
     162in `tests/Makefile.am`.
  • test/newtest

    r478767a r0da2c5d  
    2222
    2323cp -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
    2625newscript="test-${newname}.bash"
    27 cat - >"${newscript}" <<EOF
    28 #!/bin/bash
    29 . \${srcdir}/netns_py.bash \${srcdir}/runtest.py --test-number ${newnum}
    30 EOF
    31 chmod a+x "${newscript}"
    3226
    3327echo "You can now edit ${newname}."
    34 echo "When ready, add ${newscript} to TESTS in Makefile.am."
     28echo "Run the test with TESTS=\"${newscript}\" make -e check."
     29echo "When ready, add ${newscript} to test_scripts in Makefile.am."
Note: See TracChangeset for help on using the changeset viewer.