r7671: added ldap testing to the set of standard tests
authorAndrew Tridgell <tridge@samba.org>
Fri, 17 Jun 2005 03:30:49 +0000 (03:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:20 +0000 (13:18 -0500)
(This used to be commit dcdf44024aa93e7eca54247d9058904c6950fae7)

source4/script/tests/selftest.sh
source4/script/tests/test_ldap.sh

index c4f8a5a5a95728b5fe3290f51d6e085b689fce8d..9ffb2838868d823284171097aa84dfa6a8276da5 100755 (executable)
@@ -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 + $?`
index 84f1272631c31e464ac4a12f348134392457d165..43c251d7e7087e244adb3168a7fa6951bc77e647 100755 (executable)
@@ -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`