summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-17 03:30:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:20 -0500
commit08e23b36cb2a7437257c399e390485f288c572a1 (patch)
treeb57efa55522755d4cb50e79fac82cc99c435674f /source4/script
parentcf4552761e989a4daa4a3e074a79c990c9cb1280 (diff)
downloadsamba-08e23b36cb2a7437257c399e390485f288c572a1.tar.gz
samba-08e23b36cb2a7437257c399e390485f288c572a1.tar.bz2
samba-08e23b36cb2a7437257c399e390485f288c572a1.zip
r7671: added ldap testing to the set of standard tests
(This used to be commit dcdf44024aa93e7eca54247d9058904c6950fae7)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/tests/selftest.sh1
-rwxr-xr-xsource4/script/tests/test_ldap.sh25
2 files changed, 16 insertions, 10 deletions
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index c4f8a5a5a9..9ffb283886 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -85,6 +85,7 @@ START=`date`
sleep 4
failed=0
+ $SRCDIR/script/tests/test_ldap.sh localhost || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_binding_string.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_echo.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || failed=`expr $failed + $?`
diff --git a/source4/script/tests/test_ldap.sh b/source4/script/tests/test_ldap.sh
index 84f1272631..43c251d7e7 100755
--- a/source4/script/tests/test_ldap.sh
+++ b/source4/script/tests/test_ldap.sh
@@ -1,23 +1,28 @@
#!/bin/sh
+# test some simple LDAP and CLDAP operations
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: test_ldap.sh SERVER
+EOF
+exit 1;
+fi
SERVER="$1"
-# test some simple LDAP operations
+incdir=`dirname $0`
+. $incdir/test_functions.sh
-echo "Testing RootDSE"
-ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || exit 1
+testit "RootDSE" bin/ldbsearch -b "''" -H ldap://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
echo "Getting defaultNamingContext"
-BASEDN=`ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep ^defaultNamingContext | awk '{print $2}'`
+BASEDN=`bin/ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep ^defaultNamingContext | awk '{print $2}'`
echo "BASEDN is $BASEDN"
-echo "Listing Users"
-ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=user)' sAMAccountName || exit 1
+testit "Listing Users" bin/ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
-echo "Listing Groups"
-ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=group)' sAMAccountName || exit 1
+testit "Listing Users" bin/ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
-echo "CLDAP test"
-bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ LDAP-CLDAP || exit 1
+testit "CLDAP" bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ LDAP-CLDAP || failed=`expr $failed + 1`