From 2b97c0e59c142a3fd21eca9930ab6c3e8a39255d Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Wed, 26 Sep 2018 13:10:17 -0400 Subject: [PATCH] Test: adjust proxy_server.py argument handling: - if it is provided, don't require the certificate filename to be provided as an absolute path - raise an error if the provided certificate filename does not point to an existing file, rather than just printing and ignoring (to avoid possible future diagnostic headaches) Signed-off-by: Sebastien Awwad --- tests/proxy_server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/proxy_server.py b/tests/proxy_server.py index 093020e6..68ad8256 100644 --- a/tests/proxy_server.py +++ b/tests/proxy_server.py @@ -477,12 +477,10 @@ def test(HandlerClass=ProxyRequestHandler, ServerClass=ThreadingHTTPServer, prot # MODIFIED: Argument added to control certificate(s) the proxy expects of # the target server(s), and added default value. if len(sys.argv) > 3: - if not os.path.isabs(sys.argv[3]): - print('Path for target server cert is not absolute. Ignoring.') - elif os.path.exists(sys.argv[3]): + if os.path.exists(sys.argv[3]): TARGET_SERVER_CA_FILEPATH = sys.argv[3] else: - print('Target server cert not found. Ignoring.') + raise Exception('Target server cert file not found: ' + sys.argv[3]) # MODIFIED: Create the target-host-specific proxy certificates directory if # it doesn't already exist.