2017-07-19 05:44:01 +02:00
|
|
|
- name: call old WANTS_JSON module
|
|
|
|
legacy_only_old_way:
|
|
|
|
register: old_way
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- old_way.data == 'success'
|
|
|
|
|
|
|
|
- name: call module with only legacy requires
|
|
|
|
legacy_only_new_way:
|
|
|
|
register: new_way
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- new_way.data == 'success'
|
|
|
|
|
2018-04-05 23:13:31 +02:00
|
|
|
- name: call old WANTS_JSON module with windows line endings
|
|
|
|
legacy_only_old_way_win_line_ending:
|
|
|
|
register: old_way_win
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- old_way_win.data == 'success'
|
|
|
|
|
|
|
|
- name: call module with only legacy requires and windows line endings
|
|
|
|
legacy_only_new_way_win_line_ending:
|
|
|
|
register: new_way_win
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- new_way_win.data == 'success'
|
|
|
|
|
2017-07-19 05:44:01 +02:00
|
|
|
- name: call module with local module_utils
|
|
|
|
uses_local_utils:
|
|
|
|
register: local_utils
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- local_utils.data == "ValueFromCustomFunction"
|
|
|
|
|
|
|
|
- name: call module that imports bogus Ansible-named module_utils
|
|
|
|
uses_bogus_utils:
|
|
|
|
ignore_errors: true
|
|
|
|
register: bogus_utils
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- bogus_utils is failed
|
|
|
|
- bogus_utils.msg is search("Could not find")
|
2017-07-20 01:57:05 +02:00
|
|
|
|
2018-07-24 00:16:16 +02:00
|
|
|
- name: call module that imports module_utils with further imports
|
|
|
|
recursive_requires:
|
|
|
|
register: recursive_requires
|
2019-08-27 23:03:23 +02:00
|
|
|
vars:
|
|
|
|
# Our coverage runner does not work with recursive required. This is a limitation on PowerShell so we need to
|
|
|
|
# disable coverage for this task
|
|
|
|
_ansible_coverage_remote_output: ''
|
2018-07-24 00:16:16 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'recursive_requires.value == "Get-Test3: 2: Get-Test2, 1: Get-Test1, 3: Get-NewTest3"'
|
|
|
|
|
2018-10-03 00:55:53 +02:00
|
|
|
- name: call module with C# reference
|
|
|
|
csharp_util:
|
|
|
|
register: csharp_res
|
|
|
|
|
|
|
|
- name: assert call module with C# reference
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- not csharp_res is failed
|
|
|
|
- csharp_res.res == '{"a":"a","b":1}'
|