source: mod_gnutls/test/tests/28_HTTP2_support/hooks.py @ 076049a

asyncioproxy-ticket
Last change on this file since 076049a was 0909c92, checked in by Fiona Klute <fiona.klute@…>, 18 months ago

Add hooks system to the test runner

With this all tests can use runtest.py to set up their
environment. Note that at the moment only the run_connection hook is
implemented.

  • Property mode set to 100644
File size: 597 bytes
Line 
1import os
2import subprocess
3
4def run_connection(testname, conn_log, response_log):
5    url = f'https://{os.environ["TEST_HOST"]}:{os.environ["TEST_PORT"]}' \
6        '/status?auto'
7    command = [os.environ['HTTP_CLI'], '--http2', '--location', '--verbose',
8               '--cacert', 'authority/x509.pem', url]
9
10    proc = subprocess.run(command,
11                          stdout=subprocess.PIPE, stderr=subprocess.PIPE,
12                          check=True, text=True)
13    print(proc.stderr)
14    print(proc.stderr, file=conn_log)
15    print(proc.stdout)
16    print(proc.stdout, file=response_log)
Note: See TracBrowser for help on using the repository browser.