| |
@@ -1,5 +1,7 @@
|
| |
#!/bin/sh
|
| |
|
| |
+ set -x
|
| |
+
|
| |
#
|
| |
# This invokes the tests using the local inventory and roles rather
|
| |
# than what's installed on system. This is aslight deviation from
|
| |
@@ -8,6 +10,34 @@
|
| |
|
| |
cd $(dirname $0)/..
|
| |
|
| |
- rm -rf /tmp/artifacts/ /tmp/local-artifacts/
|
| |
- TEST_ARTIFACTS=/tmp PATH=$PWD/scripts:$PATH ANSIBLE_INVENTORY=$PWD/inventory \
|
| |
- ansible-playbook --extra-vars=artifacts=/tmp/local-artifacts --tags=classic tests/tests.yml
|
| |
+ export TEST_ARTIFACTS=/tmp
|
| |
+ export PATH=$PWD/scripts:$PATH
|
| |
+ export ANSIBLE_INVENTORY=$PWD/inventory
|
| |
+
|
| |
+ rm -rf /tmp/artifacts
|
| |
+ ansible-playbook --tags=classic tests/tests.yml
|
| |
+
|
| |
+ rm -rf /tmp/artifacts/
|
| |
+ timeout 2m ansible-playbook --tags=classic tests/test-basic-abort-playbook.yml
|
| |
+ sleep 2 # sleep few seconds to make sure logs are synced
|
| |
+ # make sure expected files are created on TEST_ARTIFACTS
|
| |
+ if [[ ! -f ${TEST_ARTIFACTS}/artifacts/ERROR-str_test-abort-playbook-basic.log ]] || \
|
| |
+ [[ ! -f ${TEST_ARTIFACTS}/artifacts/test.log ]] || \
|
| |
+ [[ ! -f ${TEST_ARTIFACTS}/artifacts/results.yml ]]; then
|
| |
+ ls ${TEST_ARTIFACTS}/artifacts
|
| |
+ echo "FAIL: Not all expected files were created when playbook aborts on basic role"
|
| |
+ exit 1
|
| |
+ fi
|
| |
+
|
| |
+ rm -rf /tmp/artifacts/
|
| |
+ timeout 2m ansible-playbook --tags=classic tests/test-beakerlib-abort-playbook.yml
|
| |
+ sleep 2 # sleep few seconds to make sure logs are synced
|
| |
+ # make sure expected files are created on TEST_ARTIFACTS
|
| |
+ if [[ ! -f ${TEST_ARTIFACTS}/artifacts/ERROR-test-beakerlib-abort-playbook-err.log ]] || \
|
| |
+ [[ ! -f ${TEST_ARTIFACTS}/artifacts/ERROR-test-beakerlib-abort-playbook-err.log ]] || \
|
| |
+ [[ ! -f ${TEST_ARTIFACTS}/artifacts/test.log ]] || \
|
| |
+ [[ ! -f ${TEST_ARTIFACTS}/artifacts/results.yml ]]; then
|
| |
+ ls ${TEST_ARTIFACTS}/artifacts
|
| |
+ echo "FAIL: Not all expected files were created when playbook aborts on beakerlib role"
|
| |
+ exit 1
|
| |
+ fi
|
| |
related to https://pagure.io/standard-test-roles/pull-request/382