1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-23 11:17:06 +03:00
samba-mirror/source4/lib/ldb/tests/test-generic.sh
Andrew Tridgell 09a76e204c r4477: expanded the test suite to increase code coverage a lot
(This used to be commit 4edbd1b18ee38e584cf844b64c7fcb2645921837)
2007-10-10 13:07:56 -05:00

49 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
echo "LDB_URL: $LDB_URL"
echo "Adding base elements"
$VALGRIND bin/ldbadd tests/test.ldif || exit 1
echo "Modifying elements"
$VALGRIND bin/ldbmodify tests/test-modify.ldif || exit 1
echo "Showing modified record"
$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
echo "Rename entry"
OLDDN="cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michigan,c=US"
NEWDN="cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=US"
$VALGRIND bin/ldbrename "$OLDDN" "$NEWDN" || exit 1
echo "Showing renamed record"
$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
echo "Starting ldbtest"
time $VALGRIND bin/ldbtest -r 1000 -s 10 || exit 1
echo "Adding index"
$VALGRIND bin/ldbadd tests/test-index.ldif || exit 1
echo "testing indexed search"
$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
$VALGRIND bin/ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1
$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uham))' || exit 1
$VALGRIND bin/ldbsearch '(|(uid=uham)(uid=uham))' || exit 1
$VALGRIND bin/ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1
$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1
$VALGRIND bin/ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1
$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uha*)(title=*))' uid || exit 1
$VALGRIND bin/ldbsearch '((' uid && exit 1
$VALGRIND bin/ldbsearch 'dn=cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=US' uid || exit 1
echo "Starting ldbtest indexed"
time $VALGRIND bin/ldbtest -r 1000 -s 5000 || exit 1
echo "Testing one level search"
count=`$VALGRIND bin/ldbsearch -b 'ou=Groups,o=University of Michigan,c=US' -s one 'objectclass=*' none |grep ^dn | wc -l`
if [ "$count" != 3 ]; then
echo returned $count records - expected 3
exit 1
fi