@@ -135,7 +135,8 @@ def setup_kdc(testdir, wrapenv):
135135
136136 kdcenv = {'PATH' : '/sbin:/bin:/usr/sbin:/usr/bin' ,
137137 'KRB5_CONFIG' : krb5conf ,
138- 'KRB5_KDC_PROFILE' : kdcconf }
138+ 'KRB5_KDC_PROFILE' : kdcconf ,
139+ 'KRB5_TRACE' : os .path .join (testdir , 'krbtrace.log' )}
139140 kdcenv .update (wrapenv )
140141
141142 with (open (testlog , 'a' )) as logfile :
@@ -263,6 +264,23 @@ def test_spnego_auth(testdir, testenv, testlog):
263264 sys .stderr .write ('SPNEGO: SUCCESS\n ' )
264265
265266
267+ def test_basic_auth_krb5 (testdir , testenv , testlog ):
268+
269+ basicdir = os .path .join (testdir , 'httpd' , 'html' , 'basic_auth_krb5' )
270+ os .mkdir (basicdir )
271+ shutil .copy ('tests/index.html' , basicdir )
272+
273+ with (open (testlog , 'a' )) as logfile :
274+ basick5 = subprocess .Popen (["tests/t_basic_k5.py" ],
275+ stdout = logfile , stderr = logfile ,
276+ env = testenv , preexec_fn = os .setsid )
277+ basick5 .wait ()
278+ if basick5 .returncode != 0 :
279+ sys .stderr .write ('BASIC-AUTH: FAILED\n ' )
280+ else :
281+ sys .stderr .write ('BASIC-AUTH: SUCCESS\n ' )
282+
283+
266284if __name__ == '__main__' :
267285
268286 args = parse_args ()
@@ -282,14 +300,20 @@ def test_spnego_auth(testdir, testenv, testlog):
282300 kdcproc , kdcenv = setup_kdc (testdir , wrapenv )
283301 processes ['KDC(%d)' % kdcproc .pid ] = kdcproc
284302
285- httpproc = setup_http (testdir , wrapenv )
303+ httpproc = setup_http (testdir , kdcenv )
286304 processes ['HTTPD(%d)' % httpproc .pid ] = httpproc
287305
288306 keysenv = setup_keys (testdir , kdcenv )
289307 testenv = kinit_user (testdir , kdcenv )
290308
291309 test_spnego_auth (testdir , testenv , testlog )
292310
311+
312+ testenv = {'MAG_USER_NAME' : USR_NAME ,
313+ 'MAG_USER_PASSWORD' : USR_PWD }
314+ testenv .update (kdcenv )
315+ test_basic_auth_krb5 (testdir , testenv , testlog )
316+
293317 finally :
294318 with (open (testlog , 'a' )) as logfile :
295319 for name in processes :
0 commit comments