]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test007-replication
cleanup ($PORT -> $SLAVEPORT)
[openldap] / tests / scripts / test007-replication
index babc6ffcc843284d281688a64281e9877b3c7976..8deaa2743738c290223222f936ffcaf46c9cb501 100755 (executable)
@@ -5,18 +5,8 @@ SRCDIR="."
 if test $# -ge 1 ; then
        SRCDIR=$1; shift
 fi
-BACKEND=bdb
-if test $# -ge 1 ; then
-       BACKEND=$1; shift
-fi
-MONITORDB=no
-if test $# -ge 1 ; then
-       MONITORDB=$1; shift
-fi
-WAIT=0
-if test $# -ge 1 ; then
-       WAIT=1; shift
-fi
+
+. $SRCDIR/scripts/args.sh
 
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
@@ -40,7 +30,7 @@ fi
 echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*
 echo "Cleaning up in $REPLDIR..."
-rm -f $REPLDIR/[!C]*
+rm -rf $REPLDIR/[!C]*
 
 echo "Starting master slapd on TCP/IP port $PORT..."
 . $CONFFILTER $BACKEND $MONITORDB < $MASTERCONF > $DBCONF
@@ -65,16 +55,16 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
-done
        if test $RC = 0 ; then
                break
        fi
        echo "Waiting 5 seconds for slapd to start..."
        sleep 5
+done
 
 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 $PORT \
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
        if test $RC = 0 ; then
@@ -94,8 +84,8 @@ $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
 RC=$?
 if test $RC != 0 ; then
        echo "ldapadd failed ($RC)!"
-       kill -INT $PID $SLAVEPID
-       kill -KILL $SLURPPID
+       kill -HUP $PID $SLAVEPID
+       kill -HUP $SLURPPID
        exit $RC
 fi
 
@@ -114,6 +104,12 @@ dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michig
 changetype: modify
 add: drink
 drink: Orange Juice
+-
+delete: sn
+sn: Jones
+-
+add: sn
+sn: Jones
 
 dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
 changetype: modify
@@ -122,6 +118,7 @@ drink: Iced Tea
 drink: Mad Dog 20/20
 
 dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
+changetype: modify
 delete: member
 member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
 member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
@@ -132,7 +129,7 @@ member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Mi
 
 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
 changetype: modify
-delete: member
+delete: description
 
 dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
 changetype: add
@@ -161,6 +158,7 @@ changetype: add
 objectclass: OpenLDAPperson
 cn: Rosco P. Coltrane
 sn: Coltrane
+uid: rosco
 
 dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
 changetype: modrdn
@@ -183,8 +181,8 @@ RC=$?
 
 if test $RC != 0 ; then
        echo "ldapsearch failed ($RC)!"
-       kill -INT $PID $SLAVEPID
-       kill -KILL $SLURPPID
+       kill -HUP $PID $SLAVEPID
+       kill -HUP $SLURPPID
        exit $RC
 fi
 
@@ -195,13 +193,13 @@ RC=$?
 
 if test $RC != 0 ; then
        echo "ldapsearch failed ($RC)!"
-       kill -INT $PID $SLAVEPID
-       kill -KILL $SLURPPID
+       kill -HUP $PID $SLAVEPID
+       kill -HUP $SLURPPID
        exit $RC
 fi
 
-kill -INT $PID $SLAVEPID
-kill -KILL $SLURPPID
+kill -HUP $PID $SLAVEPID
+kill -HUP $SLURPPID
 
 SEARCHOUT=$MASTEROUT
 LDIF=$SLAVEOUT