test_caless: open CA cert in binary mode

When running test_caless suite in py3 we need to open CA cert in
binary mode so we can provide bytes later for python-cryptography.

https://pagure.io/freeipa/issue/7131

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Michal Reznik 2017-11-03 13:04:00 +01:00 committed by Tomas Krizek
parent 59e136e8ba
commit 5e4f76b043
No known key found for this signature in database
GPG Key ID: 22A2A94B5E49415A

View File

@ -355,10 +355,10 @@ class CALessBase(IntegrationTest):
Called from every positive server install test Called from every positive server install test
""" """
with open(self.pem_filename) as f: with open(self.pem_filename, 'rb') as f:
expected_cacrt = f.read() expected_cacrt = f.read()
logger.debug('Expected /etc/ipa/ca.crt contents:\n%s', logger.debug('Expected /etc/ipa/ca.crt contents:\n%s',
expected_cacrt) expected_cacrt.decode('utf-8'))
expected_cacrt = x509.load_unknown_x509_certificate(expected_cacrt) expected_cacrt = x509.load_unknown_x509_certificate(expected_cacrt)
logger.debug('Expected binary CA cert:\n%r', logger.debug('Expected binary CA cert:\n%r',
expected_cacrt) expected_cacrt)