diff options
author | James Groffen <james.groffen@dsto.defence.gov.au> | 2016-01-08 17:01:50 +1030 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2016-02-17 18:59:31 -0500 |
commit | f9cc36700c95a88ff7d7489167094556ac0e75cc (patch) | |
tree | 030e0fa04d5e075e13620f2480409984996c07c0 /tests/magtests.py | |
parent | f29a1574c94ad8875626d4d707cc712a6f68ee29 (diff) | |
download | mod_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-x | tests/magtests.py | 29 |
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, |