mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-09-11 15:38:30 -07:00
Adding integration test for dynamic inventory plugin
Signed-off-by: Jorge Gallegos <jgallego@redhat.com>
This commit is contained in:
parent
3e3611fb23
commit
adf05c4ecf
10 changed files with 252 additions and 0 deletions
28
tests/integration/targets/inventory_gce/runme.sh
Executable file
28
tests/integration/targets/inventory_gce/runme.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
# test infra
|
||||
ansible-playbook playbooks/setup.yml "$@"
|
||||
|
||||
export ANSIBLE_INVENTORY=test.gcp_compute.yml
|
||||
|
||||
RC=0
|
||||
# we want to run teardown regardless of playbook exit status, so catch the
|
||||
# exit code of ansible-playbook manually
|
||||
set +e
|
||||
for ts in playbooks/testcase_*.yml;
|
||||
do
|
||||
testcase="$( basename $ts | sed -e 's/testcase_//' | sed -e 's/.yml//' )"
|
||||
ansible-playbook playbooks/test.yml "$@" --extra-vars "testcase=${testcase}"
|
||||
RC=$?
|
||||
test $RC -ne 0 && break
|
||||
done
|
||||
set -e
|
||||
|
||||
unset ANSIBLE_INVENTORY
|
||||
|
||||
# delete test infra
|
||||
ansible-playbook playbooks/teardown.yml "$@"
|
||||
|
||||
exit $RC
|
Loading…
Add table
Add a link
Reference in a new issue