Commit 73bf4506 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

strengthen the tests

parent fa498ee0
......@@ -39,6 +39,10 @@ access to attr=userpassword
access to *
by * read
# FIXME: this is required to work with referrals the old way;
# the new way requires to map referrals in ldap_oc_mappings on their own
schemacheck off
#######################################################################
# sql database definitions
#######################################################################
......
......@@ -39,7 +39,7 @@ seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost/dc=example,dc=com??one
# refldap://localhost:9010/dc=example,dc=com??one
# Testing subtree search...
dn: documentTitle=book1,dc=example,dc=com
......@@ -81,7 +81,55 @@ seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing subtree search with manageDSAit...
dn: documentTitle=book1,dc=example,dc=com
objectClass: document
description: abstract1
documentTitle: book1
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentAuthor: cn=Torvlobnor Puzdoy,dc=example,dc=com
documentIdentifier: document 1
dn: documentTitle=book2,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: book2
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=book1,dc=example,dc=com
seeAlso: documentTitle=book2,dc=example,dc=com
givenName: Mitya
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: cn=Torvlobnor Puzdoy,dc=example,dc=com
objectClass: inetOrgPerson
cn: Torvlobnor Puzdoy
sn: Puzdoy
seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
dn: cn=Akakiy Zinberstein,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: referral
cn: Akakiy Zinberstein
sn: Zinberstein
ref: ldap://localhost:9010/
givenName: Akakiy
# Testing invalid filter...
# Testing exact search...
......@@ -221,7 +269,7 @@ seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing NOT search on objectClass...
dn: documentTitle=book1,dc=example,dc=com
......@@ -279,7 +327,7 @@ seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing attribute inheritance in filter...
dn: dc=example,dc=com
......@@ -307,7 +355,7 @@ seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing "auxiliary" objectClass in filter...
dn: dc=example,dc=com
......@@ -323,7 +371,7 @@ objectClass: dcObject
o: Example
dc: example
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing entryUUID in filter...
dn: cn=Mitya Kovalev,dc=example,dc=com
......@@ -359,7 +407,7 @@ objectClass: inetOrgPerson
dn: cn=Torvlobnor Puzdoy,dc=example,dc=com
objectClass: inetOrgPerson
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Testing operational attributes in request...
dn: documentTitle=book1,dc=example,dc=com
......@@ -397,5 +445,5 @@ subschemaSubentry: cn=Subschema
hasSubordinates: FALSE
entryUUID: 00000001-0000-0002-0000-000000000000
# refldap://localhost/dc=example,dc=com??sub
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve all the entries...
dn: documentTitle=book1,dc=example,dc=com
objectClass: document
description: abstract1
documentTitle: book1
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentAuthor: cn=Torvlobnor Puzdoy,dc=example,dc=com
documentIdentifier: document 1
dn: documentTitle=book2,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: book2
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=book1,dc=example,dc=com
seeAlso: documentTitle=book2,dc=example,dc=com
givenName: Mitya
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: cn=Torvlobnor Puzdoy,dc=example,dc=com
objectClass: inetOrgPerson
cn: Torvlobnor Puzdoy
sn: Puzdoy
seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve all the entries...
dn: o=An Org,dc=example,dc=com
objectClass: organization
o: An Org
dn: documentTitle=book1,dc=example,dc=com
objectClass: document
description: abstract1
documentTitle: book1
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentAuthor: cn=Torvlobnor Puzdoy,dc=example,dc=com
documentIdentifier: document 1
dn: documentTitle=book2,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: book2
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Lev Tolstoij,dc=example,dc=com
objectClass: inetOrgPerson
cn: Lev Tolstoij
sn: Tolstoij
seeAlso: documentTitle=War and Peace,dc=example,dc=com
givenName: Lev
telephoneNumber: +39 02 XXXX YYYY
telephoneNumber: +39 02 XXXX ZZZZ
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=book1,dc=example,dc=com
seeAlso: documentTitle=book2,dc=example,dc=com
givenName: Mitya
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: cn=Some One,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: simpleSecurityObject
cn: Some One
sn: One
givenName: Some
telephoneNumber: +1 800 900 1234
telephoneNumber: +1 800 900 1235
dn: dc=subnet,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet
dc: subnet
dn: cn=SubNet User,dc=subnet,dc=example,dc=com
objectClass: inetOrgPerson
cn: SubNet User
sn: User
givenName: SubNet
dn: dc=subnet2,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet 2
dc: subnet 2
dn: cn=Torvlobnor Puzdoy,dc=example,dc=com
objectClass: inetOrgPerson
cn: Torvlobnor Puzdoy
sn: Puzdoy
seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
dn: documentTitle=War and Peace,dc=example,dc=com
objectClass: document
description: Historical novel
documentTitle: War and Peace
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentIdentifier: document 3
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve all the entries...
dn: o=An Org,dc=example,dc=com
objectClass: organization
o: An Org
dn: documentTitle=book1,dc=example,dc=com
objectClass: document
description: abstract1
documentTitle: book1
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentAuthor: cn=Torvlobnor Puzdoy,dc=example,dc=com
documentIdentifier: document 1
dn: documentTitle=book2,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: book2
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Lev Tolstoij,dc=example,dc=com
objectClass: inetOrgPerson
cn: Lev Tolstoij
sn: Tolstoij
seeAlso: documentTitle=book1,dc=example,dc=com
seeAlso: documentTitle=book2,dc=example,dc=com
seeAlso: documentTitle=War and Peace,dc=example,dc=com
givenName: Lev
telephoneNumber: +39 02 XXXX ZZZZ
telephoneNumber: +39 333 ZZZ 1234
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=book1,dc=example,dc=com
seeAlso: documentTitle=book2,dc=example,dc=com
givenName: Mitya
telephoneNumber: +1 800 123 4567
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: cn=Some One,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: simpleSecurityObject
cn: Some One
sn: One
givenName: Some
dn: dc=subnet,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet
dc: subnet
dn: cn=SubNet User,dc=subnet,dc=example,dc=com
objectClass: inetOrgPerson
cn: SubNet User
sn: User
givenName: SubNet
dn: dc=subnet2,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet 2
dc: subnet 2
dn: cn=Torvlobnor Puzdoy,dc=example,dc=com
objectClass: inetOrgPerson
cn: Torvlobnor Puzdoy
sn: Puzdoy
seeAlso: documentTitle=book1,dc=example,dc=com
givenName: Torvlobnor
telephoneNumber: 545-4563
dn: documentTitle=War and Peace,dc=example,dc=com
objectClass: document
description: Historical novel
documentTitle: War and Peace
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentIdentifier: document 3
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve all the entries...
dn: o=An Org,dc=example,dc=com
objectClass: organization
o: An Org
dn: documentTitle=book2,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: book2
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Lev Tolstoij,dc=example,dc=com
objectClass: inetOrgPerson
cn: Lev Tolstoij
sn: Tolstoij
seeAlso: documentTitle=book2,dc=example,dc=com
seeAlso: documentTitle=War and Peace,dc=example,dc=com
givenName: Lev
telephoneNumber: +39 02 XXXX ZZZZ
telephoneNumber: +39 333 ZZZ 1234
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=book2,dc=example,dc=com
givenName: Mitya
telephoneNumber: +1 800 123 4567
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: cn=Some One,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: simpleSecurityObject
cn: Some One
sn: One
givenName: Some
dn: dc=subnet,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet
dc: subnet
dn: cn=SubNet User,dc=subnet,dc=example,dc=com
objectClass: inetOrgPerson
cn: SubNet User
sn: User
givenName: SubNet
dn: documentTitle=War and Peace,dc=example,dc=com
objectClass: document
description: Historical novel
documentTitle: War and Peace
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentIdentifier: document 3
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve all the entries...
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: Example
dc: example
dn: cn=Lev Tolstoij,dc=subnet,dc=example,dc=com
objectClass: inetOrgPerson
cn: Lev Tolstoij
sn: Tolstoij
seeAlso: documentTitle=Renamed Book,dc=example,dc=com
seeAlso: documentTitle=War and Peace,dc=example,dc=com
givenName: Lev
telephoneNumber: +39 02 XXXX ZZZZ
telephoneNumber: +39 333 ZZZ 1234
dn: cn=Mitya Kovalev,dc=example,dc=com
objectClass: inetOrgPerson
cn: Mitya Kovalev
sn: Kovalev
seeAlso: documentTitle=Renamed Book,dc=example,dc=com
givenName: Mitya
telephoneNumber: +1 800 123 4567
telephoneNumber: 222-3234
telephoneNumber: 332-2334
dn: documentTitle=Renamed Book,dc=example,dc=com
objectClass: document
description: abstract2
documentTitle: Renamed Book
documentAuthor: cn=Lev Tolstoij,dc=subnet,dc=example,dc=com
documentAuthor: cn=Mitya Kovalev,dc=example,dc=com
documentIdentifier: document 2
dn: o=Renamed Org,dc=example,dc=com
objectClass: organization
o: Renamed Org
dn: cn=Some One,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: simpleSecurityObject
cn: Some One
sn: One
givenName: Some
dn: dc=subnet,dc=example,dc=com
objectClass: organization
objectClass: dcObject
o: SubNet
dc: subnet
dn: cn=SubNet User,dc=subnet,dc=example,dc=com
objectClass: inetOrgPerson
cn: SubNet User
sn: User
givenName: SubNet
dn: documentTitle=War and Peace,dc=example,dc=com
objectClass: document
description: Historical novel
documentTitle: War and Peace
documentAuthor: cn=Lev Tolstoij,dc=subnet,dc=example,dc=com
documentIdentifier: document 3
# refldap://localhost:9010/dc=example,dc=com??sub
# Using ldapsearch to retrieve the modified entry...
dn: cn=Akakiy Zinberstein,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: referral
cn: Akakiy Zinberstein
sn: Zinberstein
ref: ldap://localhost:9009/
givenName: Akakiy
# Using ldapsearch to retrieve the renamed entry...
dn: cn=Akakiy Zinber,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: referral
cn: Akakiy Zinber
sn: Zinber
ref: ldap://localhost:9009/
givenName: Akakiy
# Using ldapsearch to retrieve all the entries...
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
......
......@@ -110,6 +110,17 @@ if test $RC != 0 ; then
exit $RC
fi
echo "Testing subtree search with manageDSAit..."
echo "# Testing subtree search with manageDSAit..." >> $SEARCHOUT
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" -M '*' ref >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing invalid filter..."
echo "# Testing invalid filter..." >> $SEARCHOUT
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
......
......@@ -61,15 +61,29 @@ if test $RC != 0 ; then
exit $RC
fi
cat /dev/null > $SEARCHOUT
BASEDN="dc=example,dc=com"
echo "Using ldapsearch to retrieve all the entries..."
echo "# Using ldapsearch to retrieve all the entries..." >> $SEARCHOUT
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
"objectClass=*" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
case ${RDBMS} in
# list here the RDBMSes whose mapping allows writes
postgres|ibmdb2)
MANAGERDN="cn=Manager,${BASEDN}"
echo "Testing add..."
$LDAPMODIFY -v -c -D "$MANAGERDN" -w $PASSWD \
-h $LOCALHOST -p $PORT1 > \
$TESTOUT 2>&1 << EOMODS
-h $LOCALHOST -p $PORT1 >> $TESTOUT 2>&1 << EOMODS
version: 1
# Adding an organization...
......@@ -86,6 +100,14 @@ objectClass: dcObject
o: SubNet
dc: subnet
# Adding another organization with an "auxiliary" objectClass..
dn: dc=subnet2,${BASEDN}
changetype: add
objectClass: organization
objectClass: dcObject
o: SubNet 2
dc: subnet2
# Adding a person...
dn: cn=Lev Tolstoij,${BASEDN}
changetype: add
......@@ -125,7 +147,6 @@ description: Historical novel
documentTitle: War and Peace
documentAuthor: cn=Lev Tolstoij,dc=example,dc=com
documentIdentifier: document 3
EOMODS
RC=$?
......@@ -135,10 +156,21 @@ EOMODS
exit $RC
fi
echo "Using ldapsearch to retrieve all the entries..."
echo "# Using ldapsearch to retrieve all the entries..." >> $SEARCHOUT
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
"objectClass=*" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing modify..."
$LDAPMODIFY -v -c -D "$MANAGERDN" -w $PASSWD \
-h $LOCALHOST -p $PORT1 > \
$TESTOUT 2>&1 << EOMODS
-h $LOCALHOST -p $PORT1 >> $TESTOUT 2>&1 << EOMODS
version: 1
# Deleting all telephone numbers...
......@@ -197,7 +229,6 @@ dn: cn=Lev Tolstoij,${BASEDN}
changetype: modify
delete: userPassword
-
EOMODS
RC=$?
......@@ -207,10 +238,21 @@ EOMODS
exit $RC
fi
echo "Using ldapsearch to retrieve all the entries..."
echo "# Using ldapsearch to retrieve all the entries..." >> $SEARCHOUT
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
"objectClass=*" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing delete..."
$LDAPMODIFY -v -c -D "$MANAGERDN" -w $PASSWD \
-h $LOCALHOST -p $PORT1 -M > \
$TESTOUT 2>&1 << EOMODS
-h $LOCALHOST -p $PORT1 >> $TESTOUT 2>&1 << EOMODS
version: 1
# Deleting a person...
......@@ -218,13 +260,12 @@ dn: cn=Torvlobnor Puzdoy,${BASEDN}
changetype: delete
# Deleting a document...
dn: documentTitle=book1,dc=example,dc=com
dn: documentTitle=book1,${BASEDN}
changetype: delete
# Deleting a person with an "auxiliary" objectClass...
dn: cn=Akakiy Zinberstein,dc=example,dc=com
# Deleting an organization with an "auxiliary" objectClass...
dn: dc=subnet2,${BASEDN}
changetype: delete
EOMODS
RC=$?
......@@ -234,31 +275,203 @@ EOMODS
exit $RC
fi
echo "Using ldapsearch to retrieve all the entries..."
echo "# Using ldapsearch to retrieve all the entries..." >> $SEARCHOUT