X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest007-replication;h=850052f87d0fd4ee2a25434c1d8b962989512fcf;hb=1669cd4d7be059b883a779396dde60e189ead286;hp=07b60921abf6b1902c159bb32903a3867282b35d;hpb=7ced460520056f30211bfe3aa42707c9e03919d1;p=openldap diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 07b60921ab..850052f87d 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -1,6 +1,18 @@ #! /bin/sh # $OpenLDAP$ +SRCDIR="." +if test $# -ge 1 ; then + SRCDIR=$1; shift +fi +BACKEND=ldbm +if test $# -ge 1 ; then + BACKEND=$1; shift +fi + +echo "running defines.sh" +. $SRCDIR/scripts/defines.sh + # # Test replication: # - start master @@ -11,18 +23,6 @@ # - retrieve database over ldap and compare against expected results # -if test $# -eq 0 ; then - SRCDIR="." -else - SRCDIR=$1; shift -fi -if test $# -eq 1 ; then - BACKEND=$1; shift -fi - -echo "running defines.sh $SRCDIR $BACKEND" -. $SRCDIR/scripts/defines.sh - if test ! -x $SLURPD ; then echo ">>>>> $SLURPD is not executable or do not exist." echo ">>>>> Test skipped." @@ -35,11 +35,13 @@ echo "Cleaning up in $REPLDIR..." rm -f $REPLDIR/[!C]* echo "Starting master slapd on TCP/IP port $PORT..." -$SLAPD -f $MASTERCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $BACKEND < $MASTERCONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." -$SLAPD -f $SLAVECONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & +. $CONFFILTER $BACKEND < $SLAVECONF > $REPLCONF +$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & SLAVEPID=$! echo "Using ldapsearch to check that master slapd is running..." @@ -73,8 +75,9 @@ $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \ $LDIFORDERED > /dev/null 2>&1 RC=$? if test $RC != 0 ; then - echo "ldapadd failed!" - kill -HUP $PID $SLAVEPID $SLURPPID + echo "ldapadd failed ($RC)!" + kill -INT $PID $SLAVEPID + kill -KILL $SLURPPID exit $RC fi @@ -148,8 +151,9 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \ 'objectclass=*' > $MASTEROUT 2>&1 if test $RC != 0 ; then - echo "ldapsearch failed!" - kill -HUP $PID $SLAVEPID $SLURPPID + echo "ldapsearch failed ($RC)!" + kill -INT $PID $SLAVEPID + kill -KILL $SLURPPID exit $RC fi @@ -158,23 +162,25 @@ $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \ 'objectclass=*' > $SLAVEOUT 2>&1 if test $RC != 0 ; then - echo "ldapsearch failed!" - kill -HUP $PID $SLAVEPID $SLURPPID + echo "ldapsearch failed ($RC)!" + kill -INT $PID $SLAVEPID + kill -KILL $SLURPPID exit $RC fi -kill -HUP $PID $SLAVEPID $SLURPPID +kill -INT $PID $SLAVEPID +kill -KILL $SLURPPID SEARCHOUT=$MASTEROUT LDIF=$SLAVEOUT echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing retrieved entries from master and slave..." -$CMP $SEARCHFLT $LDIFFLT +$CMP $SEARCHFLT $LDIFFLT > $CMPOUT if test $? != 0 ; then echo "test failed - master and slave databases differ"