diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/ansible-test-sanity-import/runme.sh | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream.tar.xz ansible-core-upstream.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/ansible-test-sanity-import/runme.sh')
-rwxr-xr-x | test/integration/targets/ansible-test-sanity-import/runme.sh | 20 |
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 "${@}" |