2004-11-15 15:30:28 +03:00
#!/bin/sh
2004-10-20 23:28:02 +04:00
echo " LDB_URL: $LDB_URL "
2004-04-03 16:29:21 +04:00
echo "Adding base elements"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbadd $LDBDIR /tests/test.ldif || exit 1
2004-04-03 16:29:21 +04:00
echo "Modifying elements"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbmodify $LDBDIR /tests/test-modify.ldif || exit 1
2004-04-03 16:29:21 +04:00
echo "Showing modified record"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbsearch '(uid=uham)' || exit 1
2004-05-05 08:27:29 +04:00
2004-10-20 23:28:02 +04:00
echo "Rename entry"
2005-06-22 07:08:06 +04:00
OLDDN = "cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST"
NEWDN = "cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbrename " $OLDDN " " $NEWDN " || exit 1
2004-10-20 23:28:02 +04:00
echo "Showing renamed record"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbsearch '(uid=uham)' || exit 1
2004-10-20 23:28:02 +04:00
2004-10-21 00:48:31 +04:00
echo "Starting ldbtest"
2005-07-02 10:32:06 +04:00
time $VALGRIND ldbtest --num-records 100 --num-searches 10 || exit 1
2004-05-05 08:27:29 +04:00
2004-10-21 00:48:31 +04:00
echo "Adding index"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbadd $LDBDIR /tests/test-index.ldif || exit 1
2004-05-05 08:27:29 +04:00
2005-05-18 01:43:47 +04:00
echo "Adding attributes"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbadd $LDBDIR /tests/test-wrong_attributes.ldif || exit 1
2005-05-18 01:43:47 +04:00
2005-01-02 10:49:29 +03:00
echo "testing indexed search"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbsearch '(uid=uham)' || exit 1
$VALGRIND ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1
$VALGRIND ldbsearch '(&(uid=uham)(uid=uham))' || exit 1
$VALGRIND ldbsearch '(|(uid=uham)(uid=uham))' || exit 1
$VALGRIND ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1
$VALGRIND ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1
$VALGRIND ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1
$VALGRIND ldbsearch '(&(uid=uham)(uid=uha*)(title=*))' uid || exit 1
2005-06-22 08:01:27 +04:00
# note that the "((" is treated as an attribute not an expression
# this matches the openldap ldapsearch behaviour of looking for a '='
# to see if the first argument is an expression or not
2005-07-01 11:23:14 +04:00
$VALGRIND ldbsearch '((' uid || exit 1
$VALGRIND ldbsearch '(objectclass=)' uid || exit 1
$VALGRIND ldbsearch -b 'cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' -s base "" sn || exit 1
2005-01-02 10:49:29 +03:00
2005-07-12 16:04:54 +04:00
echo "Test wildcard match"
$VALGRIND ldbadd $LDBDIR /tests/test-wildcard.ldif || exit 1
$VALGRIND ldbsearch '(cn=test*multi)' || exit 1
$VALGRIND ldbsearch '(cn=*test*multi*)' || exit 1
$VALGRIND ldbsearch '(cn=*test_multi)' || exit 1
$VALGRIND ldbsearch '(cn=test_multi*)' || exit 1
$VALGRIND ldbsearch '(cn=test*multi*test*multi)' || exit 1
$VALGRIND ldbsearch '(cn=test*multi*test*multi*multi_*)' || exit 1
2004-10-21 00:48:31 +04:00
echo "Starting ldbtest indexed"
2005-07-02 10:32:06 +04:00
time $VALGRIND ldbtest --num-records 100 --num-searches 500 || exit 1
2004-09-23 06:15:10 +04:00
echo "Testing one level search"
2005-07-15 15:27:32 +04:00
count = ` $VALGRIND ldbsearch -b 'ou=Groups,o=University of Michigan,c=TEST' -s one 'objectclass=*' none | grep '^dn' | wc -l`
2005-07-01 12:18:48 +04:00
if [ $count != 3 ] ; then
2004-09-23 06:15:10 +04:00
echo returned $count records - expected 3
exit 1
fi
2005-06-21 15:22:05 +04:00
echo "Testing binary file attribute value"
2005-07-01 11:23:14 +04:00
$VALGRIND ldbmodify $LDBDIR /tests/photo.ldif || exit 1