Replace hard coded directory references with TESTDIR variable

This commit is contained in:
Quanah Gibson-Mount 2007-12-14 20:03:09 +00:00
parent a58ea1efdd
commit 1c73847a2c

View File

@ -36,8 +36,8 @@ if test $RC != 0 ; then
fi fi
echo "Starting slapd on TCP/IP port $PORT1..." echo "Starting slapd on TCP/IP port $PORT1..."
mkdir testrun/confdir mkdir $TESTDIR/confdir
$SLAPD -f $CONF1 -F testrun/confdir -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 & $SLAPD -f $CONF1 -F $TESTDIR/confdir -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$! PID=$!
if test $WAIT != 0 ; then if test $WAIT != 0 ; then
echo PID $PID echo PID $PID
@ -114,8 +114,8 @@ if test $RC != 19 ; then
fi fi
echo Dynamically retrieving initial configuration... echo Dynamically retrieving initial configuration...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/initial-config.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/initial-config.ldif
cat <<EOF >testrun/initial-reference.ldif cat <<EOF >$TESTDIR/initial-reference.ldif
dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig objectClass: olcOverlayConfig
objectClass: olcUniqueConfig objectClass: olcUniqueConfig
@ -125,7 +125,7 @@ olcUniqueAttribute: employeeNumber
olcUniqueAttribute: displayName olcUniqueAttribute: displayName
EOF EOF
diff testrun/initial-config.ldif testrun/initial-reference.ldif > /dev/null 2>&1 diff $TESTDIR/initial-config.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Initial configuration is not reported correctly." echo "Initial configuration is not reported correctly."
@ -164,8 +164,8 @@ if test $RC != 80 ; then
fi fi
echo Verifying initial configuration intact... echo Verifying initial configuration intact...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/initial-config-recheck.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/initial-config-recheck.ldif
diff testrun/initial-config-recheck.ldif testrun/initial-reference.ldif > /dev/null 2>&1 diff $TESTDIR/initial-config-recheck.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Initial configuration damaged by unsuccessful modifies." echo "Initial configuration damaged by unsuccessful modifies."
@ -188,8 +188,8 @@ if test $RC != 0 ; then
fi fi
echo Verifying base removal... echo Verifying base removal...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/baseremoval-config.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/baseremoval-config.ldif
cat >testrun/baseremoval-reference.ldif <<EOF cat >$TESTDIR/baseremoval-reference.ldif <<EOF
dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig objectClass: olcOverlayConfig
objectClass: olcUniqueConfig objectClass: olcUniqueConfig
@ -198,7 +198,7 @@ olcUniqueAttribute: employeeNumber
olcUniqueAttribute: displayName olcUniqueAttribute: displayName
EOF EOF
diff testrun/baseremoval-config.ldif testrun/baseremoval-reference.ldif > /dev/null 2>&1 diff $TESTDIR/baseremoval-config.ldif $TESTDIR/baseremoval-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Configuration damaged by base removal" echo "Configuration damaged by base removal"
@ -305,8 +305,8 @@ if test $RC != 0 ; then
fi fi
echo Dynamically retrieving second configuration... echo Dynamically retrieving second configuration...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/second-config.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/second-config.ldif
cat >testrun/second-reference.ldif <<EOF cat >$TESTDIR/second-reference.ldif <<EOF
dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig objectClass: olcOverlayConfig
objectClass: olcUniqueConfig objectClass: olcUniqueConfig
@ -315,7 +315,7 @@ olcUniqueURI: ldap:///?employeeNumber,displayName?sub
olcUniqueURI: ldap:///?description?one olcUniqueURI: ldap:///?description?one
EOF EOF
diff testrun/second-config.ldif testrun/second-reference.ldif > /dev/null 2>&1 diff $TESTDIR/second-config.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Second configuration is not reported correctly." echo "Second configuration is not reported correctly."
@ -408,8 +408,8 @@ if test $RC != 80 ; then
fi fi
echo Verifying second configuration intact... echo Verifying second configuration intact...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/second-config-recheck.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/second-config-recheck.ldif
diff testrun/second-config-recheck.ldif testrun/second-reference.ldif > /dev/null 2>&1 diff $TESTDIR/second-config-recheck.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Second configuration damaged by rejected modifies." echo "Second configuration damaged by rejected modifies."
@ -437,8 +437,8 @@ if test $RC != 0 ; then
fi fi
echo Dynamically retrieving third configuration... echo Dynamically retrieving third configuration...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/third-config.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/third-config.ldif
cat >testrun/third-reference.ldif <<EOF cat >$TESTDIR/third-reference.ldif <<EOF
dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig objectClass: olcOverlayConfig
objectClass: olcUniqueConfig objectClass: olcUniqueConfig
@ -447,7 +447,7 @@ olcUniqueURI: ldap:///?employeeNumber,displayName?sub
olcUniqueURI: ldap:///?sn?sub?(cn=e*) olcUniqueURI: ldap:///?sn?sub?(cn=e*)
EOF EOF
diff testrun/third-config.ldif testrun/third-reference.ldif > /dev/null 2>&1 diff $TESTDIR/third-config.ldif $TESTDIR/third-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Third configuration is not reported correctly." echo "Third configuration is not reported correctly."
@ -508,8 +508,8 @@ if test $RC != 0 ; then
fi fi
echo Dynamically retrieving fourth configuration... echo Dynamically retrieving fourth configuration...
$LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >testrun/fourth-config.ldif $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/fourth-config.ldif
cat >testrun/fourth-reference.ldif <<EOF cat >$TESTDIR/fourth-reference.ldif <<EOF
dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig objectClass: olcOverlayConfig
objectClass: olcUniqueConfig objectClass: olcUniqueConfig
@ -517,7 +517,7 @@ olcOverlay: {0}unique
olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
EOF EOF
diff testrun/fourth-config.ldif testrun/fourth-reference.ldif > /dev/null 2>&1 diff $TESTDIR/fourth-config.ldif $TESTDIR/fourth-reference.ldif > /dev/null 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "Fourth configuration is not reported correctly." echo "Fourth configuration is not reported correctly."