]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test049-sync-config
s/ldap_sync.h/ldap.h/
[openldap] / tests / scripts / test049-sync-config
index 80406de47f7b70bb0bc232bd75512c868689fbc4..168935f0315c171d1ed5cc77ae7455fc3bbda6f3 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2007 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -27,11 +27,11 @@ DBPRO=$PRODIR/db
 DBCON=$CONDIR/db
 CFPRO=$PRODIR/slapd.d
 CFCON=$CONDIR/slapd.d
-LOG1=slapd.1.log
-LOG2=slapd.2.log
 
 mkdir -p $TESTDIR $PRODIR $CONDIR $DBPRO $DBCON $CFPRO $CFCON
 
+$SLAPPASSWD -g -n >$CONFIGPWF
+
 #
 # Test replication of dynamic config:
 # - start producer
@@ -43,16 +43,17 @@ mkdir -p $TESTDIR $PRODIR $CONDIR $DBPRO $DBCON $CFPRO $CFCON
 #
 
 echo "Starting producer slapd on TCP/IP port $PORT1..."
-$SLAPADD -F $CFPRO -n 0 -l $DYNAMICCONF
+. $CONFFILTER $BACKEND $MONITORDB < $DYNAMICCONF > $CONFLDIF
+$SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
 cd $PRODIR
-$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING > ../$LOG1 2>&1 &
+$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
 PID=$!
 if test $WAIT != 0 ; then
     echo PID $PID
     read foo
 fi
 KILLPIDS="$PID"
-cd ../..
+cd $TESTWD
 
 sleep 1
 
@@ -90,7 +91,7 @@ EOF
                exit $RC
        fi
 fi
-CONFIGPW=`cat $CONFIGPWF`
+read CONFIGPW < $CONFIGPWF
 $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
 dn: olcDatabase={0}config,cn=config
 changetype: modify
@@ -116,16 +117,16 @@ if test $RC != 0 ; then
 fi
 
 echo "Starting consumer slapd on TCP/IP port $PORT2..."
-$SLAPADD -F $CFCON -n 0 -l $DYNAMICCONF
+$SLAPADD -F $CFCON -n 0 -l $CONFLDIF
 cd $CONDIR
-$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > ../$LOG2 2>&1 &
+$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
 SLAVEPID=$!
 if test $WAIT != 0 ; then
     echo SLAVEPID $SLAVEPID
     read foo
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
-cd ../..
+cd $TESTWD
 
 sleep 1
 
@@ -186,15 +187,15 @@ fi
 
 echo "Adding schema and databases on producer..."
 $LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
-include: file:$SCHEMADIR/core.ldif
+include: file://$ABS_SCHEMADIR/core.ldif
 
-include: file:$SCHEMADIR/cosine.ldif
+include: file://$ABS_SCHEMADIR/cosine.ldif
 
-include: file:$SCHEMADIR/inetorgperson.ldif
+include: file://$ABS_SCHEMADIR/inetorgperson.ldif
 
-include: file:$SCHEMADIR/openldap.ldif
+include: file://$ABS_SCHEMADIR/openldap.ldif
 
-include: file:$SCHEMADIR/nis.ldif
+include: file://$ABS_SCHEMADIR/nis.ldif
 EOF
 RC=$?
 if test $RC != 0 ; then