Diff for /tests/scripts/test017-syncreplication-refresh between versions 1.2 and 1.7

version 1.2, 2003/05/23 16:02:34 version 1.7, 2003/06/26 05:18:50
Line 1 Line 1
 #! /bin/sh  #! /bin/sh
 # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.1 2003/05/20 17:57:18 jongchoi Exp $  # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.6 2003/06/26 04:12:55 jongchoi Exp $
   
 SRCDIR="."  SRCDIR="."
 if test $# -ge 1 ; then  if test $# -ge 1 ; then
         SRCDIR=$1; shift          SRCDIR=$1; shift
 fi  fi
   
 . $SRCDIR/scripts/args.sh  . $SRCDIR/scripts/args.sh $*
   
 if test "$BACKEND" != "bdb"; then  if test "$BACKEND" != "bdb" -a "$BACKEND" != "hdb"; then
         echo "Test only valid for back-bdb"          echo "Test only valid for back-bdb"
         exit 0          exit 0
 fi  fi
Line 27  echo "running defines.sh" Line 27  echo "running defines.sh"
   
 echo "Cleaning up in $DBDIR..."  echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*  rm -f $DBDIR/[!C]*
 echo "Cleaning up in $REPLDIR..."  echo "Resetting $R1REPLDIR..."
 rm -rf $REPLDIR/[!C]*  rm -rf $R1REPLDIR
   mkdir $R1REPLDIR
   
 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
Line 42  fi Line 43  fi
 echo "Waiting 5 seconds to wait for master to start..."  echo "Waiting 5 seconds to wait for master to start..."
 sleep 5  sleep 5
   
 echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."  
 . $CONFFILTER $BACKEND $MONITORDB < $SRREFSLAVECONF > $REPLCONF  
 $SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &  
 SLAVEPID=$!  
 if test $WAIT != 0 ; then  
     echo SLAVEPID $SLAVEPID  
     read foo  
 fi  
   
 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
         $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \          $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
Line 63  for i in 0 1 2 3 4 5; do Line 55  for i in 0 1 2 3 4 5; do
         sleep 5          sleep 5
 done  done
   
   echo "Using ldapadd to create the context prefix entry in the master..."
   $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
           $LDIFORDEREDCP > /dev/null 2>&1
   RC=$?
   if test $RC != 0 ; then
           echo "ldapadd failed ($RC)!"
           kill -HUP $PID $SLAVEPID
           exit $RC
   fi
   
   echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."
   . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF
   $SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &
   R1SLAVEPID=$!
   if test $WAIT != 0 ; then
       echo SLAVEPID $R1SLAVEPID
       read foo
   fi
   
 echo "Using ldapsearch to check that slave slapd is running..."  echo "Using ldapsearch to check that slave slapd is running..."
 for i in 0 1 2 3 4 5; do  for i in 0 1 2 3 4 5; do
         $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \          $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $R1SLAVEPORT \
                 'objectclass=*' > /dev/null 2>&1                  'objectclass=*' > /dev/null 2>&1
         RC=$?          RC=$?
         if test $RC = 0 ; then          if test $RC = 0 ; then
Line 77  done Line 88  done
   
 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 < \
         $LDIFORDERED > /dev/null 2>&1          $LDIFORDEREDNOCP > /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 $SLAVEPID
         kill -HUP $SLURPPID  
         exit $RC          exit $RC
 fi  fi
   
Line 179  RC=$? Line 189  RC=$?
 if test $RC != 0 ; then  if test $RC != 0 ; then
         echo "ldapsearch failed at master ($RC)!"          echo "ldapsearch failed at master ($RC)!"
         kill -HUP $PID $SLAVEPID          kill -HUP $PID $SLAVEPID
         kill -HUP $SLURPPID  
         exit $RC          exit $RC
 fi  fi
   
 echo "Using ldapsearch to read all the entries from the slave..."  echo "Using ldapsearch to read all the entries from the slave..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \  $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $R1SLAVEPORT \
         'objectclass=*' > $SLAVEOUT 2>&1          'objectclass=*' > $R1SLAVEOUT 2>&1
 RC=$?  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 $SLAVEPID          kill -HUP $PID $R1SLAVEPID
         kill -HUP $SLURPPID  
         exit $RC          exit $RC
 fi  fi
   
 kill -HUP $PID $SLAVEPID  kill -HUP $PID $R1SLAVEPID
   
 SEARCHOUT=$MASTEROUT  SEARCHOUT=$MASTEROUT
 LDIF=$SLAVEOUT  LDIF=$R1SLAVEOUT
   
 echo "Filtering ldapsearch results..."  echo "Filtering ldapsearch results..."
 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT  . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
 echo "Filtering original ldif used to create database..."  echo "Filtering original ldif used to create database..."
 . $LDIFFILTER < $LDIF > $LDIFFLT  . $LDIFFILTER < $LDIF > $R1LDIFFLT
   
 echo "Comparing retrieved entries from master and slave..."  echo "Comparing retrieved entries from master and slave..."
 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT  $CMP $SEARCHFLT $R1LDIFFLT > $CMPOUT
   
 if test $? != 0 ; then  if test $? != 0 ; then
         echo "test failed - master and slave databases differ"          echo "test failed - master and slave databases differ"

Removed from v.1.2  
changed lines
  Added in v.1.7


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