From: Kurt Zeilenga Date: Sun, 30 Aug 1998 18:16:00 +0000 (+0000) Subject: Fix cleanup code to use standard expressions for ignoring CVS directories. X-Git-Tag: OPENLDAP_REL_ENG_1_0_1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac517f4a5465c939ac2609778d103cb9073912bf;p=thirdparty%2Fopenldap.git Fix cleanup code to use standard expressions for ignoring CVS directories. Merge from main patch provided by dj@gregor.com. --- diff --git a/tests/Make-template b/tests/Make-template index f8cae98bf0..7e6be68593 100644 --- a/tests/Make-template +++ b/tests/Make-template @@ -17,6 +17,8 @@ SCRIPTSDIR=./scripts all: FORCE @echo "Initiating LDAP tests..."; \ + test -d test-db || $(MKDIR) test-db ; \ + test -d test-repl || $(MKDIR) test-repl ; \ $(SCRIPTSDIR)/all $(SCRIPTSDIR) install: FORCE @@ -24,7 +26,7 @@ install: FORCE depend: FORCE clean: FORCE - $(RM) test-db/* test-repl/* + $(RM) test-db/[!C]* test-repl/[!C]* veryclean: clean diff --git a/tests/scripts/makeldbm.sh b/tests/scripts/makeldbm.sh index bb2aac035c..0431f37fe1 100755 --- a/tests/scripts/makeldbm.sh +++ b/tests/scripts/makeldbm.sh @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm index d22e04c8e0..26d10fff94 100755 --- a/tests/scripts/test001-ldif2ldbm +++ b/tests/scripts/test001-ldif2ldbm @@ -5,7 +5,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -16,7 +16,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to retrieve all the entries..." diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index c04d1f5f65..4f31092f48 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -5,10 +5,10 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to check that slapd is running..." @@ -44,8 +44,13 @@ if [ $RC != 0 ]; then exit $RC fi -echo "Comparing retrieved entries to LDIF file used to create database" -cmp $SEARCHOUT $LDIF +echo "Filtering ldapsearch results..." +. scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +echo "Filtering original ldif used to create database..." +. scripts/acfilter.sh < $LDIF > $LDIFFLT +echo "Comparing filter output..." +cmp $SEARCHFLT $LDIFFLT + if [ $? != 0 ]; then echo "comparison failed - database was not created correctly" exit 1 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 0912550608..868ea4b840 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd searching..." diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index 09a4fdfee1..8f31d33c73 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd modify operations..." diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index ec1c964d10..3805692b0d 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $ACLCONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $ACLCONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd access control..." @@ -96,8 +96,7 @@ EOMODS4 echo "Using ldapsearch to retrieve all the entries..." $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ - 'objectClass=*' | egrep -iv '^modifytimestamp|^modifiersname' \ - >> $SEARCHOUT 2>&1 + 'objectClass=*' | . scripts/acfilter.sh >> $SEARCHOUT 2>&1 RC=$? kill -HUP $PID if [ $RC != 0 ]; then diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index c0f49136c5..0be88238b4 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -13,16 +13,16 @@ . scripts/defines.sh echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[!C]* echo "Cleaning up in $REPLDIR..." -rm -f $REPLDIR/* +rm -f $REPLDIR/[!C]* echo "Starting master slapd on TCP/IP port $PORT..." -$SLAPD -f $MASTERCONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $MASTERCONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." -$SLAPD -f $SLAVECONF -p $SLAVEPORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $SLAVECONF -p $SLAVEPORT -d 1 > $SLAVELOG 2>&1 & SLAVEPID=$! echo "Using ldapsearch to check that master slapd is running..." @@ -48,7 +48,7 @@ for i in 0 1 2 3 4 5; do done echo "Starting slurpd..." -$SLURPD -f $MASTERCONF -d 4 -t $REPLDIR > /dev/null 2>&1 & +$SLURPD -f $MASTERCONF -d 4 -t $REPLDIR > $SLURPLOG 2>&1 & SLURPPID=$! echo "Using ldapmodify to populate the database..." @@ -123,8 +123,8 @@ changetype: delete EOMODS -echo "Waiting 10 seconds for slurpd to send changes..." -sleep 10 +echo "Waiting 15 seconds for slurpd to send changes..." +sleep 15 echo "Using ldapsearch to read all the entries from the master..." $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \