Commit 7d2f6580 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Filter timestamps, etc., from all test inputs before compare.

parent 3d9c49f9
......@@ -49,8 +49,13 @@ if test $RC != 0 ; then
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
......
......@@ -49,8 +49,13 @@ if test $RC != 0 ; then
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
......
......@@ -43,8 +43,7 @@ fi
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
......
......@@ -45,11 +45,11 @@ if test $RC != 0 ; then
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
......@@ -58,7 +58,7 @@ fi
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
......@@ -67,7 +67,7 @@ fi
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
......@@ -76,8 +76,7 @@ fi
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
......@@ -86,8 +85,16 @@ fi
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
......
......@@ -114,8 +114,7 @@ fi
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
......@@ -123,8 +122,15 @@ 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
......
......@@ -75,8 +75,7 @@ fi
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
......@@ -84,8 +83,15 @@ 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
......
......@@ -114,8 +114,15 @@ if test $RC != 0 ; then
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
......
......@@ -164,8 +164,17 @@ fi
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
......
......@@ -58,8 +58,13 @@ if test $RC != 0 ; then
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment