summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible-test-sanity-import/runme.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/ansible-test-sanity-import/runme.sh')
-rwxr-xr-xtest/integration/targets/ansible-test-sanity-import/runme.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-test-sanity-import/runme.sh b/test/integration/targets/ansible-test-sanity-import/runme.sh
new file mode 100755
index 0000000..a12e3e3
--- /dev/null
+++ b/test/integration/targets/ansible-test-sanity-import/runme.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+source ../collection/setup.sh
+
+vendor_dir="$(python -c 'import pathlib, ansible._vendor; print(pathlib.Path(ansible._vendor.__file__).parent)')"
+
+cleanup() {
+ rm -rf "${vendor_dir}/demo/"
+}
+
+trap cleanup EXIT
+
+# Verify that packages installed in the vendor directory are not available to the import test.
+# If they are, the vendor logic will generate a warning which will be turned into an error.
+# Testing this requires at least two plugins (not modules) to be run through the import test.
+
+mkdir "${vendor_dir}/demo/"
+touch "${vendor_dir}/demo/__init__.py"
+
+ansible-test sanity --test import --color --truncate 0 plugins/lookup/vendor1.py plugins/lookup/vendor2.py "${@}"