diff options
author | Jack Lloyd <[email protected]> | 2019-07-13 05:41:50 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-07-13 05:41:50 -0400 |
commit | f5e722a6b3be5b2b062c38bd269e4ebcece56d21 (patch) | |
tree | 455af6c28d9751436a7c3c95fec51999b980a727 /src/scripts | |
parent | 9d0911a29ac036ff2ba93d3c3d9d5d0298cbf272 (diff) |
Don't block forever in cli tests if something goes wrong
Or at least, not on Python3 which actually supports timeouts
Diffstat (limited to 'src/scripts')
-rwxr-xr-x | src/scripts/test_cli.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/scripts/test_cli.py b/src/scripts/test_cli.py index 3c8376ba2..da7587194 100755 --- a/src/scripts/test_cli.py +++ b/src/scripts/test_cli.py @@ -677,7 +677,11 @@ def cli_tls_http_server_tests(tmp_dir): if resp.status != 405: logging.error('Unexpected response status %d' % (resp.status)) - rc = tls_server.wait() + if sys.version_info.major >= 3: + rc = tls_server.wait(5) # pylint: disable=too-many-function-args + else: + rc = tls_server.wait() + if rc != 0: logging.error("Unexpected return code from https_server %d", rc) @@ -767,7 +771,11 @@ def cli_tls_proxy_tests(tmp_dir): if body != server_response: logging.error('Unexpected response from server %s' % (body)) - rc = tls_proxy.wait() + if sys.version_info.major >= 3: + rc = tls_proxy.wait(5) # pylint: disable=too-many-function-args + else: + rc = tls_proxy.wait() + if rc != 0: logging.error('Unexpected return code %d', rc) @@ -1050,6 +1058,8 @@ def main(args=None): if test_regex.search(fn_name) is None: continue + logging.info("Running %s" % (fn_name)) + start = time.time() tmp_dir = tempfile.mkdtemp(prefix='botan_cli_') try: @@ -1059,7 +1069,7 @@ def main(args=None): shutil.rmtree(tmp_dir) end = time.time() - logging.debug("Ran %s in %.02f", fn_name, end-start) + logging.debug("Ran %s in %.02f sec", fn_name, end-start) end_time = time.time() |