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

version 1.14, 2003/10/21 01:08:08 version 1.15, 2003/10/22 03:14:09
Line 1 Line 1
 #! /bin/sh  #! /bin/sh
 # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.13 2003/10/19 03:46:56 hyc Exp $  # $OpenLDAP: pkg/ldap/tests/scripts/test017-syncreplication-refresh,v 1.14 2003/10/21 01:08:08 kurt Exp $
   
 echo "running defines.sh"  echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh  . $SRCDIR/scripts/defines.sh
   
 mkdir $DBDIR  mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
 mkdir $REPLDIR $REPLDIR/r1  
   
 #  #
 # Test replication:  # Test replication:
Line 16  mkdir $REPLDIR $REPLDIR/r1 Line 15  mkdir $REPLDIR $REPLDIR/r1
 # - retrieve database over ldap and compare against expected results  # - retrieve database over ldap and compare against expected results
 #  #
   
 echo "Starting master slapd on TCP/IP port $PORT..."  echo "Starting master slapd on TCP/IP port $PORT1..."
 . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF  . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $CONF1
 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &  $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
 PID=$!  PID=$!
 if test $WAIT != 0 ; then  if test $WAIT != 0 ; then
     echo PID $PID      echo PID $PID
     read foo      read foo
 fi  fi
   KILLPIDS="$PID"
   
 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 $PORT1 \
                 'objectclass=*' > /dev/null 2>&1                  'objectclass=*' > /dev/null 2>&1
         RC=$?          RC=$?
         if test $RC = 0 ; then          if test $RC = 0 ; then
Line 39  done Line 39  done
   
 if test $RC != 0 ; then  if test $RC != 0 ; then
         echo "ldapsearch failed ($RC)!"          echo "ldapsearch failed ($RC)!"
         kill -HUP $PID          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         exit $RC          exit $RC
 fi  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 $PORT1 -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          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         exit $RC          exit $RC
 fi  fi
   
 echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."  echo "Starting slave slapd on TCP/IP port $PORT2..."
 . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF  . $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $CONF2
 $SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &  $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
 SLAVEPID=$!  SLAVEPID=$!
 if test $WAIT != 0 ; then  if test $WAIT != 0 ; then
     echo SLAVEPID $SLAVEPID      echo SLAVEPID $SLAVEPID
     read foo      read foo
 fi  fi
   KILLPIDS="$KILLPIDS $SLAVEPID"
   
 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 $R1SLAVEPORT \          $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
                 'objectclass=*' > /dev/null 2>&1                  'objectclass=*' > /dev/null 2>&1
         RC=$?          RC=$?
         if test $RC = 0 ; then          if test $RC = 0 ; then
Line 76  done Line 77  done
   
 if test $RC != 0 ; then  if test $RC != 0 ; then
         echo "ldapsearch failed ($RC)!"          echo "ldapsearch failed ($RC)!"
         kill -HUP $PID $SLAVEPID          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         exit $RC          exit $RC
 fi  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 $PORT1 -w $PASSWD < \
         $LDIFORDEREDNOCP > /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          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         exit $RC          exit $RC
 fi  fi
   
Line 99  echo "Using ldapmodify to modify master Line 100  echo "Using ldapmodify to modify master
 # Do some modifications  # Do some modifications
 #  #
   
 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \  $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
         $TESTOUT 2>&1 << EOMODS          $TESTOUT 2>&1 << EOMODS
 dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US  dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
 changetype: modify  changetype: modify
Line 176  echo "Waiting 90 seconds for syncrepl to Line 177  echo "Waiting 90 seconds for syncrepl to
 sleep 90  sleep 90
   
 echo "Using ldapsearch to read all the entries from the master..."  echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \  $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
         'objectclass=*' > $MASTEROUT 2>&1          'objectclass=*' > $MASTEROUT 2>&1
 RC=$?  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          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         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 $R1SLAVEPORT \  $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
         'objectclass=*' > $R1SLAVEOUT 2>&1          'objectclass=*' > $SLAVEOUT 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          test $KILLSERVERS != no && kill -HUP $KILLPIDS
         exit $RC          exit $RC
 fi  fi
   
 kill -HUP $PID $SLAVEPID  test $KILLSERVERS != no && kill -HUP $KILLPIDS
   
 SEARCHOUT=$MASTEROUT  echo "Filtering master results..."
 LDIF=$R1SLAVEOUT  . $LDIFFILTER < $MASTEROUT > $MASTERFLT
   echo "Filtering slave results..."
 echo "Filtering ldapsearch results..."  . $LDIFFILTER < $SLAVEOUT > $SLAVEFLT
 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT  
 echo "Filtering original ldif used to create database..."  
 . $LDIFFILTER < $LDIF > $R1LDIFFLT  
   
 echo "Comparing retrieved entries from master and slave..."  echo "Comparing retrieved entries from master and slave..."
 $CMP $SEARCHFLT $R1LDIFFLT > $CMPOUT  $CMP $MASTERFLT $SLAVEFLT > $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.14  
changed lines
  Added in v.1.15


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