diff options
Diffstat (limited to 'proxy/tests/t_interpose.py')
| -rw-r--r-- | proxy/tests/t_interpose.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/proxy/tests/t_interpose.py b/proxy/tests/t_interpose.py new file mode 100644 index 0000000..82557c0 --- /dev/null +++ b/proxy/tests/t_interpose.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +# Copyright (C) 2014,2015,2016 - GSS-Proxy contributors; see COPYING for the license + +from testlib import * + +def run(testdir, env, conf): + print("Testing interposer...", file=sys.stderr) + logfile = conf['logfile'] + + ienv = {"KRB5CCNAME": os.path.join(testdir, 'interpose_ccache'), + "KRB5_KTNAME": os.path.join(testdir, SVC_KTNAME)} + ienv.update(env) + usr_keytab = os.path.join(testdir, USR_KTNAME) + + ksetup = subprocess.Popen(["kinit", "-kt", usr_keytab, USR_NAME], + stdout=logfile, stderr=logfile, + env=ienv, preexec_fn=os.setsid) + ksetup.wait() + if ksetup.returncode != 0: + raise ValueError('Kinit %s failed' % USR_NAME) + + itest = subprocess.Popen(["./interposetest", "-t", + "host@%s" % WRAP_HOSTNAME], + stdout=logfile, stderr=logfile, + env=ienv) + itest.wait() + print_success("SUCCESS" if itest.returncode == 0 else "FAILED", + "Interpose test returned %s" % str(itest.returncode)) |
