Fix github_issue test and enable in CI.

This commit is contained in:
Matt Clay 2017-09-01 13:59:57 -07:00
parent 6e79dfb5f3
commit a7d5492ea3
9 changed files with 27 additions and 4 deletions

View file

@ -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

View file

@ -1 +1,2 @@
destructive
posix/ci/group1

View file

@ -0,0 +1,3 @@
- name: install py27-requests to avoid install via pip later
package:
name: py27-requests

View file

@ -0,0 +1 @@
# nothing to do here, allow requests to be installed by pip later

View file

@ -0,0 +1,3 @@
- name: install python-requests to avoid install via pip later
package:
name: python-requests

View file

@ -0,0 +1,3 @@
- name: install python3-requests to avoid install via pip later
package:
name: python3-requests

View file

@ -17,6 +17,11 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
- 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

View file

@ -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:

View file

@ -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