diff --git a/test/runner/lib/docker_util.py b/test/runner/lib/docker_util.py index 4d2fdeed0d4..d150bef8284 100644 --- a/test/runner/lib/docker_util.py +++ b/test/runner/lib/docker_util.py @@ -94,19 +94,23 @@ def docker_get(args, container_id, src, dst): options=['-i'], stdout=dst_fd, capture=True) -def docker_run(args, image, options): +def docker_run(args, image, options, cmd=None): """ :type args: EnvironmentConfig :type image: str :type options: list[str] | None + :type cmd: list[str] | None :rtype: str | None, str | None """ if not options: options = [] + if not cmd: + cmd = [] + for _ in range(1, 3): try: - return docker_command(args, ['run'] + options + [image], capture=True) + return docker_command(args, ['run'] + options + [image] + cmd, capture=True) except SubprocessError as ex: display.error(ex) display.warning('Failed to run docker image "%s". Waiting a few seconds before trying again.' % image) diff --git a/test/runner/lib/http.py b/test/runner/lib/http.py index e0a3da6a57a..467105540b2 100644 --- a/test/runner/lib/http.py +++ b/test/runner/lib/http.py @@ -32,13 +32,15 @@ from lib.util import ( class HttpClient(object): """Make HTTP requests via curl.""" - def __init__(self, args, always=False): + def __init__(self, args, always=False, insecure=False): """ :type args: CommonConfig :type always: bool + :type insecure: bool """ self.args = args self.always = always + self.insecure = insecure def get(self, url): """ @@ -73,6 +75,9 @@ class HttpClient(object): """ cmd = ['curl', '-s', '-S', '-i', '-X', method] + if self.insecure: + cmd += ['--insecure'] + if headers is None: headers = {}