URL: https://github.com/freeipa/freeipa/pull/1239
Author: tomaskrizek
 Title: #1239: [Backport][ipa-4-6] test_caless: open CA cert in binary mode
Action: opened

PR body:
"""
This PR was opened automatically because PR #1229 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1239/head:pr1239
git checkout pr1239
From d911c6e3456c9ead48de452d5d993660b04c0584 Mon Sep 17 00:00:00 2001
From: Michal Reznik <mrez...@redhat.com>
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
---
 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 d32e223579..ef33be2136 100644
--- a/ipatests/test_integration/test_caless.py
+++ b/ipatests/test_integration/test_caless.py
@@ -355,10 +355,10 @@ def verify_installation(self):
 
         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)
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to