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
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'recursive_requires.value == "Get-Test3: 2: Get-Test2, 1: Get-Test1, 3: Get-NewTest3"'
|
|
|
|
|
2017-07-20 01:57:05 +02:00
|
|
|
- name: call module with camel conversion tests
|
|
|
|
camel_conversion_test:
|
|
|
|
register: camel_conversion
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- camel_conversion.data == 'success'
|
2017-08-29 01:15:58 +02:00
|
|
|
|
2018-04-30 08:18:25 +02:00
|
|
|
- block:
|
|
|
|
- name: create test user with well know SID as the name
|
|
|
|
win_user:
|
|
|
|
name: S-1-0-0
|
|
|
|
password: AbcDef123!@#
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: call module with SID tests
|
|
|
|
sid_utils_test:
|
|
|
|
sid_account: S-1-0-0
|
|
|
|
register: sid_test
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: remove test SID user
|
|
|
|
win_user:
|
|
|
|
name: S-1-0-0
|
|
|
|
state: absent
|
2017-08-29 01:15:58 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- sid_test.data == 'success'
|
2017-09-13 18:58:49 +02:00
|
|
|
|
2017-10-23 01:49:40 +02:00
|
|
|
- name: create temp testing folder
|
2017-09-13 18:58:49 +02:00
|
|
|
win_file:
|
|
|
|
path: C:\ansible testing
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: download binary the outputs argv to stdout
|
|
|
|
win_get_url:
|
2019-05-15 02:50:56 +02:00
|
|
|
url: https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_win_module_utils/PrintArgv.exe
|
2017-09-13 18:58:49 +02:00
|
|
|
dest: C:\ansible testing\PrintArgv.exe
|
|
|
|
|
|
|
|
- name: call module with CommandUtil tests
|
|
|
|
command_util_test:
|
|
|
|
exe: C:\ansible testing\PrintArgv.exe
|
|
|
|
register: command_util
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- command_util.data == 'success'
|
|
|
|
|
2017-10-23 01:49:40 +02:00
|
|
|
- name: call module with ArgvParser tests
|
|
|
|
argv_parser_test:
|
|
|
|
exe: C:\ansible testing\PrintArgv.exe
|
|
|
|
register: argv_test
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- argv_test.data == 'success'
|
|
|
|
|
2017-11-16 01:12:02 +01:00
|
|
|
- name: call module with symbolic link tests
|
|
|
|
symbolic_link_test:
|
|
|
|
register: symbolic_link
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- symbolic_link.data == 'success'
|
|
|
|
|
2017-09-13 18:58:49 +02:00
|
|
|
- name: remove testing folder
|
|
|
|
win_file:
|
|
|
|
path: C:\ansible testing
|
|
|
|
state: absent
|
2017-11-16 01:04:03 +01:00
|
|
|
|
|
|
|
- name: call module with FileUtil tests
|
|
|
|
file_util_test:
|
|
|
|
register: file_util_test
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- file_util_test.data == 'success'
|
2018-07-30 23:48:54 +02:00
|
|
|
|
|
|
|
- name: call module with PrivilegeUtil tests
|
|
|
|
privilege_util_test:
|
|
|
|
register: privilege_util_test
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- privilege_util_test.data == 'success'
|
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}'
|
|
|
|
|
|
|
|
- name: call module with AddType tests
|
|
|
|
add_type_test:
|
|
|
|
register: add_type_test
|
|
|
|
|
|
|
|
- name: assert call module with AddType tests
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- not add_type_test is failed
|
|
|
|
- add_type_test.res == 'success'
|
2019-02-25 02:37:25 +01:00
|
|
|
|
|
|
|
- name: call module with BackupFile tests
|
|
|
|
backup_file_test:
|
|
|
|
register: backup_file_test
|
|
|
|
|
|
|
|
- name: assert call module with BackupFile tests
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- not backup_file_test is failed
|
|
|
|
- backup_file_test.res == 'success'
|