diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/ldb/configure | 2 | ||||
-rwxr-xr-x | lib/ldb/docs/builddocs.sh | 60 | ||||
-rwxr-xr-x | lib/ldb/docs/installdocs.sh | 10 | ||||
-rwxr-xr-x | lib/ldb/tests/init_slapd.sh | 27 | ||||
-rwxr-xr-x | lib/ldb/tests/kill_slapd.sh | 12 | ||||
-rwxr-xr-x | lib/ldb/tests/ldapi_url.sh | 4 | ||||
-rwxr-xr-x | lib/ldb/tests/start_slapd.sh | 6 | ||||
-rwxr-xr-x | lib/ldb/tests/test-extended.sh | 22 | ||||
-rwxr-xr-x | lib/ldb/tests/test-generic.sh | 123 | ||||
-rwxr-xr-x | lib/ldb/tests/test-ldap.sh | 52 | ||||
-rwxr-xr-x | lib/ldb/tests/test-schema.sh | 3 | ||||
-rwxr-xr-x | lib/ldb/tests/test-soloading.sh | 5 | ||||
-rwxr-xr-x | lib/ldb/tests/test-sqlite3.sh | 6 | ||||
-rw-r--r-- | lib/ldb/tests/test-tdb-features.sh | 45 | ||||
-rwxr-xr-x | lib/ldb/tests/test-tdb-subunit.sh | 4 | ||||
-rwxr-xr-x | lib/ldb/tests/test-tdb.sh | 4 | ||||
-rwxr-xr-x | lib/replace/configure | 2 |
17 files changed, 192 insertions, 195 deletions
diff --git a/lib/ldb/configure b/lib/ldb/configure index 6c931bfbf5e..8979f07581b 100755 --- a/lib/ldb/configure +++ b/lib/ldb/configure @@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) if [ -f $PREVPATH/../../buildtools/bin/waf ]; then WAF=../../buildtools/bin/waf diff --git a/lib/ldb/docs/builddocs.sh b/lib/ldb/docs/builddocs.sh index 449dcb26815..b7e11d31375 100755 --- a/lib/ldb/docs/builddocs.sh +++ b/lib/ldb/docs/builddocs.sh @@ -6,8 +6,8 @@ XSLTPROC="$1" SRCDIR="$2" if [ -z "$XSLTPROC" ] || [ ! -x "$XSLTPROC" ]; then - echo "xsltproc not installed" - exit 0 + echo "xsltproc not installed" + exit 0 fi MANXSL="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" @@ -16,37 +16,37 @@ HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl" mkdir -p man for f in $SRCDIR/man/*.xml; do - base=`basename $f .xml` - out=man/"`basename $base`" - if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then - echo Processing manpage $f - $XSLTPROC --nonet -o "$out" "$MANXSL" $f - ret=$? - if [ "$ret" = "4" ]; then - echo "ignoring stylesheet error 4 for $MANXSL" - exit 0 + base=$(basename $f .xml) + out=man/"$(basename $base)" + if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then + echo Processing manpage $f + $XSLTPROC --nonet -o "$out" "$MANXSL" $f + ret=$? + if [ "$ret" = "4" ]; then + echo "ignoring stylesheet error 4 for $MANXSL" + exit 0 + fi + if [ "$ret" != "0" ]; then + echo "xsltproc failed with error $ret" + exit $ret + fi fi - if [ "$ret" != "0" ]; then - echo "xsltproc failed with error $ret" - exit $ret - fi - fi done for f in $SRCDIR/man/*.xml; do - base=`basename $f .xml` - out=man/"`basename $base`".html - if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then - echo Processing html $f - $XSLTPROC --nonet -o "$out" "$HTMLXSL" $f - ret=$? - if [ "$ret" = "4" ]; then - echo "ignoring stylesheet error 4 for $HTMLXSL" - exit 0 - fi - if [ "$ret" != "0" ]; then - echo "xsltproc failed with error $ret" - exit $ret + base=$(basename $f .xml) + out=man/"$(basename $base)".html + if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then + echo Processing html $f + $XSLTPROC --nonet -o "$out" "$HTMLXSL" $f + ret=$? + if [ "$ret" = "4" ]; then + echo "ignoring stylesheet error 4 for $HTMLXSL" + exit 0 + fi + if [ "$ret" != "0" ]; then + echo "xsltproc failed with error $ret" + exit $ret + fi fi - fi done diff --git a/lib/ldb/docs/installdocs.sh b/lib/ldb/docs/installdocs.sh index 6cc7b74ad51..90daf6f6154 100755 --- a/lib/ldb/docs/installdocs.sh +++ b/lib/ldb/docs/installdocs.sh @@ -4,14 +4,14 @@ MANDIR="$1" -MAN1="`/bin/ls man/*.1`" -MAN3="`/bin/ls man/*.3`" +MAN1="$(/bin/ls man/*.1)" +MAN3="$(/bin/ls man/*.3)" if [ -z "$MAN1" ] && [ -z "$MAN3" ]; then - echo "No manpages have been built" - exit 0 + echo "No manpages have been built" + exit 0 fi -mkdir -p "$MANDIR/man1" "$MANDIR/man3" +mkdir -p "$MANDIR/man1" "$MANDIR/man3" cp $MAN1 "$MANDIR/man1/" || exit 1 cp $MAN3 "$MANDIR/man3/" || exit 1 diff --git a/lib/ldb/tests/init_slapd.sh b/lib/ldb/tests/init_slapd.sh index cf06acd08b9..4629cf13974 100755 --- a/lib/ldb/tests/init_slapd.sh +++ b/lib/ldb/tests/init_slapd.sh @@ -1,20 +1,20 @@ -#!/bin/sh +#!/bin/sh if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi rm -rf tests/tmp/db mkdir -p tests/tmp/db if [ -f tests/tmp/slapd.pid ]; then - kill `cat tests/tmp/slapd.pid` - sleep 1 + kill $(cat tests/tmp/slapd.pid) + sleep 1 fi if [ -f tests/tmp/slapd.pid ]; then - kill -9 `cat tests/tmp/slapd.pid` - rm -f tests/tmp/slapd.pid + kill -9 $(cat tests/tmp/slapd.pid) + rm -f tests/tmp/slapd.pid fi # we don't consider a slapadd failure as a test suite failure, as it @@ -24,18 +24,17 @@ MODCONF=tests/tmp/modules.conf rm -f $MODCONF touch $MODCONF || exit 1 -slaptest -u -f $LDBDIR/tests/slapd.conf > /dev/null 2>&1 || { - echo "enabling sladp modules" -cat > $MODCONF <<EOF +slaptest -u -f $LDBDIR/tests/slapd.conf >/dev/null 2>&1 || { + echo "enabling sladp modules" + cat >$MODCONF <<EOF modulepath /usr/lib/ldap moduleload back_bdb EOF } slaptest -u -f $LDBDIR/tests/slapd.conf || { - echo "slaptest failed - skipping ldap tests" - exit 0 + echo "slaptest failed - skipping ldap tests" + exit 0 } -slapadd -f $LDBDIR/tests/slapd.conf < $LDBDIR/tests/init.ldif || exit 0 - +slapadd -f $LDBDIR/tests/slapd.conf <$LDBDIR/tests/init.ldif || exit 0 diff --git a/lib/ldb/tests/kill_slapd.sh b/lib/ldb/tests/kill_slapd.sh index 91beb108149..c60ae33a9c3 100755 --- a/lib/ldb/tests/kill_slapd.sh +++ b/lib/ldb/tests/kill_slapd.sh @@ -1,12 +1,12 @@ -#!/bin/sh +#!/bin/sh if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi if [ -f tests/tmp/slapd.pid ]; then - echo "killing slapd process `cat tests/tmp/slapd.pid`" - kill -9 `cat tests/tmp/slapd.pid` - rm -f tests/tmp/slapd.pid + echo "killing slapd process $(cat tests/tmp/slapd.pid)" + kill -9 $(cat tests/tmp/slapd.pid) + rm -f tests/tmp/slapd.pid fi diff --git a/lib/ldb/tests/ldapi_url.sh b/lib/ldb/tests/ldapi_url.sh index fef6c35f2be..bcda91752e4 100755 --- a/lib/ldb/tests/ldapi_url.sh +++ b/lib/ldb/tests/ldapi_url.sh @@ -2,10 +2,10 @@ # aargh, did LDAP ever have to expose this crap to users ... -BASE=`pwd` +BASE=$(pwd) TMPDIR=$BASE/tests/tmp -LDAPI_ESCAPE=`echo $TMPDIR/ldapi | sed 's|/|%2F|g'` +LDAPI_ESCAPE=$(echo $TMPDIR/ldapi | sed 's|/|%2F|g') echo "ldapi://$LDAPI_ESCAPE" diff --git a/lib/ldb/tests/start_slapd.sh b/lib/ldb/tests/start_slapd.sh index 11679d47a3e..4a4a35ea9c6 100755 --- a/lib/ldb/tests/start_slapd.sh +++ b/lib/ldb/tests/start_slapd.sh @@ -1,14 +1,14 @@ #!/bin/sh if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi mkdir -p $LDBDIR/tests/tmp/db # running slapd in the background (with &) means it stays in the same process group, so it can be # killed by timelimit -slapd -d0 -f $LDBDIR/tests/slapd.conf -h "`$LDBDIR/tests/ldapi_url.sh`" $* & +slapd -d0 -f $LDBDIR/tests/slapd.conf -h "$($LDBDIR/tests/ldapi_url.sh)" $* & sleep 2 diff --git a/lib/ldb/tests/test-extended.sh b/lib/ldb/tests/test-extended.sh index 0599757cc5a..f4dabd67d7b 100755 --- a/lib/ldb/tests/test-extended.sh +++ b/lib/ldb/tests/test-extended.sh @@ -35,16 +35,17 @@ groupType: 2147483649 samAccountType: 805306369 EOF -checkcount() { - count=$1 - expression="$2" - n=`$VALGRIND ldbsearch "$expression" | grep '^dn' | wc -l` - if [ $n != $count ]; then - echo "Got $n but expected $count for $expression" - $VALGRIND ldbsearch "$expression" - exit 1 - fi - echo "OK: $count $expression" +checkcount() +{ + count=$1 + expression="$2" + n=$($VALGRIND ldbsearch "$expression" | grep '^dn' | wc -l) + if [ $n != $count ]; then + echo "Got $n but expected $count for $expression" + $VALGRIND ldbsearch "$expression" + exit 1 + fi + echo "OK: $count $expression" } checkcount 1 '(i3=1234)' @@ -66,4 +67,3 @@ checkcount 1 '(i1:1.2.840.113556.1.4.804:=8388608)' # this is one that w2k gives checkcount 3 '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' - diff --git a/lib/ldb/tests/test-generic.sh b/lib/ldb/tests/test-generic.sh index 2774938b433..03ac91455eb 100755 --- a/lib/ldb/tests/test-generic.sh +++ b/lib/ldb/tests/test-generic.sh @@ -1,8 +1,8 @@ #!/bin/sh if [ -z "$LDB_SPECIALS" ]; then - LDB_SPECIALS=1 - export LDB_SPECIALS + LDB_SPECIALS=1 + export LDB_SPECIALS fi echo "LDB_URL: $LDB_URL" @@ -11,15 +11,15 @@ echo "Adding base elements" $VALGRIND ldbadd $LDBDIR/tests/test.ldif || exit 1 echo "Adding again - should fail" -$VALGRIND ldbadd $LDBDIR/tests/test.ldif 2> /dev/null && { - echo "Should have failed to add again - gave $?" - exit 1 +$VALGRIND ldbadd $LDBDIR/tests/test.ldif 2>/dev/null && { + echo "Should have failed to add again - gave $?" + exit 1 } echo "Adding LDIF with one already-existing user again - should fail" -$VALGRIND ldbadd $LDBDIR/tests/test-dup.ldif 2> /dev/null && { - echo "Should have failed to add again - gave $?" - exit 1 +$VALGRIND ldbadd $LDBDIR/tests/test-dup.ldif 2>/dev/null && { + echo "Should have failed to add again - gave $?" + exit 1 } echo "Adding again - should succeed (as previous failed)" @@ -29,19 +29,19 @@ echo "Modifying elements" $VALGRIND ldbmodify $LDBDIR/tests/test-modify.ldif || exit 1 echo "Modify LDIF with one un-met constraint - should fail" -$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet.ldif 2> /dev/null && { - echo "Should have failed to modify - gave $?" - exit 1 +$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet.ldif 2>/dev/null && { + echo "Should have failed to modify - gave $?" + exit 1 } echo "Modify LDIF with after failure of un-met constraint - should also fail" -$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet-2.ldif 2> /dev/null && { - echo "Should have failed to modify - gave $?" - exit 1 +$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet-2.ldif 2>/dev/null && { + echo "Should have failed to modify - gave $?" + exit 1 } echo "Showing modified record" -$VALGRIND ldbsearch '(uid=uham)' || exit 1 +$VALGRIND ldbsearch '(uid=uham)' || exit 1 echo "Rename entry with ldbmodify - modrdn" $VALGRIND ldbmodify $LDBDIR/tests/test-modify-modrdn.ldif || exit 1 @@ -49,33 +49,33 @@ $VALGRIND ldbmodify $LDBDIR/tests/test-modify-modrdn.ldif || exit 1 echo "Rename entry with ldbrename" OLDDN="cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST" NEWDN="cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST" -$VALGRIND ldbrename "$OLDDN" "$NEWDN" || exit 1 +$VALGRIND ldbrename "$OLDDN" "$NEWDN" || exit 1 echo "Showing renamed record" $VALGRIND ldbsearch '(uid=uham)' || exit 1 echo "Starting ldbtest" -$VALGRIND ldbtest --num-records 100 --num-searches 10 || exit 1 +$VALGRIND ldbtest --num-records 100 --num-searches 10 || exit 1 if [ $LDB_SPECIALS = 1 ]; then - echo "Adding index" - $VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1 + echo "Adding index" + $VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1 fi echo "Adding bad attributes - should fail" $VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif && { - echo "Should fhave failed - gave $?" - exit 1 + echo "Should fhave failed - gave $?" + exit 1 } echo "Testing indexed search" -$VALGRIND ldbsearch '(uid=uham)' || exit 1 +$VALGRIND ldbsearch '(uid=uham)' || exit 1 $VALGRIND ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1 -$VALGRIND ldbsearch '(&(uid=uham)(uid=uham))' || exit 1 -$VALGRIND ldbsearch '(|(uid=uham)(uid=uham))' || exit 1 -$VALGRIND ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1 -$VALGRIND ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1 -$VALGRIND ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1 +$VALGRIND ldbsearch '(&(uid=uham)(uid=uham))' || exit 1 +$VALGRIND ldbsearch '(|(uid=uham)(uid=uham))' || exit 1 +$VALGRIND ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1 +$VALGRIND ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1 +$VALGRIND ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1 $VALGRIND ldbsearch '(&(uid=uham)(uid=uha*)(title=*))' uid || exit 1 echo "Testing invalid search expression" @@ -89,64 +89,65 @@ $VALGRIND ldbsearch '(objectclass=)' uid || exit 1 $VALGRIND ldbsearch -b 'cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' --scope=base "" sn || exit 1 echo "Test wildcard match" -$VALGRIND ldbadd $LDBDIR/tests/test-wildcard.ldif || exit 1 -$VALGRIND ldbsearch '(cn=test*multi)' || exit 1 -$VALGRIND ldbsearch '(cn=*test*multi*)' || exit 1 -$VALGRIND ldbsearch '(cn=*test_multi)' || exit 1 -$VALGRIND ldbsearch '(cn=test_multi*)' || exit 1 -$VALGRIND ldbsearch '(cn=test*multi*test*multi)' || exit 1 +$VALGRIND ldbadd $LDBDIR/tests/test-wildcard.ldif || exit 1 +$VALGRIND ldbsearch '(cn=test*multi)' || exit 1 +$VALGRIND ldbsearch '(cn=*test*multi*)' || exit 1 +$VALGRIND ldbsearch '(cn=*test_multi)' || exit 1 +$VALGRIND ldbsearch '(cn=test_multi*)' || exit 1 +$VALGRIND ldbsearch '(cn=test*multi*test*multi)' || exit 1 $VALGRIND ldbsearch '(cn=test*multi*test*multi*multi_*)' || exit 1 echo "Starting ldbtest indexed" -$VALGRIND ldbtest --num-records 100 --num-searches 500 || exit 1 +$VALGRIND ldbtest --num-records 100 --num-searches 500 || exit 1 echo "Testing one level search" -count=`$VALGRIND ldbsearch -b 'ou=Groups,o=University of Michigan,c=TEST' --scope=one 'objectclass=*' none |grep '^dn' | wc -l` +count=$($VALGRIND ldbsearch -b 'ou=Groups,o=University of Michigan,c=TEST' --scope=one 'objectclass=*' none | grep '^dn' | wc -l) if [ $count != 3 ]; then - echo returned $count records - expected 3 - exit 1 + echo returned $count records - expected 3 + exit 1 fi echo "Testing binary file attribute value" $VALGRIND ldbmodify $LDBDIR/tests/photo.ldif || exit 1 -count=`$VALGRIND ldbsearch '(cn=Hampster Ursula)' jpegPhoto | grep '^dn' | wc -l` +count=$($VALGRIND ldbsearch '(cn=Hampster Ursula)' jpegPhoto | grep '^dn' | wc -l) if [ $count != 1 ]; then - echo returned $count records - expected 1 - exit 1 + echo returned $count records - expected 1 + exit 1 fi echo "*TODO* Testing UTF8 upper lower case searches !!" echo "Testing compare" -count=`$VALGRIND ldbsearch '(cn>=t)' cn | grep '^dn' | wc -l` +count=$($VALGRIND ldbsearch '(cn>=t)' cn | grep '^dn' | wc -l) if [ $count != 1 ]; then - # only "cn: test_multi_test_multi_test_multi" (comes after "t") - # upper-cased words come before "t" - hence excluded - echo returned $count records - expected 1 - exit 1 + # only "cn: test_multi_test_multi_test_multi" (comes after "t") + # upper-cased words come before "t" - hence excluded + echo returned $count records - expected 1 + exit 1 fi $VALGRIND ldbsearch '(cn>t)' cn && exit 1 # strictly greater should not work -count=`$VALGRIND ldbsearch '(cn<=t)' cn | grep '^dn' | wc -l` +count=$($VALGRIND ldbsearch '(cn<=t)' cn | grep '^dn' | wc -l) if [ $count != 18 ]; then - # everything except "cn: test_multi_test_multi_test_multi" (comes after "t") - # upper-cased letters come before "t" - hence included - echo returned $count records - expected 18 - exit 1 + # everything except "cn: test_multi_test_multi_test_multi" (comes after "t") + # upper-cased letters come before "t" - hence included + echo returned $count records - expected 18 + exit 1 fi $VALGRIND ldbsearch '(cn<t)' cn && exit 1 # strictly less should not work -checkcount() { - count=$1 - scope=$2 - basedn=$3 - expression="$4" - n=`$VALGRIND ldbsearch --scope="$scope" -b "$basedn" "$expression" | grep '^dn' | wc -l` - if [ $n != $count ]; then - echo "Got $n but expected $count for $expression" - exit 1 - fi - echo "OK: $count $expression" +checkcount() +{ + count=$1 + scope=$2 + basedn=$3 + expression="$4" + n=$($VALGRIND ldbsearch --scope="$scope" -b "$basedn" "$expression" | grep '^dn' | wc -l) + if [ $n != $count ]; then + echo "Got $n but expected $count for $expression" + exit 1 + fi + echo "OK: $count $expression" } checkcount 0 'base' '' '(uid=uham)' diff --git a/lib/ldb/tests/test-ldap.sh b/lib/ldb/tests/test-ldap.sh index 14cfb5f9793..6e0e4a4299b 100755 --- a/lib/ldb/tests/test-ldap.sh +++ b/lib/ldb/tests/test-ldap.sh @@ -6,31 +6,31 @@ SCHEMA_NEEDED="core nis cosine inetorgperson openldap" # setup needed schema files for f in $SCHEMA_NEEDED; do - if [ ! -r tests/schema/$f.schema ]; then - mkdir -p tests/schema - if [ -r /etc/ldap/schema/$f.schema ]; then - ln -s /etc/ldap/schema/$f.schema tests/schema/$f.schema - continue; + if [ ! -r tests/schema/$f.schema ]; then + mkdir -p tests/schema + if [ -r /etc/ldap/schema/$f.schema ]; then + ln -s /etc/ldap/schema/$f.schema tests/schema/$f.schema + continue + fi + if [ -r /etc/openldap/schema/$f.schema ]; then + ln -s /etc/openldap/schema/$f.schema tests/schema/$f.schema + continue + fi + + echo "SKIPPING TESTS: you need the following OpenLDAP schema files" + for f in $SCHEMA_NEEDED; do + echo " $f.schema" + done + exit 0 fi - if [ -r /etc/openldap/schema/$f.schema ]; then - ln -s /etc/openldap/schema/$f.schema tests/schema/$f.schema - continue; - fi - - echo "SKIPPING TESTS: you need the following OpenLDAP schema files" - for f in $SCHEMA_NEEDED; do - echo " $f.schema" - done - exit 0 - fi done if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi -LDB_URL=`$LDBDIR/tests/ldapi_url.sh` +LDB_URL=$($LDBDIR/tests/ldapi_url.sh) export LDB_URL PATH=bin:$PATH @@ -39,14 +39,14 @@ export PATH LDB_SPECIALS=0 export LDB_SPECIALS -if $LDBDIR/tests/init_slapd.sh && - $LDBDIR/tests/start_slapd.sh && - $LDBDIR/tests/test-generic.sh; then - echo "ldap tests passed"; - ret=0 +if $LDBDIR/tests/init_slapd.sh && + $LDBDIR/tests/start_slapd.sh && + $LDBDIR/tests/test-generic.sh; then + echo "ldap tests passed" + ret=0 else - echo "ldap tests failed"; - ret=$? + echo "ldap tests failed" + ret=$? fi #$LDBDIR/tests/kill_slapd.sh diff --git a/lib/ldb/tests/test-schema.sh b/lib/ldb/tests/test-schema.sh index 97841844db8..15582a28d08 100755 --- a/lib/ldb/tests/test-schema.sh +++ b/lib/ldb/tests/test-schema.sh @@ -30,5 +30,4 @@ if [ "$?" = "0" ]; then fi echo "Showing modified record" -$VALGRIND bin/ldbsearch '(cn=Test)' || exit 1 - +$VALGRIND bin/ldbsearch '(cn=Test)' || exit 1 diff --git a/lib/ldb/tests/test-soloading.sh b/lib/ldb/tests/test-soloading.sh index da6d57541e5..a783305823d 100755 --- a/lib/ldb/tests/test-soloading.sh +++ b/lib/ldb/tests/test-soloading.sh @@ -13,8 +13,8 @@ export PATH rm -f $LDB_URL* if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi cat <<EOF | $VALGRIND ldbadd || exit 1 @@ -29,4 +29,3 @@ someThing: someThingElse EOF $VALGRIND ldbsearch "(touchedBy=sample)" | grep "touchedBy: sample" || exit 1 - diff --git a/lib/ldb/tests/test-sqlite3.sh b/lib/ldb/tests/test-sqlite3.sh index 0cef318d98a..389132d4a62 100755 --- a/lib/ldb/tests/test-sqlite3.sh +++ b/lib/ldb/tests/test-sqlite3.sh @@ -1,14 +1,13 @@ #!/bin/sh - LDB_URL="sqlite3://sqltest.ldb" export LDB_URL rm -f sqltest.ldb if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi PATH=bin:$PATH @@ -22,4 +21,3 @@ $LDBDIR/tests/test-generic.sh #. $LDBDIR/tests/test-extended.sh #. $LDBDIR/tests/test-tdb-features.sh - diff --git a/lib/ldb/tests/test-tdb-features.sh b/lib/ldb/tests/test-tdb-features.sh index 5b2e9df6efc..1007fa048e7 100644 --- a/lib/ldb/tests/test-tdb-features.sh +++ b/lib/ldb/tests/test-tdb-features.sh @@ -9,16 +9,17 @@ dn: @MODULES @LIST: rdn_name EOF -checkcount() { - count=$1 - expression="$2" - n=`$VALGRIND ldbsearch "$expression" | grep '^dn' | wc -l` - if [ $n != $count ]; then - echo "Got $n but expected $count for $expression" - $VALGRIND ldbsearch "$expression" - exit 1 - fi - echo "OK: $count $expression" +checkcount() +{ + count=$1 + expression="$2" + n=$($VALGRIND ldbsearch "$expression" | grep '^dn' | wc -l) + if [ $n != $count ]; then + echo "Got $n but expected $count for $expression" + $VALGRIND ldbsearch "$expression" + exit 1 + fi + echo "OK: $count $expression" } echo "Testing case sensitive search" @@ -120,17 +121,18 @@ checkcount 1 '(test=foo)' checkcount 0 '(test=FOO)' checkcount 1 '(test=f*o*)' -checkone() { - count=$1 - base="$2" - expression="$3" - n=`$VALGRIND ldbsearch --scope=one -b "$base" "$expression" | grep '^dn' | wc -l` - if [ $n != $count ]; then - echo "Got $n but expected $count for $expression" - $VALGRIND ldbsearch --scope=one -b "$base" "$expression" - exit 1 - fi - echo "OK: $count $expression" +checkone() +{ + count=$1 + base="$2" + expression="$3" + n=$($VALGRIND ldbsearch --scope=one -b "$base" "$expression" | grep '^dn' | wc -l) + if [ $n != $count ]; then + echo "Got $n but expected $count for $expression" + $VALGRIND ldbsearch --scope=one -b "$base" "$expression" + exit 1 + fi + echo "OK: $count $expression" } echo "Removing wildcard attribute" @@ -175,4 +177,3 @@ test: one EOF checkone 3 "cn=t1,cn=TEST" '(test=one)' checkone 1 "cn=t1,cn=TEST" '(cn=two)' - diff --git a/lib/ldb/tests/test-tdb-subunit.sh b/lib/ldb/tests/test-tdb-subunit.sh index 7dab79f7ba9..a89c01c1c35 100755 --- a/lib/ldb/tests/test-tdb-subunit.sh +++ b/lib/ldb/tests/test-tdb-subunit.sh @@ -2,6 +2,6 @@ BINDIR=$1 -. `dirname $0`/../../../testprogs/blackbox/subunit.sh +. $(dirname $0)/../../../testprogs/blackbox/subunit.sh -testit "ldb" `dirname $0`/test-tdb.sh $BINDIR +testit "ldb" $(dirname $0)/test-tdb.sh $BINDIR diff --git a/lib/ldb/tests/test-tdb.sh b/lib/ldb/tests/test-tdb.sh index 91c48abe145..0b5414df554 100755 --- a/lib/ldb/tests/test-tdb.sh +++ b/lib/ldb/tests/test-tdb.sh @@ -14,8 +14,8 @@ PATH=$BINDIR:$PATH export PATH if [ -z "$LDBDIR" ]; then - LDBDIR=`dirname $0`/.. - export LDBDIR + LDBDIR=$(dirname $0)/.. + export LDBDIR fi cd $LDBDIR diff --git a/lib/replace/configure b/lib/replace/configure index d8a8d2ac2f3..d0ab6685fbe 100755 --- a/lib/replace/configure +++ b/lib/replace/configure @@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) if [ -f $PREVPATH/../../buildtools/bin/waf ]; then WAF=../../buildtools/bin/waf |