Add support for non_local alias in ansible-test.

This commit is contained in:
Matt Clay 2017-07-28 10:56:25 -07:00
parent 934b645191
commit e241e15899
7 changed files with 13 additions and 3 deletions

View file

@ -1 +1,2 @@
needs/root needs/root
non_local

View file

@ -2,6 +2,6 @@
set -eux set -eux
ANSIBLE_TEST_REMOTE_INTERPRETER='' ./posix.sh "$@" ./posix.sh "$@"
ANSIBLE_TEST_REMOTE_INTERPRETER='' ANSIBLE_REMOTE_USER="1000" ./posix.sh "$@" ANSIBLE_REMOTE_USER="1000" ./posix.sh "$@"

View file

@ -5,7 +5,7 @@ buildah-container ansible_ssh_pipelining=true
# 2. create container: # 2. create container:
# $ sudo buildah from --name=buildah-container python:2 # $ sudo buildah from --name=buildah-container python:2
# 3. run test: # 3. run test:
# $ ANSIBLE_TEST_REMOTE_INTERPRETER= ansible-test integration --local connection_buildah # $ ansible-test integration connection_buildah
# 6. remove container # 6. remove container
# $ sudo buildah rm buildah-container # $ sudo buildah rm buildah-container
ansible_host=buildah-container ansible_host=buildah-container

View file

@ -0,0 +1 @@
non_local

View file

@ -0,0 +1 @@
non_local

View file

@ -0,0 +1 @@
non_local

View file

@ -629,6 +629,12 @@ def integration_environment(args, target, cmd):
if args.debug_strategy: if args.debug_strategy:
env.update(dict(ANSIBLE_STRATEGY='debug')) env.update(dict(ANSIBLE_STRATEGY='debug'))
if 'non_local/' in target.aliases:
if args.coverage:
display.warning('Skipping coverage reporting for non-local test: %s' % target.name)
env.update(dict(ANSIBLE_TEST_REMOTE_INTERPRETER=''))
env.update(integration) env.update(integration)
cloud_environment = get_cloud_environment(args, target) cloud_environment = get_cloud_environment(args, target)