1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add integration test for #11821

This commit is contained in:
Toshio Kuratomi 2016-03-20 07:58:23 -07:00
parent b80c9b5032
commit cbd93b6ad3

View file

@ -150,3 +150,37 @@
get_url:
url: 'http://httpbin.org/redirect/6'
dest: "{{ output_dir }}/redirect.json"
- name: Test that setting file modes work
get_url:
url: 'http://www.ansible.com/'
dest: '{{ output_dir }}/test'
mode: '0707'
register: result
- stat:
path: "{{ output_dir }}/test"
register: stat_result
- name: Assert that the file has the right permissions
assert:
that:
- "result.changed == true"
- "stat_result.stat.mode == '0707'"
- name: Test that setting file modes on an already downlaoded file work
get_url:
url: 'http://www.ansible.com/'
dest: '{{ output_dir }}/test'
mode: '0070'
register: result
- stat:
path: "{{ output_dir }}/test"
register: stat_result
- name: Assert that the file has the right permissions
assert:
that:
- "result.changed == true"
- "stat_result.stat.mode == '0070'"