Skip to content
Snippets Groups Projects
Commit fafd39f2 authored by nimrod's avatar nimrod
Browse files

- Moved TLS 1.2 test to a different file, use urllib instead of requests

because requests is not installed by default (only when working around
SNI issues).
parent 1539285a
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,3 @@ testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
])
def test_sni(Command, error):
assert error not in Command('pip2 install nonexistant-package').stderr
def test_tls12(Command):
pycommand = '''import requests;
print(requests.get('https://www.howsmyssl.com/a/check',
verify=False).json()['tls_version'])'''
assert 'TLS 1.2' == Command('python2 -c \"%s\"' % pycommand).stdout.strip()
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
def test_tls12(Command):
pycommand = '''import urllib2, json
print(json.loads(urllib2.urlopen(urllib2.Request(
'https://www.howsmyssl.com/a/check')).read())['tls_version'])'''
assert 'TLS 1.2' == Command('python2 -c \"%s\"' % pycommand).stdout.strip()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment