From 40053ac203bb67fe952adc359b9a5c244850d7cf Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 24 Jun 2006 01:36:18 +0000 Subject: [PATCH] Generate random configpw, use dynamic config for translucent test --- tests/data/slapd-translucent-local.conf | 5 +- tests/run.in | 3 + tests/scripts/test034-translucent | 96 ++++++++----------------- 3 files changed, 36 insertions(+), 68 deletions(-) diff --git a/tests/data/slapd-translucent-local.conf b/tests/data/slapd-translucent-local.conf index 6dad2c3a03..1899abc870 100644 --- a/tests/data/slapd-translucent-local.conf +++ b/tests/data/slapd-translucent-local.conf @@ -43,7 +43,7 @@ database @BACKEND@ suffix "o=translucent" directory @TESTDIR@/db.2.a rootdn "o=translucent" -rootpw secret +include "configpw.conf" #bdb#index objectClass eq #bdb#index cn,sn,uid pres,eq,sub #hdb#index objectClass eq @@ -61,3 +61,6 @@ uri @URI1@ # a reminder. lastmod off acl-bind binddn="uid=binder,o=translucent" credentials="bindtest" + +database config +rootdn "o=translucent" diff --git a/tests/run.in b/tests/run.in index 475e2885f6..0ab71e6c4d 100644 --- a/tests/run.in +++ b/tests/run.in @@ -189,6 +189,9 @@ fi # disable LDAP initialization LDAPNOINIT=true; export LDAPNOINIT +$SLAPPASSWD -g -n >configpw +echo "rootpw `$SLAPPASSWD -T configpw`" >configpw.conf + echo "Running ${SCRIPT}..." $SCRIPT $* RC=$? diff --git a/tests/scripts/test034-translucent b/tests/scripts/test034-translucent index 75ba829868..822704492c 100755 --- a/tests/scripts/test034-translucent +++ b/tests/scripts/test034-translucent @@ -15,7 +15,8 @@ echo "running defines.sh" . $SRCDIR/scripts/defines.sh - +PASSWD=`cat configpw` +LVL=-1 PERSONAL="(objectClass=inetOrgPerson)" NOWHERE="/dev/null" FAILURE="additional info:" @@ -73,11 +74,12 @@ fi # configure frontside mkdir -p $DBDIR2 +mkdir -p testrun/conf2 . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTLOCALCONF > $CONF2 echo "Starting local slapd on TCP/IP port $PORT2..." -$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 & +$SLAPD -f $CONF2 -F testrun/conf2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 & PID=$! if test $WAIT != 0 ; then echo PID $PID @@ -196,41 +198,19 @@ if test $RC != 32 ; then exit 1 fi -echo "Shutting down local slapd..." -kill -HUP $LOCALPID -wait $LOCALPID - -echo "Configuring local slapd without translucent_no_glue..." -. $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTLOCALCONF | \ - grep -v translucent_no_glue > $CONF2 - -echo "Restarting local slapd on TCP/IP port $PORT2..." -$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING >> $LOG2 2>&1 & -PID=$! -if test $WAIT != 0 ; then - echo PID $PID - read foo -fi -LOCALPID="$PID" -KILLPIDS="$REMOTEPID $PID" - -sleep 1 - -for i in 0 1 2 3 4 5; do - $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \ - 'objectclass=*' > /dev/null 2>&1 - RC=$? - if test $RC = 0 ; then - break - fi - echo "Waiting 5 seconds for local slapd to start..." - sleep 5 -done +echo "Dynamically configuring local slapd without translucent_no_glue..." +$LDAPMODIFY -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD <> $CONF2 - -echo "Restarting slapd on TCP/IP port $PORT2..." -$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING >> $LOG2 2>&1 & -PID=$! -if test $WAIT != 0 ; then - echo PID $PID - read foo -fi -LOCALPID="$PID" -KILLPIDS="$REMOTEPID $PID" - -sleep 1 - -for i in 0 1 2 3 4 5; do - $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \ - 'objectclass=*' > /dev/null 2>&1 - RC=$? - if test $RC = 0 ; then - break - fi - echo "Waiting 5 seconds for local slapd to start..." - sleep 5 -done +echo "Dynamically configuring local slapd with translucent_no_glue and translucent_string..." +$LDAPMODIFY -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD <