Generate random configpw, use dynamic config for translucent test

This commit is contained in:
Howard Chu 2006-06-24 01:36:18 +00:00
parent 87d9353b12
commit 40053ac203
3 changed files with 36 additions and 68 deletions

View file

@ -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"

View file

@ -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=$?

View file

@ -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 <<EOF
dn: olcOverlay={0}translucent,olcDatabase={2}bdb,cn=config
changetype: modify
replace: olcTranslucentNoGlue
olcTranslucentNoGlue: FALSE
EOF
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
echo "ldapmodify of dynamic config failed ($RC)"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "Testing add: valid local record..."
@ -619,40 +599,22 @@ if test "$ATTR" != "preferredLanguage: ISO8859-1" ; then
exit 1
fi
echo "Shutting down local slapd..."
kill -HUP $LOCALPID
wait $LOCALPID
echo "Configuring local slapd with translucent_strict..."
echo translucent_strict >> $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 <<EOF
dn: olcOverlay={0}translucent,olcDatabase={2}bdb,cn=config
changetype: modify
replace: olcTranslucentNoGlue
olcTranslucentNoGlue: TRUE
-
replace: olcTranslucentStrict
olcTranslucentStrict: TRUE
EOF
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
echo "ldapmodify of dynamic config failed ($RC)"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "Testing strict mode delete: nonexistent local attribute..."