]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test019-syncreplication-cascade
s/ldap_sync.h/ldap.h/
[openldap] / tests / scripts / test019-syncreplication-cascade
index 2b26862b8607d8784c317fd26b7f906d0c2077d5..53687bb76dc3646fc27ec93c02583b4164875aa0 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
 ## top-level directory of the distribution or, alternatively, at
 ## <http://www.OpenLDAP.org/license.html>.
 
-if test "$BACKEND" != "bdb" -a "$BACKEND" != "hdb" ; then
+if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
        echo "Test does not support $BACKEND"
        exit 0
 fi
@@ -21,7 +21,12 @@ fi
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
 
-mkdir $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
+if test $SYNCPROV = syncprovno; then 
+       echo "Syncrepl provider overlay not available, test skipped"
+       exit 0
+fi 
+
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
 
 #
 # Test replication:
@@ -42,6 +47,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$PID"
 
+sleep 1
+
 echo "Using ldapsearch to check that master slapd (pid=$PID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
@@ -80,7 +87,9 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
-echo "Using ldapsearch to check that R1 slave slapd(pid=$SLAVEPID) is running..."
+sleep 1
+
+echo "Using ldapsearch to check that R1 slave slapd (pid=$SLAVEPID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
                'objectclass=*' > /dev/null 2>&1
@@ -108,7 +117,9 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
-echo "Using ldapsearch to check that R2 slave slapd(pid=$SLAVEPID) is running..."
+sleep 1
+
+echo "Using ldapsearch to check that R2 slave slapd (pid=$SLAVEPID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
                'objectclass=*' > /dev/null 2>&1
@@ -136,7 +147,9 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
-echo "Using ldapsearch to check that P1 slave slapd(pid=$SLAVEPID) is running..."
+sleep 1
+
+echo "Using ldapsearch to check that P1 slave slapd (pid=$SLAVEPID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
                'objectclass=*' > /dev/null 2>&1
@@ -164,7 +177,9 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
-echo "Using ldapsearch to check that P2 slave slapd(pid=$SLAVEPID) is running..."
+sleep 1
+
+echo "Using ldapsearch to check that P2 slave slapd (pid=$SLAVEPID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT5 \
                'objectclass=*' > /dev/null 2>&1
@@ -192,7 +207,9 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
-echo "Using ldapsearch to check that P3 slave slapd(pid=$SLAVEPID) is running..."
+sleep 1
+
+echo "Using ldapsearch to check that P3 slave slapd (pid=$SLAVEPID) is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT6 \
                'objectclass=*' > /dev/null 2>&1
@@ -314,7 +331,7 @@ sleep 25
 
 echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
-       'objectclass=*' > $MASTEROUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $MASTEROUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -325,7 +342,7 @@ fi
 
 echo "Using ldapsearch to read all the entries from the R1 slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
-       'objectclass=*' > $SERVER2OUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $SERVER2OUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -336,7 +353,7 @@ fi
 
 echo "Using ldapsearch to read all the entries from the R2 slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT3 \
-       'objectclass=*' > $SERVER3OUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $SERVER3OUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -347,7 +364,7 @@ fi
 
 echo "Using ldapsearch to read all the entries from the P1 slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
-       'objectclass=*' > $SERVER4OUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $SERVER4OUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -358,7 +375,7 @@ fi
 
 echo "Using ldapsearch to read all the entries from the P2 slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT5 \
-       'objectclass=*' > $SERVER5OUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $SERVER5OUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -369,7 +386,7 @@ fi
 
 echo "Using ldapsearch to read all the entries from the P3 slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT6 \
-       'objectclass=*' > $SERVER6OUT 2>&1
+       '(objectClass=*)' '*' entryCSN > $SERVER6OUT 2>&1
 RC=$?
 
 if test $RC != 0 ; then
@@ -434,4 +451,7 @@ if test $? != 0 ; then
 fi
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0