summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2018-09-11 13:56:13 -0500
committerGitHub <noreply@github.com>2018-09-11 13:56:13 -0500
commit5785de582f99c13d02cb1dbb03af76cacdb5182d (patch)
treef884a3a1bb24f2c6b2912761a1d286003236c692 /test
parentb22b07e300b68e68cf21fbf6f268eb69194580ba (diff)
downloadansible-5785de582f99c13d02cb1dbb03af76cacdb5182d.tar.gz
Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes #45491 * Reduce logic complexity
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/get_url/tasks/main.yml13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/integration/targets/get_url/tasks/main.yml b/test/integration/targets/get_url/tasks/main.yml
index dc1644cfcc..170b080713 100644
--- a/test/integration/targets/get_url/tasks/main.yml
+++ b/test/integration/targets/get_url/tasks/main.yml
@@ -241,7 +241,7 @@
# https://github.com/ansible/ansible/issues/29614
- name: Change mode on an already downloaded file and specify checksum
get_url:
- url: 'https://{{ httpbin_host }}/'
+ url: 'https://{{ httpbin_host }}/get'
dest: '{{ output_dir }}/test'
checksum: 'sha256:7036ede810fad2b5d2e7547ec703cae8da61edbba43c23f9d7203a0239b765c4.'
mode: '0775'
@@ -257,6 +257,17 @@
- result is changed
- "stat_result.stat.mode == '0775'"
+- name: Get a file that already exists
+ get_url:
+ url: 'https://{{ httpbin_host }}/get'
+ dest: '{{ output_dir }}/test'
+ register: result
+
+- name: Assert that we didn't re-download unnecessarily
+ assert:
+ that:
+ - result is not changed
+
# https://github.com/ansible/ansible/issues/27617
- name: set role facts