adding rebind checks

This commit is contained in:
Thomas Pressnell 2021-07-12 16:24:01 +01:00
parent b85c4acb4c
commit fae35237de
1 changed files with 15 additions and 5 deletions

View File

@ -276,11 +276,21 @@ tap.test('bind/unbind identity user', function (t) {
t.ok(anonDN.equals(c.ldap.bindDN), 'pre bind dn is correct') t.ok(anonDN.equals(c.ldap.bindDN), 'pre bind dn is correct')
client.bind(testDN.toString(), 'somesecret', function (err) { client.bind(testDN.toString(), 'somesecret', function (err) {
t.error(err, 'user bind error') t.error(err, 'user bind error')
t.ok(testDN.equals(c.ldap.bindDN), 'user unbind dn is correct') t.ok(testDN.equals(c.ldap.bindDN), 'user bind dn is correct')
client.unbind(function (err) { // check rebinds too
t.error(err, 'user unbind error') client.bind('', '', function (err) {
t.ok(anonDN.equals(c.ldap.bindDN), 'user unbind dn is correct') t.error(err, 'client anon bind error')
server.close(() => t.end()) t.ok(anonDN.equals(c.ldap.bindDN), 'anon bind dn is correct')
// user rebind
client.bind(testDN.toString(), 'somesecret', function (err) {
t.error(err, 'user bind error')
t.ok(testDN.equals(c.ldap.bindDN), 'user rebind dn is correct')
client.unbind(function (err) {
t.error(err, 'user unbind error')
t.ok(anonDN.equals(c.ldap.bindDN), 'user unbind dn is correct')
server.close(() => t.end())
})
})
}) })
}) })
}) })