From 4a5e27961654da9905ed57f5e316a3db09f49178 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Tue, 19 Sep 2017 11:50:26 +0300 Subject: [PATCH] - More reliable testing of SNI with Ansible. - More concise list of packages of SNI support. - Don't upgrade pip for SNI support. --- tasks/sni.yml | 4 +--- tests/playbook.yml | 12 ++++++++++++ tests/test_sni.py | 12 ------------ 3 files changed, 13 insertions(+), 15 deletions(-) delete mode 100644 tests/test_sni.py diff --git a/tasks/sni.yml b/tasks/sni.yml index c820b38..7546671 100644 --- a/tasks/sni.yml +++ b/tasks/sni.yml @@ -16,11 +16,9 @@ - name: pip install SSL SNI support with_items: - - pip>=9.0.1 - urllib3[secure]>=1.11 - ndg-httpsclient>=0.4.0 - - setuptools[certs]>=28.1.0 - - requests[security]>=2.12.1 + - pyasn1 pip: name: '{{ item }}' state: present diff --git a/tests/playbook.yml b/tests/playbook.yml index 541cf58..7eb9cdc 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -20,3 +20,15 @@ - hosts: all roles: - role: python27 + post_tasks: + - name: Test SNI + get_url: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + dest: /tmp/nodesource.gpg.key + changed_when: False + + - name: Test pip install + pip: + name: netaddr + state: present + changed_when: False diff --git a/tests/test_sni.py b/tests/test_sni.py deleted file mode 100644 index eaddde1..0000000 --- a/tests/test_sni.py +++ /dev/null @@ -1,12 +0,0 @@ -import pytest -from testinfra.utils.ansible_runner import AnsibleRunner - -testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') - - -@pytest.mark.xfail -@pytest.mark.parametrize('error', [ - 'InsecureRequestWarning', 'InsecurePlatformWarning', 'SNIMissingWarning' -]) -def test_sni(Command, error): - assert error not in Command('pip2 install nonexistant-package').stderr -- GitLab