@@ -34,27 +34,14 @@ describe('Kerberos', function () {
3434 client = null ;
3535 } ) ;
3636
37- if ( process . env . MONGODB_URI == null ) {
38- console . error ( 'skipping Kerberos tests, MONGODB_URI environment variable is not defined' ) ;
39- return ;
40- }
4137 let krb5Uri = process . env . MONGODB_URI ;
42- const parts = krb5Uri . split ( '@' , 2 ) ;
43- const host = parts [ 1 ] . split ( '/' ) [ 0 ] ;
38+ const host = process . env . SASL_HOST ;
4439
45- if ( ! process . env . KRB5_PRINCIPAL ) {
46- console . error ( 'skipping Kerberos tests, KRB5_PRINCIPAL environment variable is not defined' ) ;
40+ if ( ! process . env . PRINCIPAL ) {
41+ console . error ( 'skipping Kerberos tests, PRINCIPAL environment variable is not defined' ) ;
4742 return ;
4843 }
4944
50- if ( process . platform === 'win32' ) {
51- console . error ( 'Win32 run detected' ) ;
52- if ( process . env . LDAPTEST_PASSWORD == null ) {
53- throw new Error ( 'The env parameter LDAPTEST_PASSWORD must be set' ) ;
54- }
55- krb5Uri = `${ parts [ 0 ] } :${ process . env . LDAPTEST_PASSWORD } @${ parts [ 1 ] } ` ;
56- }
57-
5845 it ( 'should authenticate with original uri' , async function ( ) {
5946 client = new MongoClient ( krb5Uri ) ;
6047 await client . connect ( ) ;
@@ -277,7 +264,7 @@ describe('Kerberos', function () {
277264
278265 it ( 'should fail to authenticate with bad credentials' , async function ( ) {
279266 client = new MongoClient (
280- krb5Uri . replace ( encodeURIComponent ( process . env . KRB5_PRINCIPAL ) , 'bad%40creds.cc' )
267+ krb5Uri . replace ( encodeURIComponent ( process . env . PRINCIPAL ) , 'bad%40creds.cc' )
281268 ) ;
282269 const err = await client . connect ( ) . catch ( e => e ) ;
283270 expect ( err . message ) . to . match ( / A u t h e n t i c a t i o n f a i l e d / ) ;
0 commit comments