From 3fb20f1e916d67aba6d9400158305c5a57b32d19 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 17 Sep 2011 03:08:02 -0700 Subject: [PATCH] deltasync test tweaks Check replication success before stopping consumer. Set retry/interval to make sure consumer reconnects after provider restart. --- tests/data/slapd-deltasync-slave.conf | 1 + tests/scripts/test043-delta-syncrepl | 36 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) 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 -- 2.39.5