From a7d5492ea37bc381850b3722ae002836200bf31f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 1 Sep 2017 13:59:57 -0700 Subject: Fix github_issue test and enable in CI. --- test/integration/targets/get_url/tasks/main.yml | 2 +- test/integration/targets/github_issue/aliases | 1 + .../targets/github_issue/tasks/FreeBSD-python2.yml | 3 +++ .../targets/github_issue/tasks/MacOSX-python2.yml | 1 + .../targets/github_issue/tasks/default-python2.yml | 3 +++ .../targets/github_issue/tasks/default-python3.yml | 3 +++ test/integration/targets/github_issue/tasks/main.yml | 14 +++++++++++++- test/integration/targets/lookups/tasks/main.yml | 2 +- test/integration/targets/uri/tasks/main.yml | 2 +- 9 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 test/integration/targets/github_issue/tasks/FreeBSD-python2.yml create mode 100644 test/integration/targets/github_issue/tasks/MacOSX-python2.yml create mode 100644 test/integration/targets/github_issue/tasks/default-python2.yml create mode 100644 test/integration/targets/github_issue/tasks/default-python3.yml (limited to 'test/integration') diff --git a/test/integration/targets/get_url/tasks/main.yml b/test/integration/targets/get_url/tasks/main.yml index f7a9fa505f..d43499da0d 100644 --- a/test/integration/targets/get_url/tasks/main.yml +++ b/test/integration/targets/get_url/tasks/main.yml @@ -112,7 +112,7 @@ assert: that: - "result|failed" - - "'Failed to validate the SSL certificate' in result.msg" + - "'Failed to validate the SSL certificate' in result.msg or (result.msg | match('hostname .* doesn.t match .*'))" - "stat_result.stat.exists == false" - name: test https fetch to a site with mismatched hostname and certificate and validate_certs=no diff --git a/test/integration/targets/github_issue/aliases b/test/integration/targets/github_issue/aliases index cf28a97558..8e7d715f9c 100644 --- a/test/integration/targets/github_issue/aliases +++ b/test/integration/targets/github_issue/aliases @@ -1 +1,2 @@ destructive +posix/ci/group1 diff --git a/test/integration/targets/github_issue/tasks/FreeBSD-python2.yml b/test/integration/targets/github_issue/tasks/FreeBSD-python2.yml new file mode 100644 index 0000000000..6168af0426 --- /dev/null +++ b/test/integration/targets/github_issue/tasks/FreeBSD-python2.yml @@ -0,0 +1,3 @@ +- name: install py27-requests to avoid install via pip later + package: + name: py27-requests diff --git a/test/integration/targets/github_issue/tasks/MacOSX-python2.yml b/test/integration/targets/github_issue/tasks/MacOSX-python2.yml new file mode 100644 index 0000000000..687b02517f --- /dev/null +++ b/test/integration/targets/github_issue/tasks/MacOSX-python2.yml @@ -0,0 +1 @@ +# nothing to do here, allow requests to be installed by pip later diff --git a/test/integration/targets/github_issue/tasks/default-python2.yml b/test/integration/targets/github_issue/tasks/default-python2.yml new file mode 100644 index 0000000000..33a2765121 --- /dev/null +++ b/test/integration/targets/github_issue/tasks/default-python2.yml @@ -0,0 +1,3 @@ +- name: install python-requests to avoid install via pip later + package: + name: python-requests diff --git a/test/integration/targets/github_issue/tasks/default-python3.yml b/test/integration/targets/github_issue/tasks/default-python3.yml new file mode 100644 index 0000000000..d776a675c6 --- /dev/null +++ b/test/integration/targets/github_issue/tasks/default-python3.yml @@ -0,0 +1,3 @@ +- name: install python3-requests to avoid install via pip later + package: + name: python3-requests diff --git a/test/integration/targets/github_issue/tasks/main.yml b/test/integration/targets/github_issue/tasks/main.yml index fb29058b1e..eed2de34f9 100644 --- a/test/integration/targets/github_issue/tasks/main.yml +++ b/test/integration/targets/github_issue/tasks/main.yml @@ -17,6 +17,11 @@ # along with Ansible. If not, see . # +- name: make sure github3.py is not installed + pip: + name: github3.py + state: absent + # Testcase 0001: Check if dependency is installed - name: Check if github3.py is installed or not github_issue: @@ -33,10 +38,17 @@ - "{{ lib_missing.changed == False }}" - "{{ 'Missing required github3 module.' in lib_missing.msg }}" +- include: '{{ item }}' + with_first_found: + - files: + - '{{ ansible_distribution }}-{{ ansible_distribution_version }}-python{{ ansible_python_version.split(".")[0] }}.yml' + - '{{ ansible_distribution }}-python{{ ansible_python_version.split(".")[0] }}.yml' + - '{{ ansible_os_family }}-python{{ ansible_python_version.split(".")[0] }}.yml' + - 'default-python{{ ansible_python_version.split(".")[0] }}.yml' + - name: make sure github3.py is installed pip: name: github3.py - state: latest # Testcase 0002: Check if issue exists - name: Check if GitHub issue is closed or not diff --git a/test/integration/targets/lookups/tasks/main.yml b/test/integration/targets/lookups/tasks/main.yml index 877b319709..6153d38def 100644 --- a/test/integration/targets/lookups/tasks/main.yml +++ b/test/integration/targets/lookups/tasks/main.yml @@ -245,7 +245,7 @@ - assert: that: - "url_invalid_cert.failed" - - "'Error validating the server' in url_invalid_cert.msg" + - "'Error validating the server' in url_invalid_cert.msg or (url_invalid_cert.msg | search('hostname .* doesn.t match .*'))" - name: Test that retrieving a url with invalid cert with validate_certs=False works set_fact: diff --git a/test/integration/targets/uri/tasks/main.yml b/test/integration/targets/uri/tasks/main.yml index e070f5e9ca..d5844b284c 100644 --- a/test/integration/targets/uri/tasks/main.yml +++ b/test/integration/targets/uri/tasks/main.yml @@ -103,7 +103,7 @@ assert: that: - "result.failed == true" - - "'Failed to validate the SSL certificate' in result.msg" + - "'Failed to validate the SSL certificate' in result.msg or (result.msg | match('hostname .* doesn.t match .*'))" - "stat_result.stat.exists == false" - name: Clean up any cruft from the results directory -- cgit v1.2.1