diff options
author | Jordan Borean <jborean93@gmail.com> | 2020-03-02 16:12:08 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 16:12:08 +1000 |
commit | 97d2d4512fb6686cba7ab07126658810ba0e43c2 (patch) | |
tree | 4ad4392db64ea6734f9efc41637ccae18c8bdd7d /test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks | |
parent | c66ee7e994d4211cf96eecdac1d7ebfaeae2f0f0 (diff) | |
download | ansible-97d2d4512fb6686cba7ab07126658810ba0e43c2.tar.gz |
Separated ps module_util test targets, added WebRequest tests (#67914)
* Separated ps module_util test targets, added WebRequest tests
* Simplify header test
Diffstat (limited to 'test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks')
-rw-r--r-- | test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks/main.yml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks/main.yml b/test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks/main.yml new file mode 100644 index 0000000000..0bd10558ce --- /dev/null +++ b/test/integration/targets/module_utils_Ansible.ModuleUtils.Legacy/tasks/main.yml @@ -0,0 +1,41 @@ +# NB: these tests are just a placeholder until we have pester unit tests. +# They are being run as part of the Windows smoke tests. Please do not significantly +# increase the size of these tests, as the smoke tests need to remain fast. +# Any significant additions should be made to the (as yet nonexistent) PS module_utils unit tests. +--- +- name: find a nonexistent drive letter + raw: foreach($c in [char[]]([char]'D'..[char]'Z')) { If (-not $(Get-PSDrive $c -ErrorAction SilentlyContinue)) { return $c } } + register: bogus_driveletter + +- assert: + that: bogus_driveletter.stdout_lines[0] | length == 1 + +- name: test path shape validation + testpath: + path: "{{ item.path }}" + failed_when: path_shapes is failed != (item.should_fail | default(false)) + register: path_shapes + with_items: + - path: C:\Windows + - path: HKLM:\Software + - path: '{{ bogus_driveletter.stdout_lines[0] }}:\goodpath' + - path: '{{ bogus_driveletter.stdout_lines[0] }}:\badpath*%@:\blar' + should_fail: true + +- name: test list parameters + testlist: + value: '{{item.value}}' + register: list_tests + failed_when: list_tests is failed or list_tests.count != item.count + with_items: + - value: [] + count: 0 + - value: + - 1 + - 2 + count: 2 + - value: + - 1 + count: 1 + - value: "1, 2" + count: 2 |