]> git.sur5r.net Git - openldap/commitdiff
deltasync test tweaks
authorHoward Chu <hyc@openldap.org>
Sat, 17 Sep 2011 10:08:02 +0000 (03:08 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 2 Nov 2011 22:37:13 +0000 (15:37 -0700)
Check replication success before stopping consumer.
Set retry/interval to make sure consumer reconnects after provider restart.

tests/data/slapd-deltasync-slave.conf
tests/scripts/test043-delta-syncrepl

index 49e4baed035dbf5ac10efc2d5999784d2c0adb1b..549da75bf01277803311598d0ff55690e9b5f0b2 100644 (file)
@@ -68,6 +68,7 @@ syncrepl      rid=1
                schemachecking=off
                scope=sub
                type=refreshAndPersist
+               retry="3 +" interval=00:00:00:03
 updateref      @URI1@
 
 overlay                syncprov
index d6913680b358e8e402d81602fbb10686e782818a..415b00aa2baae7f4fa31353f8929331cf8f07dfa 100755 (executable)
@@ -245,6 +245,42 @@ fi
 echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
 sleep $SLEEP1
 
+echo "Using ldapsearch to read all the entries from the provider..."
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+       'objectclass=*' \* + > $MASTEROUT 2>&1
+RC=$?
+
+if test $RC != 0 ; then
+       echo "ldapsearch failed at provider ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Using ldapsearch to read all the entries from the consumer..."
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
+       'objectclass=*' \* + > $SLAVEOUT 2>&1
+RC=$?
+
+if test $RC != 0 ; then
+       echo "ldapsearch failed at consumer ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Filtering provider results..."
+$LDIFFILTER -s bdb=a,hdb=a < $MASTEROUT | grep -iv "^auditcontext:" > $MASTERFLT
+echo "Filtering consumer results..."
+$LDIFFILTER -s bdb=a,hdb=a < $SLAVEOUT | grep -iv "^auditcontext:" > $SLAVEFLT
+
+echo "Comparing retrieved entries from provider and consumer..."
+$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
+
+if test $? != 0 ; then
+       echo "test failed - provider and consumer databases differ"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 1
+fi
+
 echo "Stopping consumer to test recovery..."
 kill -HUP $SLAVEPID
 sleep 10