From: Kurt Zeilenga Date: Fri, 21 May 1999 16:50:51 +0000 (+0000) Subject: Filter timestamps, etc., from all test inputs before compare. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7d2f6580c07b45b4337848a650fc3f137fefa78c;p=openldap Filter timestamps, etc., from all test inputs before compare. --- diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm index ab92db1455..a93b1d8f55 100755 --- a/tests/scripts/test001-ldif2ldbm +++ b/tests/scripts/test001-ldif2ldbm @@ -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 diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index ab92db1455..a93b1d8f55 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -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 diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index 6de48d2df3..641a3d5c65 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -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 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 952133bd08..03179910f6 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -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 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index cb1fdbdfa8..fa3bc01985 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -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 diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 5e3ad6d296..70392336cf 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -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 diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index eddf1f5e2c..58d1215407 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -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 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index da7ab0946d..b3d71c295c 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -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 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index 9ca8486ce8..658c0d9103 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -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