mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 13:21:25 -07: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:
parent
3c32b483bc
commit
c1f9efabf4
10 changed files with 313 additions and 47 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue