1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/win_module_utils_legacy/tasks/main.yml
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
2017-11-27 17:58:08 -05:00

41 lines
1.3 KiB
YAML

# 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