From 27bc1d734ec816ff8383d5990abdabc1fdf42949 Mon Sep 17 00:00:00 2001 From: Tri Nguyen Date: Thu, 14 Feb 2019 18:35:51 -0500 Subject: [PATCH] Allow proxy env variables to be set/inherited --- tests/test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test.py b/tests/test.py index 56531db81a..dc9941a46e 100644 --- a/tests/test.py +++ b/tests/test.py @@ -17,6 +17,9 @@ NAMESPACE = os.environ.get('NAMESPACE') VERSION = os.environ.get('VERSION') USE_RANDOM_USER_ID = os.environ.get('USE_RANDOM_USER_ID') +http_proxy = os.environ.get('http_proxy', '') +https_proxy = os.environ.get('https_proxy', '') +no_proxy = os.environ.get('no_proxy', '') IMAGE_NAME_MAP = { # Hub @@ -100,6 +103,11 @@ def launch_container(container, **kwargs): logger.info("Running %s container..." % container) container_id = client.containers.run("%s/%s:%s" % (NAMESPACE, IMAGE_NAME_MAP[container], VERSION), detach=True, + environment={ + 'http_proxy': http_proxy, + 'https_proxy': https_proxy, + 'no_proxy': no_proxy + }, **kwargs).short_id logger.info("%s up and running" % container) return container_id