summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-05-28 21:35:37 +0200
committerToshio Kuratomi <toshio@fedoraproject.org>2015-05-28 21:35:37 +0200
commit1ccf2a4685d136a81d266ed5728c7f2c9b7351e4 (patch)
tree0b021a4ffdeb2aafc97f6cbdecbcc2a1ddff76e4 /test
parentUpdate submodule ref (diff)
downloadansible-1ccf2a4685d136a81d266ed5728c7f2c9b7351e4.tar.xz
ansible-1ccf2a4685d136a81d266ed5728c7f2c9b7351e4.zip
Make fetch_url check the server's certificate on https connections
Diffstat (limited to 'test')
-rw-r--r--test/integration/roles/test_get_url/tasks/main.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/roles/test_get_url/tasks/main.yml b/test/integration/roles/test_get_url/tasks/main.yml
index 1aa4b287ea..6d016fe6be 100644
--- a/test/integration/roles/test_get_url/tasks/main.yml
+++ b/test/integration/roles/test_get_url/tasks/main.yml
@@ -25,3 +25,23 @@
that:
- result.changed
- '"OK" in result.msg'
+
+- name: test https fetch to a site with invalid domain
+ get_url:
+ url: "https://kennethreitz.org/"
+ dest: "{{ output_dir }}/shouldnotexist.html"
+ ignore_errors: True
+ register: result
+
+- stat:
+ 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"