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/uri/tasks/unexpected-failures.yml

28 lines
727 B
YAML
Raw Normal View History

---
# same as expanduser & expandvars called on managed host
- command: 'echo {{ output_dir }}'
register: echo
- set_fact:
remote_dir_expanded: '{{ echo.stdout }}'
- name: ensure test directory doesn't exist
file:
path: '{{ output_dir }}/non/existent/path'
state: absent
- name: destination doesn't exist
uri:
url: 'https://{{ httpbin_host }}/get'
dest: '{{ output_dir }}/non/existent/path'
ignore_errors: true
register: ret
- name: check that unexpected failure didn't happen
assert:
that:
- ret is failed
- "not ret.msg.startswith('MODULE FAILURE')"
- '"Destination dir ''" ~ remote_dir_expanded ~ "/non/existent'' not writable" in ret.msg'
- ret.status == 200