r21680: Reenable CLDAP test
[Samba/ekacnet.git] / source4 / script / tests / test_ldap.sh
blob0c71103ffd0329785319d28f09f4d886f480212f
1 #!/bin/sh
2 # test some simple LDAP and CLDAP operations
4 if [ $# -lt 3 ]; then
5 cat <<EOF
6 Usage: test_ldap.sh SERVER USERNAME PASSWORD
7 EOF
8 exit 1;
9 fi
11 # see if we support ldaps
12 if grep HAVE_LIBGNUTLS.1 include/config.h > /dev/null &&
13 test -n "$CONFFILE" && grep tls.enabled.=yes $CONFFILE > /dev/null; then
14 PROTOCOLS="ldap ldaps"
15 else
16 PROTOCOLS="ldap"
19 SERVER="$1"
20 USERNAME="$2"
21 PASSWORD="$3"
23 incdir=`dirname $0`
24 . $incdir/test_functions.sh
27 for p in $PROTOCOLS; do
28 for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do
29 testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $options
30 done
31 done
33 for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATENESS
35 testit "$t" bin/smbtorture $TORTURE_OPTIONS "-U$USERNAME%$PASSWORD" //$SERVER/_none_ $t
36 done
38 # only do the ldb tests when not in quick mode - they are quite slow, and ldb
39 # is now pretty well tested by the rest of the quick tests anyway
40 test "$TORTURE_QUICK" = "yes" || {
41 LDBDIR=lib/ldb
42 export LDBDIR
43 testit "ldb tests" $LDBDIR/tests/test-tdb.sh
46 SCRIPTDIR=../testprogs/ejs
48 testit "ejs ldap test" $SCRIPTDIR/ldap.js $CONFIGURATION $SERVER -U$USERNAME%$PASSWORD
50 testok $0 $failed