Adding integration test for dynamic inventory plugin

Signed-off-by: Jorge Gallegos <jgallego@redhat.com>
This commit is contained in:
Jorge Gallegos 2025-06-10 13:57:27 -07:00
commit adf05c4ecf
No known key found for this signature in database
10 changed files with 252 additions and 0 deletions

View 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