mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user