X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mod_auth_gssapi.git;a=blobdiff_plain;f=tests%2Fmagtests.py;h=27f55f2a85c8ce649fd76d73a005606d0648296b;hp=4d4cb49b285ae4cf5cb4d90ffaaae87abbf01ece;hb=47de8ee6c742264ff03e9e3786cca3dabbedff4c;hpb=ecd5b7c10b3bf1a93ce3653f9d1557177d913855 diff --git a/tests/magtests.py b/tests/magtests.py index 4d4cb49..27f55f2 100755 --- a/tests/magtests.py +++ b/tests/magtests.py @@ -135,7 +135,8 @@ def setup_kdc(testdir, wrapenv): kdcenv = {'PATH': '/sbin:/bin:/usr/sbin:/usr/bin', 'KRB5_CONFIG': krb5conf, - 'KRB5_KDC_PROFILE': kdcconf} + 'KRB5_KDC_PROFILE': kdcconf, + 'KRB5_TRACE': os.path.join(testdir, 'krbtrace.log')} kdcenv.update(wrapenv) with (open(testlog, 'a')) as logfile: @@ -263,6 +264,23 @@ def test_spnego_auth(testdir, testenv, testlog): sys.stderr.write('SPNEGO: SUCCESS\n') +def test_basic_auth_krb5(testdir, testenv, testlog): + + basicdir = os.path.join(testdir, 'httpd', 'html', 'basic_auth_krb5') + os.mkdir(basicdir) + shutil.copy('tests/index.html', basicdir) + + with (open(testlog, 'a')) as logfile: + basick5 = subprocess.Popen(["tests/t_basic_k5.py"], + stdout=logfile, stderr=logfile, + env=testenv, preexec_fn=os.setsid) + basick5.wait() + if basick5.returncode != 0: + sys.stderr.write('BASIC-AUTH: FAILED\n') + else: + sys.stderr.write('BASIC-AUTH: SUCCESS\n') + + if __name__ == '__main__': args = parse_args() @@ -282,7 +300,7 @@ if __name__ == '__main__': kdcproc, kdcenv = setup_kdc(testdir, wrapenv) processes['KDC(%d)' % kdcproc.pid] = kdcproc - httpproc = setup_http(testdir, wrapenv) + httpproc = setup_http(testdir, kdcenv) processes['HTTPD(%d)' % httpproc.pid] = httpproc keysenv = setup_keys(testdir, kdcenv) @@ -290,6 +308,12 @@ if __name__ == '__main__': test_spnego_auth(testdir, testenv, testlog) + + testenv = {'MAG_USER_NAME': USR_NAME, + 'MAG_USER_PASSWORD': USR_PWD} + testenv.update(kdcenv) + test_basic_auth_krb5(testdir, testenv, testlog) + finally: with (open(testlog, 'a')) as logfile: for name in processes: