File tree 6 files changed +52
-117
lines changed
6 files changed +52
-117
lines changed Original file line number Diff line number Diff line change @@ -1076,6 +1076,13 @@ tasks:
1076
1076
VERSION : latest
1077
1077
TOPOLOGY : server
1078
1078
- func : run tls tests
1079
+ - name : test-auth-ldap
1080
+ tags :
1081
+ - auth
1082
+ - ldap
1083
+ commands :
1084
+ - func : install dependencies
1085
+ - func : run ldap tests
1079
1086
- name : test-latest-ocsp-valid-cert-server-staples
1080
1087
tags :
1081
1088
- ocsp
@@ -1371,6 +1378,7 @@ buildvariants:
1371
1378
- test-2.6-sharded_cluster-unified
1372
1379
- test-atlas-connectivity
1373
1380
- test-tls-support
1381
+ - test-auth-ldap
1374
1382
- test-latest-ocsp-valid-cert-server-staples
1375
1383
- test-latest-ocsp-invalid-cert-server-staples
1376
1384
- test-latest-ocsp-valid-cert-server-does-not-staple
@@ -1482,6 +1490,7 @@ buildvariants:
1482
1490
- test-2.6-replica_set-unified
1483
1491
- test-2.6-sharded_cluster-unified
1484
1492
- test-atlas-connectivity
1493
+ - test-auth-ldap
1485
1494
- name : ubuntu-14.04-dubnium
1486
1495
display_name : Ubuntu 14.04 Node Dubnium
1487
1496
run_on : ubuntu1404-test
@@ -1557,6 +1566,7 @@ buildvariants:
1557
1566
- test-3.2-sharded_cluster-unified
1558
1567
- test-atlas-connectivity
1559
1568
- test-tls-support
1569
+ - test-auth-ldap
1560
1570
- test-latest-ocsp-valid-cert-server-staples
1561
1571
- test-latest-ocsp-invalid-cert-server-staples
1562
1572
- test-latest-ocsp-valid-cert-server-does-not-staple
Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ TASKS.push(
126
126
} ,
127
127
{ func : 'run tls tests' }
128
128
]
129
+ } ,
130
+ {
131
+ name : 'test-auth-ldap' ,
132
+ tags : [ 'auth' , 'ldap' ] ,
133
+ commands : [ { func : 'install dependencies' } , { func : 'run ldap tests' } ]
129
134
}
130
135
) ;
131
136
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -o errexit # Exit the script with error if any of the commands fail
4
+
5
+ export PROJECT_DIRECTORY=" $( pwd) "
6
+ NODE_ARTIFACTS_PATH=" ${PROJECT_DIRECTORY} /node-artifacts"
7
+ export NVM_DIR=" ${NODE_ARTIFACTS_PATH} /nvm"
8
+ [ -s " $NVM_DIR /nvm.sh" ] && \. " $NVM_DIR /nvm.sh"
9
+
10
+ npm run check:ldap
Original file line number Diff line number Diff line change 66
66
"scripts" : {
67
67
"atlas" : " mocha --opts '{}' ./test/manual/atlas_connectivity.test.js" ,
68
68
"check:tls" : " mocha --opts '{}' test/manual/tls_support.test.js" ,
69
+ "check:ldap" : " mocha --opts '{}' test/manual/ldap.test.js" ,
69
70
"test" : " npm run lint && mocha --recursive test/functional test/unit test/core" ,
70
71
"test-nolint" : " mocha --recursive test/functional test/unit test/core" ,
71
72
"coverage" : " istanbul cover mongodb-test-runner -- -t 60000 test/core test/unit test/functional" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+ const MongoClient = require ( '../..' ) . MongoClient ;
3
+ var test = require ( '../functional/shared' ) . assert ;
4
+
5
+ describe ( 'LDAP' , function ( ) {
6
+ if ( process . env . MONGODB_URI == null ) {
7
+ throw new Error ( `skipping SSL tests, MONGODB_URI environment variable is not defined` ) ;
8
+ }
9
+
10
+ it ( 'Should correctly authenticate against ldap' , function ( done ) {
11
+ const client = new MongoClient ( process . env . MONGODB_URI ) ;
12
+ client . connect ( function ( err , client ) {
13
+ test . equal ( null , err ) ;
14
+
15
+ client
16
+ . db ( 'ldap' )
17
+ . collection ( 'test' )
18
+ . findOne ( function ( err , doc ) {
19
+ test . equal ( null , err ) ;
20
+ test . equal ( true , doc . ldap ) ;
21
+
22
+ client . close ( done ) ;
23
+ } ) ;
24
+ } ) ;
25
+ } ) ;
26
+ } ) ;
You can’t perform that action at this time.
0 commit comments