mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-29 08:01:31 -07:00
28 lines
611 B
Bash
Executable file
28 lines
611 B
Bash
Executable file
#!/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
|