#!/bin/bash cd "${0%/*}" || exit 1 echo "--> Generating the Ansible inventory files..." ansible-playbook -i /dev/null write-inventory-files.yml ret=$? if [ "$ret" -gt 0 ]; then echo "--> Ansible inventory files generation FAILED !" exit 1 else echo "--> Ansible inventory files generation SUCCEEDED !" fi # Because of a bug in Ansible, we need to move one directory upper before running # the playbooks. # # The bug makes the playbooks fail after the Application Plans creation/update # with this error message: # # ERROR! Unexpected Exception, this is probably a bug: expected str, bytes or os.PathLike object, not NoneType # cd ".." || exit 1 for environment in tests/environments/3scale-*; do for testcase in tests/test-cases/*.y*ml; do echo "--> Running $testcase against $environment..." ansible-playbook -i "$environment" -v "$testcase" ret=$? if [ "$ret" -gt 0 ]; then echo "--> $testcase against $environment FAILED !" exit 1 else echo "--> $testcase against $environment SUCCEEDED !" fi done done