diff options
| author | Robbie Harwood <rharwood@redhat.com> | 2016-12-07 20:15:14 +0000 |
|---|---|---|
| committer | Simo Sorce <simo@redhat.com> | 2017-01-12 11:52:20 -0500 |
| commit | 75cef8a29218ec6f55a979ce9e30535249d1dd3d (patch) | |
| tree | b22471e68e63531e8013c9ff91f88b50290e5e59 /proxy/tests/t_interpose.py | |
| parent | 3be3f605d2a89cbda85f8bcf5b06f431a050cb9f (diff) | |
Split out each test into its own file
Some naming and scoping issues are also fixed here in order for the
result to run.
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
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)) |
