Overhaul httptester support in ansible-test. (#39892)

- Works with the --remote option.
- Can be disabled with the --disable-httptester option.
- Change image with the --httptester option.
- Only load and run httptester for targets that require it.
This commit is contained in:
Matt Clay 2018-05-09 09:24:39 -07:00 committed by GitHub
parent 3c32b483bc
commit c1f9efabf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 313 additions and 47 deletions

View file

@ -15,6 +15,7 @@ from lib.util import (
run_command,
common_environment,
display,
find_executable,
)
from lib.config import (
@ -24,6 +25,13 @@ from lib.config import (
BUFFER_SIZE = 256 * 256
def docker_available():
"""
:rtype: bool
"""
return find_executable('docker', required=False)
def get_docker_container_id():
"""
:rtype: str | None
@ -48,6 +56,17 @@ def get_docker_container_id():
raise ApplicationError('Found multiple container_id candidates: %s\n%s' % (sorted(container_ids), contents))
def get_docker_container_ip(args, container_id):
"""
:type args: EnvironmentConfig
:type container_id: str
:rtype: str
"""
results = docker_inspect(args, container_id)
ipaddress = results[0]['NetworkSettings']['IPAddress']
return ipaddress
def docker_pull(args, image):
"""
:type args: EnvironmentConfig