diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2020-05-14 11:45:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 11:45:02 -0400 |
commit | 87d9b49de256d788eacc88010ed7585b6c260a2e (patch) | |
tree | 75864db1fbc3c74e2e84ac8b78c2575ac8081b15 /test | |
parent | c13b040e67eacb4f22f2ea7650561fee627dbcb9 (diff) | |
download | ansible-87d9b49de256d788eacc88010ed7585b6c260a2e.tar.gz |
Fix listing of colleciton plugins with symlinks (#69305)
* Fix listing of colleciton plugins with symlinks
Diffstat (limited to 'test')
3 files changed, 39 insertions, 1 deletions
diff --git a/test/integration/targets/collections/runme.sh b/test/integration/targets/collections/runme.sh index 5aea771bda..98471b2761 100755 --- a/test/integration/targets/collections/runme.sh +++ b/test/integration/targets/collections/runme.sh @@ -9,7 +9,7 @@ export ANSIBLE_HOST_PATTERN_MISMATCH=error # FUTURE: just use INVENTORY_PATH as-is once ansible-test sets the right dir -ipath=../../$(basename "${INVENTORY_PATH}") +ipath=../../$(basename "${INVENTORY_PATH:-../../inventory}") export INVENTORY_PATH="$ipath" # test callback @@ -17,6 +17,11 @@ ANSIBLE_CALLBACK_WHITELIST=testns.testcoll.usercallback ansible localhost -m pin # test documentation ansible-doc testns.testcoll.testmodule -vvv | grep -- "- normal_doc_frag" +# same with symlink +ln -s "${PWD}/testcoll2" ./collection_root_sys/ansible_collections/testns/testcoll2 +ansible-doc testns.testcoll2.testmodule2 -vvv | grep "Test module" +# now test we can list with symlink +ansible-doc -l -vvv| grep "testns.testcoll2.testmodule2" # test adhoc default collection resolution (use unqualified collection module with playbook dir under its collection) echo "testing adhoc default collection support with explicit playbook dir" diff --git a/test/integration/targets/collections/testcoll2/MANIFEST.json b/test/integration/targets/collections/testcoll2/MANIFEST.json new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/integration/targets/collections/testcoll2/MANIFEST.json diff --git a/test/integration/targets/collections/testcoll2/plugins/modules/testmodule2.py b/test/integration/targets/collections/testcoll2/plugins/modules/testmodule2.py new file mode 100644 index 0000000000..7f6eb0247b --- /dev/null +++ b/test/integration/targets/collections/testcoll2/plugins/modules/testmodule2.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +ANSIBLE_METADATA = {'metadata_version': '1.1', + 'status': ['stableinterface'], + 'supported_by': 'core'} + +DOCUMENTATION = ''' +--- +module: testmodule2 +short_description: Test module +description: + - Test module +author: + - Ansible Core Team +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +''' + +import json + + +def main(): + print(json.dumps(dict(changed=False, source='sys'))) + + +if __name__ == '__main__': + main() |