From 30bb0b0b2a0b60ef407c719adb23b6e01effa03b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 20 Aug 2012 14:02:44 -0700 Subject: [PATCH] ITS#7340 more test script cleanup --- tests/scripts/test064-constraint | 73 ++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/tests/scripts/test064-constraint b/tests/scripts/test064-constraint index 4332346fe9..2d29baf1c6 100755 --- a/tests/scripts/test064-constraint +++ b/tests/scripts/test064-constraint @@ -20,7 +20,7 @@ mkdir -p $TESTDIR $CONFDIR $DBDIR1 $SLAPPASSWD -g -n >$CONFIGPWF -$SLAPADD -F $CONFDIR -n 0 < $TESTDIR/config.ldif <> $TESTDIR/config.ldif <> $TESTDIR/config.ldif <> $TESTDIR/config.ldif <> $TESTDIR/config.ldif < $LOG1 2>&1 & -PID=$! -if test $WAIT != 0 ; then - echo PID $PID - read foo fi -sleep 1 - -echo "Inserting constraint overlay... " -if [ "$CONSTRAINT" = constraintmod ]; then - $LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF < $TESTOUT 2>&1 -dn: cn=module,cn=config -objectClass: olcModuleList -cn: module -olcModulePath: $TESTWD/../servers/slapd/overlays -olcModuleLoad: constraint.la -EOF - RC=$? - if test $RC != 0 ; then - echo "ldapadd failed ($RC)!" - test $KILLSERVERS != no && kill -HUP $PID - exit $RC - fi -fi +cat >> $TESTDIR/config.ldif <> $TESTOUT 2>&1 dn: olcOverlay=constraint,olcDatabase={1}$BACKEND,cn=config objectClass: olcOverlayConfig objectClass: olcConstraintConfig @@ -88,12 +92,17 @@ olcConstraintAttribute: mail count 3 olcConstraintAttribute: mail regex ^[[:alnum:]]+@example.com$ olcConstraintAttribute: description count 2 EOF -RC=$? -if test $RC != 0 ; then - echo "ldapadd failed ($RC)!" - test $KILLSERVERS != no && kill -HUP $PID - exit $RC + +$SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif + +echo "Starting slapd on TCP/IP port $PORT1..." +$SLAPD -F $CONFDIR -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 & +PID=$! +if test $WAIT != 0 ; then + echo PID $PID + read foo fi +sleep 1 echo "Adding basic structure..." $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $ROOTLDIF &>/dev/null -- 2.39.5