]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test048-syncrepl-multiproxy
For ITS#5810: Use progs/ldif-filter. Retire scripts/acfilter.sh.
[openldap] / tests / scripts / test048-syncrepl-multiproxy
index 5e8afe987900afe217f4c97faf37de97bb2205df..4320eac9cab1e82b5e4af83f1a4fcedf3031b653 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2008 The OpenLDAP Foundation.
+## Copyright 1998-2009 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -31,6 +31,11 @@ if test $MONITORDB = no; then
        exit 0
 fi 
 
+if test $THREADS = threadsno ; then
+       echo "Need threads support, test skipped"
+       exit 0
+fi
+
 mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
 
 #
@@ -114,7 +119,7 @@ if test $RC != 0 ; then
 fi
 
 echo "Starting R1 slave slapd on TCP/IP port $PORT3..."
-. $CONFFILTER $BACKEND $MONITORDB < $RSLAVECONF | sed -e 's;\.2\.;.3.;' > $CONF3
+. $CONFFILTER $BACKEND $MONITORDB < $RSLAVECONF | sed -e 's;\.2\.\([^/]*\)$;.3.\1;' > $CONF3
 $SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
 R1SLAVEPID=$!
 if test $WAIT != 0 ; then
@@ -154,9 +159,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-SLEEP=15
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
 
 #echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
@@ -181,9 +185,9 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering master results..."
-$LDIFFILTER < "${MASTEROUT}.1" > $MASTERFLT
+$LDIFFILTER < "${MASTEROUT}.1" > $MASTERFLT
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.1" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.1" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and P1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -206,7 +210,7 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.1" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.1" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and R1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -218,11 +222,10 @@ if test $? != 0 ; then
 fi
 
 CHECK=`expr $CHECK + 1`
-SLEEP=10
-echo "$CHECK > Stopping the provider, sleeping $SLEEP seconds and restarting it..."
+echo "$CHECK > Stopping the provider, sleeping $SLEEP2 seconds and restarting it..."
 kill -HUP "$MASTERPID"
 wait $MASTERPID
-sleep $SLEEP
+sleep $SLEEP2
 
 echo "======================= RESTART =======================" >> $LOG1
 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 &
@@ -340,9 +343,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-SLEEP=15
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
 
 #echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
@@ -367,9 +369,9 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering master results..."
-$LDIFFILTER < "${MASTEROUT}.2" > $MASTERFLT
+$LDIFFILTER < "${MASTEROUT}.2" > $MASTERFLT
 #echo "Filtering P1 slave results..."
-$LDIFFILTER < "${SLAVEOUT}.2" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.2" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and P1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -392,7 +394,7 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.2" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.2" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and R1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -452,9 +454,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$MASTERPID $P1SLAVEPID $R1SLAVEPID"
 
-SLEEP=25
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP2 seconds for syncrepl to receive changes..."
+sleep $SLEEP2
 
 #echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
@@ -479,9 +480,9 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering master results..."
-$LDIFFILTER < "${MASTEROUT}.3" > $MASTERFLT
+$LDIFFILTER < "${MASTEROUT}.3" > $MASTERFLT
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.3" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.3" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and P1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -504,7 +505,7 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.3" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.3" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and R1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -534,9 +535,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-SLEEP=15
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
 
 #echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
@@ -561,9 +561,9 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering master results..."
-$LDIFFILTER < "${MASTEROUT}.4" > $MASTERFLT
+$LDIFFILTER < "${MASTEROUT}.4" > $MASTERFLT
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.4" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.4" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and P1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT
@@ -586,7 +586,7 @@ if test $RC != 0 ; then
 fi
 
 #echo "Filtering slave results..."
-$LDIFFILTER < "${SLAVEOUT}.4" > $SLAVEFLT
+$LDIFFILTER < "${SLAVEOUT}.4" > $SLAVEFLT
 
 echo "$CHECK < Comparing retrieved entries from master and R1 slave..."
 $CMP $MASTERFLT $SLAVEFLT > $CMPOUT