From 3e9408e317c24bba448ea45c17a6c8c28543f6d6 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 23 Feb 2016 11:48:09 -0600 Subject: [PATCH] Add some additional integration tests that mix SSL verification and redirects --- .../integration/roles/test_uri/tasks/main.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/integration/roles/test_uri/tasks/main.yml b/test/integration/roles/test_uri/tasks/main.yml index 4d8f9c7db09..234e32bcb50 100644 --- a/test/integration/roles/test_uri/tasks/main.yml +++ b/test/integration/roles/test_uri/tasks/main.yml @@ -153,6 +153,28 @@ that: - 'result.location|default("") == "http://httpbin.org/relative-redirect/1"' +- name: Check SSL with redirect + uri: + url: 'https://httpbin.org/redirect/2' + register: result + +- name: Assert SSL with redirect + assert: + that: + - 'result.url|default("") == "https://httpbin.org/get"' + +- name: redirect to bad SSL site + uri: + url: 'http://wrong.host.badssl.com' + register: result + ignore_errors: true + +- name: Ensure bad SSL site reidrect fails + assert: + that: + - result|failed + - '"wrong.host.badssl.com" in result.msg' + - name: test basic auth uri: url: 'http://httpbin.org/basic-auth/user/passwd'