From 5e4f76b043d9416f0e26912b8d17f968234c98c5 Mon Sep 17 00:00:00 2001 From: Michal Reznik Date: Fri, 3 Nov 2017 13:04:00 +0100 Subject: [PATCH] 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 --- ipatests/test_integration/test_caless.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index d32e22357..ef33be213 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -355,10 +355,10 @@ class CALessBase(IntegrationTest): 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() 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) logger.debug('Expected binary CA cert:\n%r', expected_cacrt)