Blame SOURCES/Fix-tests-to-work-with-python3.patch

8f2224
From 613933383aa352bb8f350f43ecb393a0604016cc Mon Sep 17 00:00:00 2001
8f2224
From: Robbie Harwood <rharwood@redhat.com>
8f2224
Date: Fri, 21 Dec 2018 11:50:16 -0500
8f2224
Subject: [PATCH] Fix tests to work with python3
8f2224
8f2224
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
8f2224
(cherry picked from commit 751eb09e7abf38f49fc525e1616d48a6f951673f)
8f2224
(cherry picked from commit d2748e79d31f153505f944b09a4790c6231dcd79)
8f2224
---
8f2224
 tests/magtests.py       | 3 ++-
8f2224
 tests/t_spnego_proxy.py | 2 +-
8f2224
 2 files changed, 3 insertions(+), 2 deletions(-)
8f2224
8f2224
diff --git a/tests/magtests.py b/tests/magtests.py
8f2224
index 6414503..f14f47a 100755
8f2224
--- a/tests/magtests.py
8f2224
+++ b/tests/magtests.py
8f2224
@@ -431,7 +431,7 @@ def kinit_user(testdir, kdcenv):
8f2224
                                  stdin=subprocess.PIPE,
8f2224
                                  stdout=logfile, stderr=logfile,
8f2224
                                  env=testenv, preexec_fn=os.setsid)
8f2224
-        kinit.communicate('%s\n' % USR_PWD)
8f2224
+        kinit.communicate(('%s\n' % USR_PWD).encode("utf8"))
8f2224
         kinit.wait()
8f2224
         if kinit.returncode != 0:
8f2224
             raise ValueError('kinit failed')
8f2224
@@ -495,6 +495,7 @@ def test_spnego_auth(testdir, testenv, logfile):
8f2224
     else:
8f2224
         sys.stderr.write('SPNEGO No Auth: SUCCESS\n')
8f2224
 
8f2224
+
8f2224
     return error_count
8f2224
 
8f2224
 
8f2224
diff --git a/tests/t_spnego_proxy.py b/tests/t_spnego_proxy.py
8f2224
index 6219721..c47558b 100755
8f2224
--- a/tests/t_spnego_proxy.py
8f2224
+++ b/tests/t_spnego_proxy.py
8f2224
@@ -17,7 +17,7 @@ def getAuthToken(target):
8f2224
     ctx = gssapi.SecurityContext(name=name, mech=spnego_mech)
8f2224
     token = ctx.step()
8f2224
 
8f2224
-    return 'Negotiate %s' % b64encode(token)
8f2224
+    return 'Negotiate %s' % b64encode(token).decode()
8f2224
 
8f2224
 
8f2224
 if __name__ == '__main__':