Commit 77da4a5c authored by Rahul A. Sutar's avatar Rahul A. Sutar
Browse files

ldapmdl moved to authmdl

1) Moved ldapmdl to auth mdl
2) Removed config.json
3) Config file changes to test case file
parent 0e7714a3
Branches
Tags
2 merge requests!41Devbranch to Master,!38ldapmdl moved to authmdl
Showing with 7 additions and 14 deletions
File moved
......@@ -12,40 +12,40 @@ func TestLDAPAuthentication(t *testing.T) {
//LDAP init config error
errormdl.IsTestingNegetiveCaseOn = true
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
errormdl.IsTestingNegetiveCaseOn = false
//LDAP BaseDSN not set
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
ldapConfig.BaseDN = ""
authStatusCode, _ := AuthenticateOnLDAP("rahuls", "fghjkl")
assert.Equal(t, 0, authStatusCode)
//LDAP FilterDN not set
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
ldapConfig.FilterDN = ""
authStatusCode, _ = AuthenticateOnLDAP("rahuls", "fghjkl")
assert.Equal(t, 0, authStatusCode)
//LDAP LDAPPassword not set
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
ldapConfig.LDAPPassword = ""
authStatusCode, _ = AuthenticateOnLDAP("rahuls", "fghjkl")
assert.Equal(t, 0, authStatusCode)
//LDAP LDAPServerIPWithPort not set
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
ldapConfig.LDAPServerIPWithPort = ""
authStatusCode, _ = AuthenticateOnLDAP("rahuls", "fghjkl")
assert.Equal(t, 0, authStatusCode)
//LDAP LDAPUsername not set
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
ldapConfig.LDAPUsername = ""
authStatusCode, _ = AuthenticateOnLDAP("rahuls", "fghjkl")
assert.Equal(t, 0, authStatusCode)
InitLDAP("../testingdata/testData/ldapmdl/config.toml")
InitLDAP("../../testingdata/testData/ldapmdl/config.toml")
//LDAP connection error
errormdl.IsTestingNegetiveCaseOn = true
......
{
"baseDN": "DC=mkclindia,DC=local",
"ldapServer": "10.1.70.101:389",
"filterDN": "(&(objectClass=*)(sAMAccountName={username}))",
"ldapUsername": "mkclindia\\ldap2",
"ldapPassword": "Mkcl.org123"
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment