Changeset c96a965 in mod_gnutls for test/https-test-client.py


Ignore:
Timestamp:
Dec 12, 2019, 6:48:09 AM (17 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
c7f83a3
Parents:
b57d2c2
Message:

Create function to run a test config YAML file

This is much more efficient when also managing the test environment
using Python.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/https-test-client.py

    rb57d2c2 rc96a965  
    1717
    1818import os
    19 import sys
    20 import yaml
    2119
    22 from mgstest.tests import TestConnection
     20from mgstest.tests import run_test_conf
    2321
    2422if __name__ == "__main__":
     
    5250        os.environ['TEST_PORT'] = args.port
    5351
    54     conns = None
    55 
    56     config = yaml.load(args.test_config, Loader=yaml.Loader)
    57     if type(config) is TestConnection:
    58         conns = [config]
    59     elif type(config) is list:
    60         # assume list elements are connections
    61         conns = config
    62     else:
    63         raise TypeError(f'Unsupported configuration: {config!r}')
    64     print(conns)
    65     sys.stdout.flush()
    66 
    67     for i, test_conn in enumerate(conns):
    68         if test_conn.description:
    69             print(f'Running test connection {i}: {test_conn.description}')
    70             sys.stdout.flush()
    71         test_conn.run(timeout=args.timeout)
     52    run_test_conf(args.test_config, args.timeout)
     53    args.test_config.close()
Note: See TracChangeset for help on using the changeset viewer.