Diff for /tests/scripts/test017-syncreplication-refresh between versions 1.11 and 1.14

version 1.11, 2003/09/22 22:11:46 version 1.14, 2003/10/21 01:08:08
Line 1 Line 1
 #! /bin/sh  #! /bin/sh
 # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.10 2003/09/05 16:11:39 jongchoi Exp $  # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.13 2003/10/19 03:46:56 hyc Exp $
   
 SRCDIR="."  
 if test $# -ge 1 ; then  
         SRCDIR=$1; shift  
 fi  
   
 . $SRCDIR/scripts/args.sh $*  
   
 echo "running defines.sh"  echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh  . $SRCDIR/scripts/defines.sh
   
   mkdir $DBDIR
   mkdir $REPLDIR $REPLDIR/r1
   
 #  #
 # Test replication:  # Test replication:
 # - start master  # - start master
Line 20  echo "running defines.sh" Line 16  echo "running defines.sh"
 # - retrieve database over ldap and compare against expected results  # - retrieve database over ldap and compare against expected results
 #  #
   
 echo "Cleaning up in $DBDIR..."  
 rm -f $DBDIR/[!C]*  
 echo "Resetting $R1REPLDIR..."  
 rm -rf $R1REPLDIR  
 mkdir $R1REPLDIR  
   
 SAVE=$BACKEND  
 if test $BACKEND = ldbm; then  
         if test $SYNCREPL = no; then  
                 echo "Sync replication requires back-bdb or back-hdb"  
                 exit 0  
         fi  
         BACKEND=$SYNCREPL  
 fi  
 echo "Starting master slapd on TCP/IP port $PORT..."  echo "Starting master slapd on TCP/IP port $PORT..."
 . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF  . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF
 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &  $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
Line 42  if test $WAIT != 0 ; then Line 24  if test $WAIT != 0 ; then
     echo PID $PID      echo PID $PID
     read foo      read foo
 fi  fi
 BACKEND=$SAVE  
   
 echo "Waiting 5 seconds to wait for master to start..."  
 sleep 5  
   
 echo "Using ldapsearch to check that master slapd is running..."  echo "Using ldapsearch to check that master slapd is running..."
 for i in 0 1 2 3 4 5; do  for i in 0 1 2 3 4 5; do
Line 59  for i in 0 1 2 3 4 5; do Line 37  for i in 0 1 2 3 4 5; do
         sleep 5          sleep 5
 done  done
   
   if test $RC != 0 ; then
           echo "ldapsearch failed ($RC)!"
           kill -HUP $PID
           exit $RC
   fi
   
 echo "Using ldapadd to create the context prefix entry in the master..."  echo "Using ldapadd to create the context prefix entry in the master..."
 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \  $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
         $LDIFORDEREDCP > /dev/null 2>&1          $LDIFORDEREDCP > /dev/null 2>&1
 RC=$?  RC=$?
 if test $RC != 0 ; then  if test $RC != 0 ; then
         echo "ldapadd failed ($RC)!"          echo "ldapadd failed ($RC)!"
         kill -HUP $PID $SLAVEPID          kill -HUP $PID
         exit $RC          exit $RC
 fi  fi
   
 echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."  echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."
 . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF  . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF
 $SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &  $SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &
 R1SLAVEPID=$!  SLAVEPID=$!
 if test $WAIT != 0 ; then  if test $WAIT != 0 ; then
     echo SLAVEPID $R1SLAVEPID      echo SLAVEPID $SLAVEPID
     read foo      read foo
 fi  fi
   
Line 90  for i in 0 1 2 3 4 5; do Line 74  for i in 0 1 2 3 4 5; do
         sleep 5          sleep 5
 done  done
   
   if test $RC != 0 ; then
           echo "ldapsearch failed ($RC)!"
           kill -HUP $PID $SLAVEPID
           exit $RC
   fi
   
 echo "Using ldapadd to populate the master directory..."  echo "Using ldapadd to populate the master directory..."
 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \  $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
         $LDIFORDEREDNOCP > /dev/null 2>&1          $LDIFORDEREDNOCP > /dev/null 2>&1
Line 203  RC=$? Line 193  RC=$?
   
 if test $RC != 0 ; then  if test $RC != 0 ; then
         echo "ldapsearch failed at slave ($RC)!"          echo "ldapsearch failed at slave ($RC)!"
         kill -HUP $PID $R1SLAVEPID          kill -HUP $PID $SLAVEPID
         exit $RC          exit $RC
 fi  fi
   
 kill -HUP $PID $R1SLAVEPID  kill -HUP $PID $SLAVEPID
   
 SEARCHOUT=$MASTEROUT  SEARCHOUT=$MASTEROUT
 LDIF=$R1SLAVEOUT  LDIF=$R1SLAVEOUT
Line 226  if test $? != 0 ; then Line 216  if test $? != 0 ; then
 fi  fi
   
 echo ">>>>> Test succeeded"  echo ">>>>> Test succeeded"
   
   
 exit 0  exit 0

Removed from v.1.11  
changed lines
  Added in v.1.14


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org