X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest053-syncprov-glue;h=9c419d6bda567b31788075cdd13cee61ceec9ce2;hb=3743a5a68e4d608949d5fd04904733ee5c1ac959;hp=429b17becfc32c1e4446e611b33c3040d213ccbe;hpb=74e4f9051fd3bfde0bd63448fd89468c24a50a2a;p=openldap
diff --git a/tests/scripts/test053-syncprov-glue b/tests/scripts/test053-syncprov-glue
index 429b17becf..9c419d6bda 100755
--- a/tests/scripts/test053-syncprov-glue
+++ b/tests/scripts/test053-syncprov-glue
@@ -2,7 +2,7 @@
# $OpenLDAP$
## This work is part of OpenLDAP Software .
##
-## Copyright 1998-2008 The OpenLDAP Foundation.
+## Copyright 1998-2012 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ if test x"$SYNCMODE" = x ; then
fi
case "$SYNCMODE" in
ro)
- SYNCTYPE="type=refreshOnly interval=00:00:00:10"
+ SYNCTYPE="type=refreshOnly interval=00:00:00:03"
;;
rp)
SYNCTYPE="type=refreshAndPersist"
@@ -61,7 +61,7 @@ case "$SYNCMODE" in
;;
esac
-echo "Initializing producer configurations..."
+echo "Initializing provider configurations..."
$SLAPADD -F $CFPROD -n 0 < $LOG1 2>&1 &
PID=$!
@@ -110,7 +110,7 @@ fi
KILLPIDS="$KILLPIDS $PID"
cd $TESTWD
sleep 1
-echo "Using ldapsearch to check that producer slapd is running..."
+echo "Using ldapsearch to check that provider slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "" -H $URI1 \
'objectclass=*' > /dev/null 2>&1
@@ -127,7 +127,7 @@ if test $RC != 0 ; then
exit $RC
fi
-echo "Starting producer2 slapd on TCP/IP port $PORT2..."
+echo "Starting provider2 slapd on TCP/IP port $PORT2..."
cd $PRO2DIR
$SLAPD -F slapd.d -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
PID=$!
@@ -138,7 +138,7 @@ fi
KILLPIDS="$KILLPIDS $PID"
cd $TESTWD
sleep 1
-echo "Using ldapsearch to check that producer slapd is running..."
+echo "Using ldapsearch to check that provider slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "" -H $URI2 \
'objectclass=*' > /dev/null 2>&1
@@ -210,7 +210,7 @@ EOF
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
-olcModulePath: ../../../servers/slapd/back-$BACKEND
+olcModulePath: $TESTWD/../servers/slapd/back-$BACKEND
olcModuleLoad: back_$BACKEND.la
EOF
RC=$?
@@ -221,13 +221,13 @@ EOF
fi
done
-echo "Adding databases on producer..."
+echo "Adding databases on provider..."
if [ "$SYNCPROV" = syncprovmod ]; then
$LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
-olcModulePath: ../../../servers/slapd/overlays
+olcModulePath: $TESTWD/../servers/slapd/overlays
olcModuleLoad: syncprov.la
EOF
@@ -239,12 +239,15 @@ EOF
fi
fi
+nullExclude="" nullOK=""
+test $BACKEND = null && nullExclude="# " nullOK="OK"
+
$LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $PRODDIR/db
+${nullExclude}olcDbDirectory: $PRODDIR/db
olcSuffix: $BASEDN
olcRootDN: $MANAGERDN
olcRootPW: $PASSWD
@@ -252,7 +255,7 @@ olcRootPW: $PASSWD
EOF
RC=$?
if test $RC != 0 ; then
- echo "ldapadd failed for producer database config1 ($RC)!"
+ echo "ldapadd failed for provider database config1 ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
@@ -269,9 +272,9 @@ olcOverlay: {1}syncprov
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $PRODDIR/ou1
+${nullExclude}olcDbDirectory: $PRODDIR/ou1
olcSubordinate: TRUE
olcSuffix: ou=ou1,$BASEDN
olcRootDN: $MANAGERDN
@@ -279,18 +282,18 @@ olcRootDN: $MANAGERDN
EOF
RC=$?
if test $RC != 0 ; then
- echo "ldapadd failed for producer database config ($RC)!"
+ echo "ldapadd failed for provider database config ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-echo "Adding databases on producer2..."
+echo "Adding databases on provider2..."
if [ "$SYNCPROV" = syncprovmod ]; then
$LDAPADD -D cn=config -H $URI2 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
-olcModulePath: ../../../servers/slapd/overlays
+olcModulePath: $TESTWD/../servers/slapd/overlays
olcModuleLoad: syncprov.la
EOF
@@ -305,9 +308,9 @@ fi
$LDAPADD -D cn=config -H $URI2 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $PRO2DIR/db
+${nullExclude}olcDbDirectory: $PRO2DIR/db
olcSuffix: $BASEDN
olcRootDN: $MANAGERDN
olcRootPW: $PASSWD
@@ -320,7 +323,7 @@ olcOverlay: {0}syncprov
EOF
RC=$?
if test $RC != 0 ; then
- echo "ldapadd failed for producer database config ($RC)!"
+ echo "ldapadd failed for provider database config ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
@@ -329,9 +332,9 @@ echo "Adding databases on consumer..."
$LDAPADD -D cn=config -H $URI3 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $CONSDIR/db
+${nullExclude}olcDbDirectory: $CONSDIR/db
olcSuffix: $BASEDN
olcRootDN: $MANAGERDN
@@ -343,7 +346,7 @@ if test $RC != 0 ; then
exit $RC
fi
-echo "Populating producer..."
+echo "Populating provider..."
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD <> $TESTOUT 2>&1
dn: dc=example,dc=com
objectClass: top
@@ -360,12 +363,12 @@ ou: ou1
EOF
RC=$?
if test $RC != 0 ; then
- echo "ldapadd failed to populate producer entry ($RC)!"
+ echo "ldapadd failed to populate provider entry ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-echo "Populating producer2..."
+echo "Populating provider2..."
$LDAPADD -D "$MANAGERDN" -H $URI2 -w $PASSWD <> $TESTOUT 2>&1
dn: dc=example,dc=com
objectClass: top
@@ -382,19 +385,19 @@ ou: ou1
EOF
RC=$?
if test $RC != 0 ; then
- echo "ldapadd failed to populate producer entry ($RC)!"
+ echo "ldapadd failed to populate provider entry ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-echo "Adding syncrepl on producer..."
+echo "Adding syncrepl on provider..."
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=1 provider=$URI2 searchbase="ou=ou1,$BASEDN"
binddn="$MANAGERDN" bindmethod=simple credentials=$PASSWD
- $SYNCTYPE retry="5 5 300 5" timeout=1
+ $SYNCTYPE retry="3 5 300 5" timeout=1
EOF
RC=$?
@@ -411,7 +414,7 @@ changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=1 provider=$URI1 searchbase="$BASEDN"
binddn="$MANAGERDN" bindmethod=simple credentials=$PASSWD
- $SYNCTYPE retry="5 5 300 5" timeout=1
+ $SYNCTYPE retry="3 5 300 5" timeout=1
EOF
RC=$?
@@ -427,12 +430,12 @@ for i in 0 1 2 3 4 5; do
RESULT=`$LDAPSEARCH -H $URI3 \
-s base -b "ou=ou1,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
@@ -440,7 +443,7 @@ if test $RC != 0 ; then
exit $RC
fi
-echo "Using ldapmodify to modify producer2..."
+echo "Using ldapmodify to modify provider2..."
$LDAPADD -D "$MANAGERDN" -H $URI2 -w $PASSWD <> $TESTOUT 2>&1
dn: ou=ou1,dc=example,dc=com
changetype: modify
@@ -463,12 +466,12 @@ for i in 0 1 2 3 4 5; do
RESULT=`$LDAPSEARCH -H $URI3 \
-s base -b "ou=ou1,$BASEDN" \
'(description=Modify1)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
- echo "Waiting 5 seconds for syncrepl to receive changes..."
- sleep 5
+ echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+ sleep $SLEEP1
done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
@@ -476,6 +479,7 @@ if test $RC != 0 ; then
exit $RC
fi
+case $BACKEND in bdb | hdb)
db_stat=
for path in `echo "$PATH" | sed -e 's/:/ /g'`; do
if test -f "$path/db_stat" && \
@@ -496,8 +500,9 @@ else
echo "Glue lock bug not found :-)"
lock_bug=0
fi
+esac
-echo "Using ldapmodify to modify glue suffix on producer..."
+echo "Using ldapmodify to modify glue suffix on provider..."
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD <> $TESTOUT 2>&1
dn: dc=example,dc=com
changetype: modify