summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible-test-git/runme.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/ansible-test-git/runme.sh')
-rwxr-xr-xtest/integration/targets/ansible-test-git/runme.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-test-git/runme.sh b/test/integration/targets/ansible-test-git/runme.sh
new file mode 100755
index 0000000..04e8844
--- /dev/null
+++ b/test/integration/targets/ansible-test-git/runme.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -eux -o pipefail
+
+# tests must be executed outside of the ansible source tree
+# otherwise ansible-test will test the ansible source instead of the test collection
+# the temporary directory provided by ansible-test resides within the ansible source tree
+tmp_dir=$(mktemp -d)
+
+trap 'rm -rf "${tmp_dir}"' EXIT
+
+export TEST_DIR
+export WORK_DIR
+
+TEST_DIR="$PWD"
+
+for test in collection-tests/*.sh; do
+ WORK_DIR="${tmp_dir}/$(basename "${test}" ".sh")"
+ mkdir "${WORK_DIR}"
+ echo "**********************************************************************"
+ echo "TEST: ${test}: STARTING"
+ "${test}" "${@}" || (echo "TEST: ${test}: FAILED" && exit 1)
+ echo "TEST: ${test}: PASSED"
+done