Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit fae3523

Browse files
committed
adding rebind checks
1 parent b85c4ac commit fae3523

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

test/server.test.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,21 @@ tap.test('bind/unbind identity user', function (t) {
276276
t.ok(anonDN.equals(c.ldap.bindDN), 'pre bind dn is correct')
277277
client.bind(testDN.toString(), 'somesecret', function (err) {
278278
t.error(err, 'user bind error')
279-
t.ok(testDN.equals(c.ldap.bindDN), 'user unbind dn is correct')
280-
client.unbind(function (err) {
281-
t.error(err, 'user unbind error')
282-
t.ok(anonDN.equals(c.ldap.bindDN), 'user unbind dn is correct')
283-
server.close(() => t.end())
279+
t.ok(testDN.equals(c.ldap.bindDN), 'user bind dn is correct')
280+
// check rebinds too
281+
client.bind('', '', function (err) {
282+
t.error(err, 'client anon bind error')
283+
t.ok(anonDN.equals(c.ldap.bindDN), 'anon bind dn is correct')
284+
// user rebind
285+
client.bind(testDN.toString(), 'somesecret', function (err) {
286+
t.error(err, 'user bind error')
287+
t.ok(testDN.equals(c.ldap.bindDN), 'user rebind dn is correct')
288+
client.unbind(function (err) {
289+
t.error(err, 'user unbind error')
290+
t.ok(anonDN.equals(c.ldap.bindDN), 'user unbind dn is correct')
291+
server.close(() => t.end())
292+
})
293+
})
284294
})
285295
})
286296
})

0 commit comments

Comments
 (0)