exit $RC
fi
-echo "Comparing retrieved entries to LDIF file used to create database"
-cmp $SEARCHOUT $LDIF
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
exit $RC
fi
-echo "Comparing retrieved entries to LDIF file used to create database"
-cmp $SEARCHOUT $LDIF
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
echo "Using ldapsearch to read all the entries..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- 'objectclass=*' | egrep -iv '^creatorsname:|^createtimestamp:' > \
- $SEARCHOUT 2>&1
+ 'objectclass=*' > $SEARCHOUT 2>&1
kill -HUP $PID
exit $RC
fi
-cat /dev/null > $TESTOUT
+cat /dev/null > $SEARCHOUT
echo "Testing exact searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- 'sn=jensen' >> $TESTOUT 2>&1
+ 'sn=jensen' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
echo "Testing OR searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $TESTOUT 2>&1
+ '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $TESTOUT 2>&1
+ '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
echo "Testing NOT searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- '(!(objectclass=person))' | grep -v "^modifytimestamp:" \
- >> $TESTOUT 2>&1
+ '(!(objectclass=person))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
kill -HUP $PID
-echo "Comparing results"
-cmp $TESTOUT $SEARCHOUTMASTER
+TESTOUT=$SEARCHOUT
+LDIF=$SEARCHOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "Comparison failed"
exit 1
echo "Using ldapsearch to retrieve all the entries..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- 'objectClass=*' | egrep -iv '^createtimestamp:|^modifytimestamp:' \
- > $SEARCHOUT 2>&1
+ 'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID
if test $RC != 0 ; then
exit $RC
fi
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $MODIFYOUTMASTER
+LDIF=$MODIFYOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly"
exit 1
echo "Using ldapsearch to retrieve all the entries..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
- 'objectClass=*' | egrep -iv '^createtimestamp:|^modifytimestamp:' \
- > $SEARCHOUT 2>&1
+ 'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID
if test $RC != 0 ; then
exit $RC
fi
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $MODRDNOUTMASTER
+LDIF=$MODRDNOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly"
exit 1
exit $RC
fi
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $ACLOUTMASTER
+LDIF=$ACLOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly"
exit 1
kill -HUP $PID $SLAVEPID $SLURPPID
+SEARCHOUT=$MASTEROUT
+LDIF=$SLAVEOUT
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+
echo "Comparing retrieved entries from master and slave..."
-cmp $MASTEROUT $SLAVEOUT
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "test failed - master and slave databases differ"
exit 1
exit $RC
fi
-echo "Comparing retrieved entries to LDIF file used to create database"
-cmp $SEARCHOUT $LDIF
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1