From cdcf0aa42aa5e4a1d74bcae35c5847b2e5888920 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Tue, 4 Aug 2020 12:53:31 -0500 Subject: [PATCH] Intentional coverage, incidental_azure_rm_resource (#71052) Change: - Adds some intentional coverage around PluginLoader for cases that incidental_azure_rm_resource covered. - Specifically, modules starting with an underscore, and starting with an underscore but a symlink. Test Plan: - CI Signed-off-by: Rick Elrod --- .../plugin_loader/normal/library/_symlink.py | 1 + .../plugin_loader/normal/library/_underscore.py | 13 +++++++++++++ .../targets/plugin_loader/normal/underscore.yml | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 120000 test/integration/targets/plugin_loader/normal/library/_symlink.py create mode 100644 test/integration/targets/plugin_loader/normal/library/_underscore.py create mode 100644 test/integration/targets/plugin_loader/normal/underscore.yml diff --git a/test/integration/targets/plugin_loader/normal/library/_symlink.py b/test/integration/targets/plugin_loader/normal/library/_symlink.py new file mode 120000 index 00000000000..c4142e74d43 --- /dev/null +++ b/test/integration/targets/plugin_loader/normal/library/_symlink.py @@ -0,0 +1 @@ +_underscore.py \ No newline at end of file diff --git a/test/integration/targets/plugin_loader/normal/library/_underscore.py b/test/integration/targets/plugin_loader/normal/library/_underscore.py new file mode 100644 index 00000000000..7a416a64879 --- /dev/null +++ b/test/integration/targets/plugin_loader/normal/library/_underscore.py @@ -0,0 +1,13 @@ +#!/usr/bin/python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import json + + +def main(): + print(json.dumps(dict(changed=False, source='legacy_library_dir'))) + + +if __name__ == '__main__': + main() diff --git a/test/integration/targets/plugin_loader/normal/underscore.yml b/test/integration/targets/plugin_loader/normal/underscore.yml new file mode 100644 index 00000000000..fb5bbad7fc9 --- /dev/null +++ b/test/integration/targets/plugin_loader/normal/underscore.yml @@ -0,0 +1,15 @@ +- hosts: testhost + gather_facts: false + tasks: + - name: Load a deprecated module + underscore: + register: res + + - name: Load a deprecated module that is a symlink + symlink: + register: sym + + - assert: + that: + - res.source == 'legacy_library_dir' + - sym.source == 'legacy_library_dir'