sh portability changes

This commit is contained in:
Kurt Zeilenga 1999-04-21 05:59:01 +00:00
parent 835eff719a
commit 2a92589ecd
13 changed files with 82 additions and 82 deletions

View file

@ -1,2 +1,2 @@
#!/bin/sh
#! /bin/sh
egrep -iv '^modifiersname:|^modifytimestamp:|^creatorsname:|^createtimestamp'

View file

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh
# disable LDAP initialization
LDAPNOINIT=true; export LDAPNOINIT
@ -25,7 +25,7 @@ for CMD in $SRCDIR/scripts/test*; do
echo ">>>>> Starting `basename $CMD` ..."
$CMD $SRCDIR $BACKEND
RC=$?
if [ $RC -eq 0 ]; then
if test $RC -eq 0 ; then
echo ">>>>> $CMD completed OK."
else
echo ">>>>> $CMD failed (exit $RC)"

View file

@ -24,7 +24,7 @@ LDAPMODIFY=../clients/tools/ldapmodify
LDAPADD=../clients/tools/ldapadd
LDAPMODRDN=../clients/tools/ldapmodrdn
SLAPDTESTER=$PROGDIR/slapd-tester
LVL=${SLAPD_DEBUG-5}
: ${LVL=$SLAPD_DEBUG}
ADDR=127.0.0.1
PORT=9009
SLAVEPORT=9010

View file

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh
. scripts/defines.sh
@ -9,7 +9,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -22,7 +22,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -36,7 +36,7 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
@ -44,14 +44,14 @@ done
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing retrieved entries to LDIF file used to create database"
cmp $SEARCHOUT $LDIF
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -22,7 +22,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -36,7 +36,7 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
@ -44,14 +44,14 @@ done
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing retrieved entries to LDIF file used to create database"
cmp $SEARCHOUT $LDIF
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -25,7 +25,7 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
'cn=Monitor' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
@ -35,7 +35,7 @@ echo "Using ldapmodify to populate the database..."
$LDAPMODIFY -a -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
$LDIFORDERED > /dev/null 2>&1
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapmodify failed!"
kill -HUP $PID
exit $RC
@ -48,7 +48,7 @@ $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
@ -60,7 +60,7 @@ echo "Filtering original ldif used to create database..."
echo "Comparing filter output..."
cmp $SEARCHFLT $LDIFFLT
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -19,7 +19,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -33,13 +33,13 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'cn=Manager' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
done
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -50,7 +50,7 @@ cat /dev/null > $TESTOUT
echo "Testing exact searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'sn=jensen' >> $TESTOUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -59,7 +59,7 @@ fi
echo "Testing OR searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'(|(objectclass=rfc822mailgroup)(sn=jones))' >> $TESTOUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -68,7 +68,7 @@ fi
echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'(&(objectclass=rfc822mailgroup)(cn=A*))' >> $TESTOUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -78,7 +78,7 @@ echo "Testing NOT searching..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'(!(objectclass=person))' | grep -v "^modifytimestamp:" \
>> $TESTOUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -88,7 +88,7 @@ kill -HUP $PID
echo "Comparing results"
cmp $TESTOUT $SEARCHOUTMASTER
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "Comparison failed"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -19,7 +19,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -33,13 +33,13 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'cn=Manager' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
done
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -106,7 +106,7 @@ changetype: delete
EOMODS
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapmodify failed!"
kill -HUP $PID
exit $RC
@ -118,14 +118,14 @@ $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
> $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing database to reference file"
cmp $SEARCHOUT $MODIFYOUTMASTER
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -19,7 +19,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -34,13 +34,13 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'cn=Manager' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
done
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -56,7 +56,7 @@ $LDAPMODRDN -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
/dev/null 2>&1 'cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US' 'cn=James A Jones III'
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapmodrdn failed!"
kill -HUP $PID
exit $RC
@ -67,7 +67,7 @@ $LDAPMODRDN -v -D "$MANAGERDN" -r -h localhost -p $PORT -w $PASSWD > \
/dev/null 2>&1 'cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US' 'cn=James A Jones II'
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapmodrdn failed!"
kill -HUP $PID
exit $RC
@ -79,14 +79,14 @@ $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
> $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing database to reference file"
cmp $SEARCHOUT $MODRDNOUTMASTER
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -19,7 +19,7 @@ rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -33,13 +33,13 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'cn=Monitor' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
done
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID
exit $RC
@ -109,14 +109,14 @@ $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing database to reference file"
cmp $SEARCHOUT $ACLOUTMASTER
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly"
exit 1
fi

View file

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh
#
# Test replication:
@ -10,12 +10,12 @@
# - retrieve database over ldap and compare against expected results
#
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -46,7 +46,7 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
'cn=Monitor' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
@ -57,7 +57,7 @@ for i in 0 1 2 3 4 5; do
$LDAPSEARCH -L -b "$BASEDN" -h localhost -p $SLAVEPORT \
'cn=Monitor' > /dev/null 2>&1
RC=$?
if [ $RC = 1 ]; then
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."
sleep 5
fi
@ -71,7 +71,7 @@ echo "Using ldapmodify to populate the database..."
$LDAPMODIFY -a -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
$LDIFORDERED > /dev/null 2>&1
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapmodify failed!"
kill -HUP $PID $SLAVEPID $SLURPPID
exit $RC
@ -146,7 +146,7 @@ echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
'objectclass=*' > $MASTEROUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID $SLAVEPID $SLURPPID
exit $RC
@ -156,7 +156,7 @@ echo "Using ldapsearch to read all the entries from the slave..."
$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
'objectclass=*' > $SLAVEOUT 2>&1
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
kill -HUP $PID $SLAVEPID $SLURPPID
exit $RC
@ -166,7 +166,7 @@ kill -HUP $PID $SLAVEPID $SLURPPID
echo "Comparing retrieved entries from master and slave..."
cmp $MASTEROUT $SLAVEOUT
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "test failed - master and slave databases differ"
exit 1
fi

View file

@ -1,11 +1,11 @@
#!/bin/sh
#! /bin/sh
if [ $# -eq 0 ]; then
if test $# -eq 0 ; then
SRCDIR="."
else
SRCDIR=$1; shift
fi
if [ $# -eq 1 ]; then
if test $# -eq 1 ; then
BACKEND=$1; shift
fi
@ -17,12 +17,12 @@ echo "Datadir is $DATADIR"
echo "Cleaning up in $DBDIR..."
rm -f $DBDIR/[!C]*
rm -f $DBDIR/[!C*
echo "Running ldif2ldbm to build slapd database..."
$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldif2ldbm failed!"
exit $RC
fi
@ -41,7 +41,7 @@ echo "Using tester for concurrent server access..."
$SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
RC=$?
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "slapd-tester failed!"
exit $RC
fi
@ -53,14 +53,14 @@ RC=$?
kill -HUP $PID
if [ $RC != 0 ]; then
if test $RC != 0 ; then
echo "ldapsearch failed!"
exit $RC
fi
echo "Comparing retrieved entries to LDIF file used to create database"
cmp $SEARCHOUT $LDIF
if [ $? != 0 ]; then
if test $? != 0 ; then
echo "comparison failed - database was not created correctly"
exit 1
fi