From 394430a61e6caa8462805c2b6fa58a8abb06832e Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 27 Jun 2016 18:58:13 -0700 Subject: [PATCH] Switch test_lookups to badssl/local testing. (#16466) * Switch test_lookups to badssl/local testing. * Use var for checking badssl host content. --- test/integration/roles/prepare_http_tests/defaults/main.yml | 1 + .../roles/prepare_http_tests/vars/httptester.yml | 1 + test/integration/roles/test_lookups/meta/main.yml | 1 + test/integration/roles/test_lookups/tasks/main.yml | 6 +++--- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/integration/roles/prepare_http_tests/defaults/main.yml b/test/integration/roles/prepare_http_tests/defaults/main.yml index c41faa2bd3..1114729623 100644 --- a/test/integration/roles/prepare_http_tests/defaults/main.yml +++ b/test/integration/roles/prepare_http_tests/defaults/main.yml @@ -1,3 +1,4 @@ badssl_host: wrong.host.badssl.com httpbin_host: httpbin.org sni_host: sni.velox.ch +badssl_host_substring: wrong.host.badssl.com diff --git a/test/integration/roles/prepare_http_tests/vars/httptester.yml b/test/integration/roles/prepare_http_tests/vars/httptester.yml index e5f46db630..0e23ae936a 100644 --- a/test/integration/roles/prepare_http_tests/vars/httptester.yml +++ b/test/integration/roles/prepare_http_tests/vars/httptester.yml @@ -2,3 +2,4 @@ badssl_host: fail.ansible.http.tests httpbin_host: ansible.http.tests sni_host: sni1.ansible.http.tests +badssl_host_substring: HTTP Client Testing Service diff --git a/test/integration/roles/test_lookups/meta/main.yml b/test/integration/roles/test_lookups/meta/main.yml index 1050c23ce3..ee75ae6e65 100644 --- a/test/integration/roles/test_lookups/meta/main.yml +++ b/test/integration/roles/test_lookups/meta/main.yml @@ -1,3 +1,4 @@ dependencies: - prepare_tests + - prepare_http_tests diff --git a/test/integration/roles/test_lookups/tasks/main.yml b/test/integration/roles/test_lookups/tasks/main.yml index 556f23e044..9539c45feb 100644 --- a/test/integration/roles/test_lookups/tasks/main.yml +++ b/test/integration/roles/test_lookups/tasks/main.yml @@ -231,7 +231,7 @@ - name: Test that retrieving a url with invalid cert fails set_fact: - web_data: "{{ lookup('url', 'https://www.kennethreitz.org/') }}" + web_data: "{{ lookup('url', 'https://{{ badssl_host }}/') }}" ignore_errors: True register: url_invalid_cert @@ -242,12 +242,12 @@ - name: Test that retrieving a url with invalid cert with validate_certs=False works set_fact: - web_data: "{{ lookup('url', 'https://www.kennethreitz.org/', validate_certs=False) }}" + web_data: "{{ lookup('url', 'https://{{ badssl_host }}/', validate_certs=False) }}" register: url_no_validate_cert - assert: that: - - "'www.kennethreitz.org' in web_data" + - "'{{ badssl_host_substring }}' in web_data" - name: Test cartesian lookup debug: var={{item}}