mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add test that validate_certs=no works
This commit is contained in:
parent
4d8427538d
commit
0f4a3409d8
1 changed files with 18 additions and 3 deletions
|
@ -26,7 +26,7 @@
|
|||
- result.changed
|
||||
- '"OK" in result.msg'
|
||||
|
||||
- name: test https fetch to a site with invalid domain
|
||||
- name: test https fetch to a site with mismatched hostname and certificate
|
||||
get_url:
|
||||
url: "https://kennethreitz.org/"
|
||||
dest: "{{ output_dir }}/shouldnotexist.html"
|
||||
|
@ -37,11 +37,26 @@
|
|||
path: "{{ output_dir }}/shouldnotexist.html"
|
||||
register: stat_result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- name: Assert that the file was not downloaded
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "'Certificate does not belong to ' in result.msg"
|
||||
- "stat_result.stat.exists == false"
|
||||
|
||||
- name: test https fetch to a site with mismatched hostname and certificate and validate_certs=no
|
||||
get_url:
|
||||
url: "https://kennethreitz.org/"
|
||||
dest: "{{ output_dir }}/kreitz.html"
|
||||
validate_certs: no
|
||||
register: result
|
||||
|
||||
- stat:
|
||||
path: "{{ output_dir }}/kreitz.html"
|
||||
register: stat_result
|
||||
|
||||
- name: Assert that the file was not downloaded
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- "stat_result.stat.exists == true"
|
||||
|
|
Loading…
Reference in a new issue