From 2c7f8bf58643ca6e180197bd880719fa0c507f6f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 16 Mar 2020 16:38:47 -0700 Subject: [PATCH] Fix ansible-test windows-integration module refs. --- changelogs/fragments/ansible-test-windows-integration.yml | 2 ++ .../_data/playbooks/windows_coverage_setup.yml | 4 ++-- .../_data/playbooks/windows_coverage_teardown.yml | 8 ++++++-- test/lib/ansible_test/_internal/manage_ci.py | 2 +- .../ansible/windows/plugins/action/win_copy.py | 1 + .../ansible/windows/plugins/modules/win_acl.ps1 | 1 + .../ansible/windows/plugins/modules/win_acl.py | 1 + .../ansible/windows/plugins/modules/win_file.ps1 | 1 + .../ansible/windows/plugins/modules/win_file.py | 1 + .../ansible/windows/plugins/modules/win_ping.ps1 | 1 + .../ansible/windows/plugins/modules/win_ping.py | 1 + .../ansible/windows/plugins/modules/win_shell.ps1 | 1 + .../ansible/windows/plugins/modules/win_shell.py | 1 + 13 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/ansible-test-windows-integration.yml create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_copy.py create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.ps1 create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.py create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.ps1 create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.py create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.ps1 create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.py create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1 create mode 120000 test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.py diff --git a/changelogs/fragments/ansible-test-windows-integration.yml b/changelogs/fragments/ansible-test-windows-integration.yml new file mode 100644 index 00000000000..cf9cf264d68 --- /dev/null +++ b/changelogs/fragments/ansible-test-windows-integration.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test now uses modules from the ``ansible.windows`` collection for setup and teardown of ``windows-integration`` tests and code coverage diff --git a/test/lib/ansible_test/_data/playbooks/windows_coverage_setup.yml b/test/lib/ansible_test/_data/playbooks/windows_coverage_setup.yml index 9f173fa6b50..2e5ff9c6c3f 100644 --- a/test/lib/ansible_test/_data/playbooks/windows_coverage_setup.yml +++ b/test/lib/ansible_test/_data/playbooks/windows_coverage_setup.yml @@ -4,12 +4,12 @@ gather_facts: no tasks: - name: create temp directory - win_file: + ansible.windows.win_file: path: '{{ remote_temp_path }}' state: directory - name: allow everyone to write to coverage test dir - win_acl: + ansible.windows.win_acl: path: '{{ remote_temp_path }}' user: Everyone rights: Modify diff --git a/test/lib/ansible_test/_data/playbooks/windows_coverage_teardown.yml b/test/lib/ansible_test/_data/playbooks/windows_coverage_teardown.yml index 6aa36f9687c..85ddfa42143 100644 --- a/test/lib/ansible_test/_data/playbooks/windows_coverage_teardown.yml +++ b/test/lib/ansible_test/_data/playbooks/windows_coverage_teardown.yml @@ -2,6 +2,10 @@ - name: collect the coverage files from the Windows host hosts: windows gather_facts: no + # The collections keyword is required to allow fetch to work. + # See: https://github.com/ansible/ansible/issues/68269 + collections: + - ansible.windows tasks: - name: make sure all vars have been set assert: @@ -10,7 +14,7 @@ - remote_temp_path is defined - name: zip up all coverage files in the - win_shell: | + ansible.windows.win_shell: | $coverage_dir = '{{ remote_temp_path }}' $zip_file = Join-Path -Path $coverage_dir -ChildPath 'coverage.zip' if (Test-Path -LiteralPath $zip_file) { @@ -72,6 +76,6 @@ flat: yes - name: remove the temporary coverage directory - win_file: + ansible.windows.win_file: path: '{{ remote_temp_path }}' state: absent \ No newline at end of file diff --git a/test/lib/ansible_test/_internal/manage_ci.py b/test/lib/ansible_test/_internal/manage_ci.py index 8cac2bef660..0b5eb5a108f 100644 --- a/test/lib/ansible_test/_internal/manage_ci.py +++ b/test/lib/ansible_test/_internal/manage_ci.py @@ -76,7 +76,7 @@ class ManageWindowsCI: name = 'windows_%s' % self.core_ci.version env = ansible_environment(self.core_ci.args) - cmd = ['ansible', '-m', 'win_ping', '-i', '%s,' % name, name, '-e', ' '.join(extra_vars)] + cmd = ['ansible', '-m', 'ansible.windows.win_ping', '-i', '%s,' % name, name, '-e', ' '.join(extra_vars)] for dummy in range(1, 120): try: diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_copy.py b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_copy.py new file mode 120000 index 00000000000..0364d766ba5 --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/action/win_copy.py @@ -0,0 +1 @@ +../../../../../../plugins/action/win_copy.py \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.ps1 b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.ps1 new file mode 120000 index 00000000000..81d8afa3227 --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.ps1 @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_acl.ps1 \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.py b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.py new file mode 120000 index 00000000000..3a2434cfd46 --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_acl.py @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_acl.py \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.ps1 b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.ps1 new file mode 120000 index 00000000000..8ee5c2b588b --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.ps1 @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_file.ps1 \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.py b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.py new file mode 120000 index 00000000000..b4bc05837b5 --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_file.py @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_file.py \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.ps1 b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.ps1 new file mode 120000 index 00000000000..d7b25ed042a --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.ps1 @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_ping.ps1 \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.py b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.py new file mode 120000 index 00000000000..0b97c87bd6e --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_ping.py @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_ping.py \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1 b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1 new file mode 120000 index 00000000000..eb07a01749e --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1 @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_shell.ps1 \ No newline at end of file diff --git a/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.py b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.py new file mode 120000 index 00000000000..3c6f0749acb --- /dev/null +++ b/test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.py @@ -0,0 +1 @@ +../../../../../../plugins/modules/win_shell.py \ No newline at end of file