@@ -77,6 +77,12 @@ def setup_wrappers(base):
77
77
return wenv
78
78
79
79
80
+ def apply_venv (env ):
81
+ env ['PATH' ] = os .environ .get ('PATH' , '' )
82
+ env ['VIRTUAL_ENV' ] = os .environ .get ('VIRTUAL_ENV' , '' )
83
+ return env
84
+
85
+
80
86
TESTREALM = "MAG.DEV"
81
87
KDC_DBNAME = 'db.file'
82
88
KDC_STASH = 'stash.file'
@@ -314,7 +320,7 @@ def setup_kdc(testdir, wrapenv):
314
320
with open (kdcconf , 'w+' ) as f :
315
321
f .write (text )
316
322
317
- kdcenv = {'PATH' : '/sbin:/bin:/usr/sbin:/usr/bin' ,
323
+ kdcenv = {'PATH' : f '/sbin:/bin:/usr/sbin:/usr/bin: { wrapenv [ "PATH" ] } ' ,
318
324
'KRB5_CONFIG' : krb5conf ,
319
325
'KRB5_KDC_PROFILE' : kdcconf ,
320
326
'KRB5_TRACE' : os .path .join (testdir , 'krbtrace.log' )}
@@ -425,7 +431,7 @@ def setup_http(testdir, so_dir, wrapenv):
425
431
426
432
shutil .copy ('tests/401.html' , os .path .join (httpdir , 'html' ))
427
433
428
- httpenv = {'PATH' : '/sbin:/bin:/usr/sbin:/usr/bin' ,
434
+ httpenv = {'PATH' : f '/sbin:/bin:/usr/sbin:/usr/bin: { wrapenv [ "PATH" ] } ' ,
429
435
'MALLOC_CHECK_' : '3' ,
430
436
'MALLOC_PERTURB_' : str (random .randint (0 , 32767 ) % 255 + 1 )}
431
437
httpenv .update (wrapenv )
@@ -755,8 +761,7 @@ def faketime_setup(testenv):
755
761
756
762
757
763
def http_restart (testdir , so_dir , testenv ):
758
-
759
- httpenv = {'PATH' : '/sbin:/bin:/usr/sbin:/usr/bin' ,
764
+ httpenv = {'PATH' : f'/sbin:/bin:/usr/sbin:/usr/bin:{ testenv ["PATH" ]} ' ,
760
765
'MALLOC_CHECK_' : '3' ,
761
766
'MALLOC_PERTURB_' : str (random .randint (0 , 32767 ) % 255 + 1 )}
762
767
httpenv .update (testenv )
@@ -781,7 +786,7 @@ def http_restart(testdir, so_dir, testenv):
781
786
logfile = open (os .path .join (testdir , 'tests.log' ), 'w' )
782
787
errs = 0
783
788
try :
784
- wrapenv = setup_wrappers (testdir )
789
+ wrapenv = apply_venv ( setup_wrappers (testdir ) )
785
790
786
791
kdcproc , kdcenv = setup_kdc (testdir , wrapenv )
787
792
processes ['KDC(%d)' % kdcproc .pid ] = kdcproc
@@ -792,10 +797,6 @@ def http_restart(testdir, so_dir, testenv):
792
797
keysenv = setup_keys (testdir , kdcenv )
793
798
testenv = kinit_user (testdir , kdcenv )
794
799
795
- # support virtualenv
796
- testenv ['PATH' ] = os .environ .get ('PATH' , '' )
797
- testenv ['VIRTUAL_ENV' ] = os .environ .get ('VIRTUAL_ENV' , '' )
798
-
799
800
testenv ['DELEGCCACHE' ] = os .path .join (testdir , 'httpd' ,
800
801
USR_NAME + '@' + TESTREALM )
801
802
errs += test_spnego_auth (testdir , testenv , logfile )
@@ -826,8 +827,6 @@ def http_restart(testdir, so_dir, testenv):
826
827
'MAG_USER_NAME_2' : USR_NAME_2 ,
827
828
'MAG_USER_PASSWORD_2' : USR_PWD_2 }
828
829
testenv .update (kdcenv )
829
- testenv ['PATH' ] = os .environ .get ('PATH' , '' )
830
- testenv ['VIRTUAL_ENV' ] = os .environ .get ('VIRTUAL_ENV' , '' )
831
830
832
831
errs += test_basic_auth_krb5 (testdir , testenv , logfile )
833
832
0 commit comments