Cleanup integration test inventory. (#50753)

* Move var_blending test inventory into test.
* Remove Amazon specific inventory entry for tests.
* Remove Azure specific inventory entry for tests.
* Move var_precedence test inventory into test.
* Move unicode test inventory into test.
* Remove unused inventory entry.
* Move gathering_facts test inventory into test.
* Move delegate_to test inventory into test.
* Clean up inventory for binary_modules test.
* Clean up integration test inventory.
This commit is contained in:
Matt Clay 2019-01-10 14:45:12 -08:00 committed by GitHub
parent 476a7fc27d
commit e5094e8071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 72 additions and 84 deletions

View file

@ -1,52 +1,8 @@
[local] # Do not put test specific entries in this inventory file.
testhost ansible_ssh_host=127.0.0.1 ansible_connection=local host_var_role_name=role3 # For script based test targets (using runme.sh) put the inventory file in the test's directory instead.
testhost2 ansible_ssh_host=127.0.0.1 ansible_connection=local host_var_role_name=role2
# For testing delegate_to
testhost3 ansible_ssh_host=127.0.0.3
testhost4 ansible_ssh_host=127.0.0.4
# For testing fact gathering
facthost[0:25] ansible_host=127.0.0.1 ansible_connection=local
[binary_modules] [testgroup]
testhost_binary_modules ansible_host=127.0.0.1 ansible_connection=local testhost ansible_connection=local
[local_group]
kube-pippin.knf.local
# the following inline declarations are accompanied
# by (preferred) group_vars/ and host_vars/ variables
# and are used in testing of variable precedence
[inven_overridehosts]
invenoverride ansible_ssh_host=127.0.0.1 ansible_connection=local
[all:vars]
extra_var_override=FROM_INVENTORY
inven_var=inventory_var
unicode_host_var=CaféEñyei
[inven_overridehosts:vars]
foo=foo
var_dir=vars
[arbitrary_parent:children]
local
[local:vars]
parent_var=6000
groups_tree_var=5000
[arbitrary_parent:vars]
groups_tree_var=4000
overridden_in_parent=1000
[arbitrary_grandparent:children]
arbitrary_parent
[arbitrary_grandparent:vars]
groups_tree_var=3000
grandparent_var=2000
overridden_in_parent=2000
[aci:vars] [aci:vars]
aci_hostname=your-apic-1 aci_hostname=your-apic-1
@ -69,9 +25,3 @@ msc_use_proxy=no
[msc] [msc]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local localhost ansible_ssh_host=127.0.0.1 ansible_connection=local
[amazon]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local
[azure]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local

View file

@ -23,6 +23,6 @@ ansible_winrm_server_cert_validation=ignore
[winrm:children] [winrm:children]
windows windows
# support winrm binary module tests (temporary solution) # support tests that target testhost
[testhost_binary_modules:children] [testhost:children]
windows windows

View file

@ -1,4 +1,4 @@
- hosts: testhost_binary_modules - hosts: testhost
tasks: tasks:
- debug: var=ansible_system - debug: var=ansible_system

View file

@ -1,4 +1,4 @@
- hosts: testhost_binary_modules - hosts: testhost
roles: roles:
- role: test_binary_modules - role: test_binary_modules
tags: tags:

View file

@ -1 +1,2 @@
shippable/posix/group3 shippable/posix/group3
needs/ssh

View file

@ -0,0 +1,5 @@
[local]
testhost ansible_connection=local
testhost2 ansible_connection=local
testhost3 ansible_ssh_host=127.0.0.3
testhost4 ansible_ssh_host=127.0.0.4

View file

@ -3,14 +3,14 @@
set -eux set -eux
ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null' \ ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null' \
ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i ../../inventory -v "$@" ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i inventory -v "$@"
ansible-playbook test_loop_control.yml -v "$@" ansible-playbook test_loop_control.yml -v "$@"
ansible-playbook test_delegate_to_loop_randomness.yml -v "$@" ansible-playbook test_delegate_to_loop_randomness.yml -v "$@"
ansible-playbook delegate_and_nolog.yml -i ../../inventory -v "$@" ansible-playbook delegate_and_nolog.yml -i inventory -v "$@"
ansible-playbook delegate_facts_block.yml -i ../../inventory -v "$@" ansible-playbook delegate_facts_block.yml -i inventory -v "$@"
ansible-playbook test_delegate_to_loop_caching.yml -i ../../inventory -v "$@" ansible-playbook test_delegate_to_loop_caching.yml -i inventory -v "$@"

View file

@ -0,0 +1,2 @@
[local]
facthost[0:25] ansible_connection=local

View file

@ -2,8 +2,8 @@
set -eux set -eux
# ANSIBLE_CACHE_PLUGINS=cache_plugins/ ANSIBLE_CACHE_PLUGIN=none ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" # ANSIBLE_CACHE_PLUGINS=cache_plugins/ ANSIBLE_CACHE_PLUGIN=none ansible-playbook test_gathering_facts.yml -i inventory -v "$@"
ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" ansible-playbook test_gathering_facts.yml -i inventory -v "$@"
#ANSIBLE_CACHE_PLUGIN=base ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" # ANSIBLE_CACHE_PLUGIN=base ansible-playbook test_gathering_facts.yml -i inventory -v "$@"
ANSIBLE_GATHERING=smart ansible-playbook test_run_once.yml -i ../../inventory -v "$@" ANSIBLE_GATHERING=smart ansible-playbook test_run_once.yml -i inventory -v "$@"

View file

@ -0,0 +1,5 @@
[local]
testhost ansible_connection=local
[all:vars]
unicode_host_var=CaféEñyei

View file

@ -2,6 +2,6 @@
set -eux set -eux
ansible-playbook unicode.yml -i ../../inventory -v -e 'extra_var=café' "$@" ansible-playbook unicode.yml -i inventory -v -e 'extra_var=café' "$@"
# Test the start-at-task flag #9571 # Test the start-at-task flag #9571
ansible-playbook unicode.yml -i ../../inventory -v --start-at-task '*¶' -e 'start_at_task=True' "$@" ansible-playbook unicode.yml -i inventory -v --start-at-task '*¶' -e 'start_at_task=True' "$@"

View file

@ -0,0 +1,26 @@
[local]
testhost ansible_connection=local
testhost2 ansible_connection=local
# the following inline declarations are accompanied
# by (preferred) group_vars/ and host_vars/ variables
# and are used in testing of variable precedence
[arbitrary_parent:children]
local
[local:vars]
parent_var=6000
groups_tree_var=5000
[arbitrary_parent:vars]
groups_tree_var=4000
overridden_in_parent=1000
[arbitrary_grandparent:children]
arbitrary_parent
[arbitrary_grandparent:vars]
groups_tree_var=3000
grandparent_var=2000
overridden_in_parent=2000

View file

@ -2,4 +2,4 @@
set -eux set -eux
ansible-playbook test_var_blending.yml -i ../../inventory -e @integration_config.yml -v "$@" ansible-playbook test_var_blending.yml -i inventory -e @integration_config.yml -v "$@"

View file

@ -0,0 +1,13 @@
[local]
testhost ansible_connection=local
[all:vars]
extra_var_override=FROM_INVENTORY
inven_var=inventory_var
[inven_overridehosts]
invenoverride ansible_connection=local
[inven_overridehosts:vars]
foo=foo
var_dir=vars

View file

@ -2,7 +2,7 @@
set -eux set -eux
ansible-playbook test_var_precedence.yml -i ../../inventory -v "$@" \ ansible-playbook test_var_precedence.yml -i inventory -v "$@" \
-e 'extra_var=extra_var' \ -e 'extra_var=extra_var' \
-e 'extra_var_override=extra_var_override' -e 'extra_var_override=extra_var_override'

View file

@ -103,10 +103,3 @@ class AwsCloudEnvironment(CloudEnvironment):
if not tries and self.managed: if not tries and self.managed:
display.notice('If %s failed due to permissions, the IAM test policy may need to be updated. ' display.notice('If %s failed due to permissions, the IAM test policy may need to be updated. '
'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name) 'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name)
@property
def inventory_hosts(self):
"""
:rtype: str | None
"""
return 'amazon'

View file

@ -161,13 +161,6 @@ class AzureCloudEnvironment(CloudEnvironment):
display.notice('If %s failed due to permissions, the test policy may need to be updated. ' display.notice('If %s failed due to permissions, the test policy may need to be updated. '
'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name) 'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name)
@property
def inventory_hosts(self):
"""
:rtype: str | None
"""
return 'azure'
def get_config(config_path): def get_config(config_path):
""" """