mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
lib:ldb: Reformat shell scripts
shfmt -f lib/ldb/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
1e88064170
commit
9b0273faa7
2
lib/ldb/configure
vendored
2
lib/ldb/configure
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
PREVPATH=`dirname $0`
|
||||
PREVPATH=$(dirname $0)
|
||||
|
||||
if [ -f $PREVPATH/../../buildtools/bin/waf ]; then
|
||||
WAF=../../buildtools/bin/waf
|
||||
|
@ -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
|
||||
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
|
||||
if [ "$ret" != "0" ]; then
|
||||
echo "xsltproc failed with error $ret"
|
||||
exit $ret
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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))'
|
||||
|
||||
|
@ -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)'
|
||||
|
@ -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;
|
||||
fi
|
||||
if [ -r /etc/openldap/schema/$f.schema ]; then
|
||||
ln -s /etc/openldap/schema/$f.schema tests/schema/$f.schema
|
||||
continue;
|
||||
fi
|
||||
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
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
2
lib/replace/configure
vendored
2
lib/replace/configure
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
PREVPATH=`dirname $0`
|
||||
PREVPATH=$(dirname $0)
|
||||
|
||||
if [ -f $PREVPATH/../../buildtools/bin/waf ]; then
|
||||
WAF=../../buildtools/bin/waf
|
||||
|
Loading…
Reference in New Issue
Block a user