summaryrefslogtreecommitdiffstats
path: root/tests/magtests.py
diff options
context:
space:
mode:
authorJames Groffen <james.groffen@dsto.defence.gov.au>2016-01-08 17:01:50 +1030
committerSimo Sorce <simo@redhat.com>2016-02-17 18:59:31 -0500
commitf9cc36700c95a88ff7d7489167094556ac0e75cc (patch)
tree030e0fa04d5e075e13620f2480409984996c07c0 /tests/magtests.py
parentf29a1574c94ad8875626d4d707cc712a6f68ee29 (diff)
downloadmod_auth_gssapi-f9cc36700c95a88ff7d7489167094556ac0e75cc.tar.gz
mod_auth_gssapi-f9cc36700c95a88ff7d7489167094556ac0e75cc.tar.xz
mod_auth_gssapi-f9cc36700c95a88ff7d7489167094556ac0e75cc.zip
Add option to not send a Negotiate headers
If negotiation was attempted but failed do not send a new Negotiate header. Useful when only one single sign on mechanism is allowed and to avoid misleading login prompts in some browsers. Added a test of the GssapiDontReauth option to the test suite. Also added SPNEGO no auth test. [SS: reworded and fixed commit subject/comment] [SS: fixed whitespace errors and 80 column wrappings] Reviewed-by: Simo Sorce <simo@redhat.com> Close #65
Diffstat (limited to 'tests/magtests.py')
-rwxr-xr-xtests/magtests.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/magtests.py b/tests/magtests.py
index 8075197..5abede0 100755
--- a/tests/magtests.py
+++ b/tests/magtests.py
@@ -283,6 +283,34 @@ def test_spnego_auth(testdir, testenv, testlog):
else:
sys.stderr.write('SPNEGO Proxy Auth: SUCCESS\n')
+ with (open(testlog, 'a')) as logfile:
+ spnego = subprocess.Popen(["tests/t_spnego_no_auth.py"],
+ stdout=logfile, stderr=logfile,
+ env=testenv, preexec_fn=os.setsid)
+ spnego.wait()
+ if spnego.returncode != 0:
+ sys.stderr.write('SPNEGO No Auth: FAILED\n')
+ else:
+ sys.stderr.write('SPNEGO No Auth: SUCCESS\n')
+
+
+def test_spnego_negotiate_once(testdir, testenv, testlog):
+
+ spnego_negotiate_once_dir = os.path.join(testdir, 'httpd', 'html',
+ 'spnego_negotiate_once')
+ os.mkdir(spnego_negotiate_once_dir)
+ shutil.copy('tests/index.html', spnego_negotiate_once_dir)
+
+ with (open(testlog, 'a')) as logfile:
+ spnego = subprocess.Popen(["tests/t_spnego_negotiate_once.py"],
+ stdout=logfile, stderr=logfile,
+ env=testenv, preexec_fn=os.setsid)
+ spnego.wait()
+ if spnego.returncode != 0:
+ sys.stderr.write('SPNEGO Negotiate Once: FAILED\n')
+ else:
+ sys.stderr.write('SPNEGO Negotiate Once: SUCCESS\n')
+
def test_basic_auth_krb5(testdir, testenv, testlog):
@@ -358,6 +386,7 @@ if __name__ == '__main__':
test_spnego_auth(testdir, testenv, testlog)
+ test_spnego_negotiate_once(testdir, testenv, testlog)
testenv = {'MAG_USER_NAME': USR_NAME,
'MAG_USER_PASSWORD': USR_PWD,