From: Howard Chu Date: Sat, 17 Sep 2011 10:08:02 +0000 (-0700) Subject: deltasync test tweaks X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3fb20f1e916d67aba6d9400158305c5a57b32d19;p=openldap deltasync test tweaks Check replication success before stopping consumer. Set retry/interval to make sure consumer reconnects after provider restart. --- diff --git a/tests/data/slapd-deltasync-slave.conf b/tests/data/slapd-deltasync-slave.conf index 49e4baed03..549da75bf0 100644 --- a/tests/data/slapd-deltasync-slave.conf +++ b/tests/data/slapd-deltasync-slave.conf @@ -68,6 +68,7 @@ syncrepl rid=1 schemachecking=off scope=sub type=refreshAndPersist + retry="3 +" interval=00:00:00:03 updateref @URI1@ overlay syncprov diff --git a/tests/scripts/test043-delta-syncrepl b/tests/scripts/test043-delta-syncrepl index d6913680b3..415b00aa2b 100755 --- a/tests/scripts/test043-delta-syncrepl +++ b/tests/scripts/test043-delta-syncrepl @@ -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