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