Changeset 0f52d48 in mod_gnutls for test/tests


Ignore:
Timestamp:
Jan 8, 2020, 5:06:31 PM (19 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
482bafc
Parents:
baa0056
Message:

Switch most tests to hooks.py instead of preconditions in test scripts

The new function mgstest.require_apache_modules() covers required
Apache modules, the rest is individual stuff.

Location:
test/tests
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • test/tests/27_OCSP_server/hooks.py

    rbaa0056 r0f52d48  
     1import os
    12import re
    23from mgstest import require_match
     4from unittest import SkipTest
     5
     6def prepare_env():
     7    if not 'OCSP_PORT' in os.environ:
     8        raise SkipTest('OCSP_PORT is not set, check if openssl is available.')
    39
    410def post_check(conn_log, response_log):
  • test/tests/28_HTTP2_support/hooks.py

    rbaa0056 r0f52d48  
    22import re
    33import subprocess
    4 from mgstest import require_match
     4from mgstest import require_apache_modules, require_match
     5from unittest import SkipTest
     6
     7def prepare_env():
     8    require_apache_modules('mod_http2.so')
     9    curl = os.environ['HTTP_CLI']
     10    if curl == 'no':
     11        raise SkipTest(f'{curl} not found!')
     12    proc = subprocess.run([curl, '-V'], stdout=subprocess.PIPE,
     13                          check=True, text=True)
     14    if not re.search(r'\bHTTP2\b', proc.stdout):
     15        raise SkipTest(f'{curl} does not support HTTP/2!')
    516
    617def run_connection(testname, conn_log, response_log):
     18    """Check if HTTP/2 connections using mod_gnutls and mod_http2 work."""
     19
    720    url = f'https://{os.environ["TEST_HOST"]}:{os.environ["TEST_PORT"]}' \
    821        '/status?auto'
  • test/tests/Makefile.am

    rbaa0056 r0f52d48  
    3434        32_vhost_SNI_serveralias_mismatch/apache.conf 32_vhost_SNI_serveralias_mismatch/test.yml \
    3535        33_vhost_SNI_serveralias_missinghost/apache.conf 33_vhost_SNI_serveralias_missinghost/test.yml \
    36         34_TLS_reverse_proxy_h2/apache.conf 34_TLS_reverse_proxy_h2/backend.conf 34_TLS_reverse_proxy_h2/test.yml
     36        34_TLS_reverse_proxy_h2/apache.conf 34_TLS_reverse_proxy_h2/hooks.py 34_TLS_reverse_proxy_h2/backend.conf 34_TLS_reverse_proxy_h2/test.yml
Note: See TracChangeset for help on using the changeset viewer.