From 2a92589ecd3e6961512179d01d813ec128772f58 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 21 Apr 1999 05:59:01 +0000 Subject: [PATCH] sh portability changes --- tests/scripts/acfilter.sh | 2 +- tests/scripts/all | 4 ++-- tests/scripts/defines.sh | 2 +- tests/scripts/makeldbm.sh | 4 ++-- tests/scripts/test001-ldif2ldbm | 14 +++++++------- tests/scripts/test001-slapadd | 14 +++++++------- tests/scripts/test002-populate | 14 +++++++------- tests/scripts/test003-search | 22 +++++++++++----------- tests/scripts/test004-modify | 18 +++++++++--------- tests/scripts/test005-modrdn | 20 ++++++++++---------- tests/scripts/test006-acls | 16 ++++++++-------- tests/scripts/test007-replication | 18 +++++++++--------- tests/scripts/test008-concurrency | 16 ++++++++-------- 13 files changed, 82 insertions(+), 82 deletions(-) diff --git a/tests/scripts/acfilter.sh b/tests/scripts/acfilter.sh index a7c6ac5ed8..22c58c3d0a 100755 --- a/tests/scripts/acfilter.sh +++ b/tests/scripts/acfilter.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#! /bin/sh egrep -iv '^modifiersname:|^modifytimestamp:|^creatorsname:|^createtimestamp' diff --git a/tests/scripts/all b/tests/scripts/all index b9f30d52bb..a469a919f0 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -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)" diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index 952571df02..1f07e01762 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -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 diff --git a/tests/scripts/makeldbm.sh b/tests/scripts/makeldbm.sh index 0431f37fe1..72cdb3053d 100755 --- a/tests/scripts/makeldbm.sh +++ b/tests/scripts/makeldbm.sh @@ -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 diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm index 82945b9167..ab92db1455 100755 --- a/tests/scripts/test001-ldif2ldbm +++ b/tests/scripts/test001-ldif2ldbm @@ -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 diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index 82945b9167..ab92db1455 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -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 diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index d4b0c9c2cd..6de48d2df3 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -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 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index bd96230e9c..952133bd08 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -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 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index e64f1e2392..cb1fdbdfa8 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -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 diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index a525922a56..5e3ad6d296 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -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 diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index e33067637a..eddf1f5e2c 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -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 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index a30586604f..da7ab0946d 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -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 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index 89597b9e64..9ca8486ce8 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -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 -- 2.39.5