To perform a search and find all entries just do the following LDAP query:
ldapsearch -b "o=sql,c=RU" "(objectClass=*)" |
This must return some result else you have miss something during the previous chapter.
To test more the SQL backend you can run the following test suite. All test are done in LDIFF
format.
Something great is that you can create flat LDAP structure like in this test or more complex
structure as tree.
To create some new entries just copy the following LDIFF code into a file and run the
following command:
ldapadd -D "cn=root,o=sql,c=RU" -w secret -f file |
Note that it assume that your LDAP server is on localhost.
# begin
dn: cn=User Test_Add_Entry,o=sql,c=RU
objectClass: inetOrgPerson
sn: First Test_Add_Entry user
cn: User Test_Add_Entry
# end
|
To set attributes of the new entries just copy the following LDIFF code into a file and run
command:
ldapmodify -D "cn=root,o=sql,c=RU" -w secret -f file |
Note that it assume that your LDAP server is on localhost.
# begin
dn: cn=User Test_Add_Entry,o=sql,c=RU
changetype: modify
replace: sn
sn: Test_Add_Entry user
dn: cn=User Test_Add_Entry,o=sql,c=RU
changetype: modify
add: telephoneNumber
telephoneNumber: 123-4567
telephoneNumber: 765-4321
# end
|
To perform a search and find all entries just do the following LDAP query:
ldapsearch -b "o=sql,c=RU" "(objectClass=*)" |
or just under the inetOrgPerson objectClass with cn begining with letter M:
ldapsearch -b "o=sql,c=RU" "(&(objectClass=inetOrgPerson) (cn=M*))" |
To delete attributes of the new entries just copy the following LDIFF code into a file and run
command:
ldapmodify -D "cn=root,o=sql,c=RU" -w secret -f file |
This is an example with deleting an attribute with multiple values.
# begin
dn: cn=User Test_Add_Entry,o=sql,c=RU
changetype: modify
delete: telephoneNumber
telephoneNumber: 332-2334
# end
|
To delete entry just copy the following LDIFF code into a file and run command:
Note that it assume that your LDAP server is on localhost.
# begin
dn: cn=User Test_Add_Entry,o=sql,c=RU
changetype: delete
# end
|