]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test017-syncreplication-refresh
Changes from HEAD for beta
[openldap] / tests / scripts / test017-syncreplication-refresh
index 58ee34235cd1e60799075af287c5a463b3bb2cb5..be59b12298236b957414e0b154bf81c9180b944d 100755 (executable)
@@ -6,12 +6,7 @@ if test $# -ge 1 ; then
        SRCDIR=$1; shift
 fi
 
-. $SRCDIR/scripts/args.sh
-
-if test "$BACKEND" != "bdb" -a "$BACKEND" != "hdb"; then
-       echo "Test only valid for back-bdb"
-       exit 0
-fi
+. $SRCDIR/scripts/args.sh $*
 
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
@@ -27,9 +22,14 @@ echo "running defines.sh"
 
 echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*
-echo "Cleaning up in $REPLDIR..."
-rm -rf $REPLDIR/[!C]*
+echo "Resetting $R1REPLDIR..."
+rm -rf $R1REPLDIR
+mkdir $R1REPLDIR
 
+SAVE=$BACKEND
+if test $BACKEND = ldbm; then
+       BACKEND=bdb
+fi
 echo "Starting master slapd on TCP/IP port $PORT..."
 . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF
 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
@@ -38,6 +38,7 @@ if test $WAIT != 0 ; then
     echo PID $PID
     read foo
 fi
+BACKEND=$SAVE
 
 echo "Waiting 5 seconds to wait for master to start..."
 sleep 5
@@ -64,18 +65,18 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $SRREFSLAVECONF > $REPLCONF
-$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
-SLAVEPID=$!
+echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."
+. $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF
+$SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &
+R1SLAVEPID=$!
 if test $WAIT != 0 ; then
-    echo SLAVEPID $SLAVEPID
+    echo SLAVEPID $R1SLAVEPID
     read foo
 fi
 
 echo "Using ldapsearch to check that slave slapd is running..."
 for i in 0 1 2 3 4 5; do
-       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $R1SLAVEPORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
        if test $RC = 0 ; then
@@ -95,8 +96,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapmodify to modify master directory..."
 
@@ -177,8 +178,8 @@ changetype: delete
 
 EOMODS
 
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
@@ -192,28 +193,28 @@ if test $RC != 0 ; then
 fi
 
 echo "Using ldapsearch to read all the entries from the slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
-       'objectclass=*' > $SLAVEOUT 2>&1
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $R1SLAVEPORT \
+       'objectclass=*' > $R1SLAVEOUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
        echo "ldapsearch failed at slave ($RC)!"
-       kill -HUP $PID $SLAVEPID
+       kill -HUP $PID $R1SLAVEPID
        exit $RC
 fi
 
-kill -HUP $PID $SLAVEPID
+kill -HUP $PID $R1SLAVEPID
 
 SEARCHOUT=$MASTEROUT
-LDIF=$SLAVEOUT
+LDIF=$R1SLAVEOUT
 
 echo "Filtering ldapsearch results..."
 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
 echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $LDIFFLT
+. $LDIFFILTER < $LDIF > $R1LDIFFLT
 
 echo "Comparing retrieved entries from master and slave..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+$CMP $SEARCHFLT $R1LDIFFLT > $CMPOUT
 
 if test $? != 0 ; then
        echo "test failed - master and slave databases differ"