USE_SASL=${SLAPD_USE_SASL-no}
ACI=${AC_ACI_ENABLED-acino}
THREADS=${AC_THREADS-threadsno}
+SLEEP1=${SLEEP1-5}
+SLEEP2=${SLEEP2-10}
# dirs
PROGDIR=./progs
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapmodify to modify producer directory..."
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Try updating the consumer slapd..."
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD > \
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
-if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
+if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" && test "$BACKEND" != "ldif"; then
echo "Test does not support $BACKEND"
exit 0
fi
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping consumer to test recovery..."
kill -HUP $SLAVEPID
fi
KILLPIDS="$PID $SLAVEPID"
-echo "Waiting 25 seconds for syncrepl to receive changes..."
-sleep 25
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
if test ! $BACKLDAP = "ldapno" ; then
echo "Try updating the consumer slapd..."
exit $RC
fi
- echo "Waiting 15 seconds for syncrepl to receive changes..."
- sleep 15
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
fi
OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp"
exit $RC
fi
-echo "Waiting 25 seconds for syncrepl to receive changes..."
-sleep 25
+echo "Waiting $SLEEP2 seconds for syncrepl to receive changes..."
+sleep $SLEEP2
echo "Using ldapmodify to modify master directory..."
exit $RC
fi
-echo "Waiting 25 seconds for syncrepl to receive changes..."
-sleep 25
+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 \
;;
esac
-SLEEP=15
-echo "Waiting $SLEEP seconds for shadow subtrees to sync..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for shadow subtrees to sync..."
+sleep $SLEEP1
echo "Filtering original ldif used to create database..."
. $LDIFFILTER < $GLUESYNCOUT > $LDIFFLT
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping consumer to test recovery..."
kill -HUP $SLAVEPID
fi
KILLPIDS="$PID $SLAVEPID"
-echo "Waiting 25 seconds for syncrepl to receive changes..."
-sleep 25
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
if test ! $BACKLDAP = "ldapno" ; then
echo "Try updating the consumer slapd..."
exit $RC
fi
- echo "Waiting 15 seconds for syncrepl to receive changes..."
- sleep 15
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
fi
echo "Using ldapsearch to read all the entries from the producer..."
break
fi
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
#echo "Using ldapsearch to read all the entries from the master..."
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 &
# check slave contextCSN
for i in 1 2 3; do
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(objectClass=*)' -s base contextCSN > "${SLAVEOUT}.$CHECK" 2>&1
# check slave contextCSN
for i in 1 2 3 4 5; do
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(objectClass=*)' -s base contextCSN > "${SLAVEOUT}.$CHECK" 2>&1
break
fi
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
#echo "Using ldapsearch to read all the entries from the master..."
EOMODS
-SLEEP=10
-echo "Waiting $SLEEP seconds for syncrepl to retry..."
-sleep $SLEEP
+echo "Waiting $SLEEP2 seconds for syncrepl to retry..."
+sleep $SLEEP2
echo "Restarting consumer..."
echo "======================= RESTART =======================" >> $LOG2
# check slave contextCSN
for i in 1 2 3 4 5; do
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(objectClass=*)' -s base contextCSN > "${SLAVEOUT}.$CHECK" 2>&1
fi
KILLPIDS="$MASTERPID $SLAVEPID $PROXYPID"
- SLEEP=15
- 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 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
break
fi
- SLEEP=5
- echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
- sleep $SLEEP
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
#echo "Using ldapsearch to read all the entries from the master..."
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 \
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 &
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 \
fi
KILLPIDS="$MASTERPID $P1SLAVEPID $R1SLAVEPID"
-SLEEP=25
-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 \
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 \
fi
case "$SYNCMODE" in
ro)
- SYNCTYPE="type=refreshOnly interval=00:00:00:10"
+ SYNCTYPE="type=refreshOnly interval=00:00:00:03"
;;
rp)
SYNCTYPE="type=refreshAndPersist"
add: olcSyncRepl
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
-
add: olcUpdateRef
olcUpdateRef: $URI1
add: olcSyncRepl
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
-
add: olcUpdateRef
olcUpdateRef: $URI1
EOF
-SLEEP=10
-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 check that syncrepl received config changes..."
RC=32
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
olcRootPW: $PASSWD
olcSyncRepl: rid=002 provider=$URI1 binddn="$MANAGERDN" bindmethod=simple
credentials=$PASSWD searchbase="$BASEDN" $SYNCTYPE
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcUpdateRef: $URI1
dn: olcOverlay=syncprov,olcDatabase={1}${BACKEND},cn=config
exit $RC
fi
-SLEEP=20
-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 check that syncrepl received database changes..."
RC=32
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
fi
case "$SYNCMODE" in
ro)
- SYNCTYPE="type=refreshOnly interval=00:00:00:10"
+ SYNCTYPE="type=refreshOnly interval=00:00:00:03"
;;
rp)
SYNCTYPE="type=refreshAndPersist"
add: olcSyncRepl
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=002 provider=$URI2 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=003 provider=$URI3 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
-
add: olcMirrorMode
olcMirrorMode: TRUE
add: olcSyncRepl
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=002 provider=$URI2 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=003 provider=$URI3 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
-
add: olcMirrorMode
olcMirrorMode: TRUE
add: olcSyncRepl
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=002 provider=$URI2 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=003 provider=$URI3 binddn="cn=config" bindmethod=simple
credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
-
add: olcMirrorMode
olcMirrorMode: TRUE
olcRootPW: $PASSWD
olcSyncRepl: rid=004 provider=$URI1 binddn="$MANAGERDN" bindmethod=simple
credentials=$PASSWD searchbase="$BASEDN" $SYNCTYPE
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=005 provider=$URI2 binddn="$MANAGERDN" bindmethod=simple
credentials=$PASSWD searchbase="$BASEDN" $SYNCTYPE
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcSyncRepl: rid=006 provider=$URI3 binddn="$MANAGERDN" bindmethod=simple
credentials=$PASSWD searchbase="$BASEDN" $SYNCTYPE
- retry="5 5 300 5" timeout=3
+ retry="3 5 300 5" timeout=3
olcMirrorMode: TRUE
dn: olcOverlay=syncprov,olcDatabase={1}${BACKEND},cn=config
exit $RC
fi
-SLEEP=20
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapadd to populate consumer1..."
$LDAPADD -D "$MANAGERDN" -H $URI2 -w $PASSWD -f $LDIFADD1 \
exit $RC
fi
-SLEEP=20
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapadd to populate consumer2..."
$LDAPADD -D "$MANAGERDN" -H $URI3 -w $PASSWD \
exit $RC
fi
-SLEEP=20
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapmodify to add to the producer entries that will be deleted..."
$LDAPMODIFY -D "$MANAGERDN" -H $URI1 -w $PASSWD \
exit $RC
fi
-SLEEP=20
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapmodify to delete entries from consumer1..."
$LDAPMODIFY -D "$MANAGERDN" -H $URI2 -w $PASSWD \
exit $RC
fi
-SLEEP=20
-echo "Waiting $SLEEP seconds for syncrepl to receive changes..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Using ldapmodify to delete entries from consumer2..."
$LDAPMODIFY -D "$MANAGERDN" -H $URI3 -w $PASSWD \
exit $RC
fi
-SLEEP=20
-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 check that syncrepl received database changes..."
RC=32
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
fi
# Insert modifications and more tests here.
-SLEEP=10
-echo "Waiting $SLEEP seconds for servers to resync..."
-sleep $SLEEP
+echo "Waiting $SLEEP1 seconds for servers to resync..."
+sleep $SLEEP1
test $KILLSERVERS != no && kill -HUP $KILLPIDS
fi
case "$SYNCMODE" in
ro)
- SYNCTYPE="type=refreshOnly interval=00:00:00:10"
+ SYNCTYPE="type=refreshOnly interval=00:00:00:03"
;;
rp)
SYNCTYPE="type=refreshAndPersist"
add: olcSyncRepl
olcSyncRepl: rid=1 provider=$URI2 searchbase="ou=ou1,$BASEDN"
binddn="$MANAGERDN" bindmethod=simple credentials=$PASSWD
- $SYNCTYPE retry="5 5 300 5" timeout=1
+ $SYNCTYPE retry="3 5 300 5" timeout=1
EOF
RC=$?
add: olcSyncRepl
olcSyncRepl: rid=1 provider=$URI1 searchbase="$BASEDN"
binddn="$MANAGERDN" bindmethod=simple credentials=$PASSWD
- $SYNCTYPE retry="5 5 300 5" timeout=1
+ $SYNCTYPE retry="3 5 300 5" timeout=1
EOF
RC=$?
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
C2PID=$!
wait $C1PID $C2PID
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
exit $RC
fi
-echo "Waiting 15 seconds for syncrepl to receive changes..."
-sleep 15
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
echo "Stopping consumer to test recovery..."
kill -HUP $SLAVEPID
fi
KILLPIDS="$PID $SLAVEPID"
-echo "Waiting 25 seconds for syncrepl to receive changes..."
-sleep 25
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
if test ! $BACKLDAP = "ldapno" ; then
echo "Try updating the consumer slapd..."
exit $RC
fi
- echo "Waiting 15 seconds for syncrepl to receive changes..."
- sleep 15
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
fi
OPATTRS="entryUUID creatorsName createTimestamp modifiersName modifyTimestamp"