summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-05-28 15:35:25 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-05-28 15:35:25 -0700
commit0f4a3409d851c658a765c95442d985ea7b9a13ec (patch)
treea35a87d9fb2cd928fb25ab8101f89b82c247efdf
parent4d8427538dbf3b15e65622b56ff20a6fc67429fd (diff)
downloadansible-0f4a3409d851c658a765c95442d985ea7b9a13ec.tar.gz
Add test that validate_certs=no works
-rw-r--r--test/integration/roles/test_get_url/tasks/main.yml21
1 files changed, 18 insertions, 3 deletions
diff --git a/test/integration/roles/test_get_url/tasks/main.yml b/test/integration/roles/test_get_url/tasks/main.yml
index 6d016fe6be..3a6bc509c0 100644
--- a/test/integration/roles/test_get_url/tasks/main.yml
+++ b/test/integration/roles/test_get_url/tasks/main.yml
@@ -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"