summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/uri/tasks/unexpected-failures.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/uri/tasks/unexpected-failures.yml
parentInitial commit. (diff)
downloadansible-core-upstream.tar.xz
ansible-core-upstream.zip
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/uri/tasks/unexpected-failures.yml')
-rw-r--r--test/integration/targets/uri/tasks/unexpected-failures.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/integration/targets/uri/tasks/unexpected-failures.yml b/test/integration/targets/uri/tasks/unexpected-failures.yml
new file mode 100644
index 0000000..341b66e
--- /dev/null
+++ b/test/integration/targets/uri/tasks/unexpected-failures.yml
@@ -0,0 +1,26 @@
+---
+# same as expanduser & expandvars called on managed host
+- command: 'echo {{ remote_tmp_dir }}'
+ register: echo
+
+- set_fact:
+ remote_dir_expanded: '{{ echo.stdout }}'
+
+- name: ensure test directory doesn't exist
+ file:
+ path: '{{ remote_tmp_dir }}/non/existent/path'
+ state: absent
+
+- name: destination doesn't exist
+ uri:
+ url: 'https://{{ httpbin_host }}/get'
+ dest: '{{ remote_tmp_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')"
+ - '"Could not replace file" in ret.msg'