r21687: Always test LDAP and LDAPS
[Samba.git] / source / script / tests / test_ldap.sh
blob4a331724aa353ace7d82630692b235b45e99de5d
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 > /dev/null; then
13 PROTOCOLS="ldap ldaps"
14 else
15 PROTOCOLS="ldap"
18 SERVER="$1"
19 USERNAME="$2"
20 PASSWORD="$3"
22 incdir=`dirname $0`
23 . $incdir/test_functions.sh
26 for p in $PROTOCOLS; do
27 for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do
28 testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $options
29 done
30 done
32 for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATENESS
34 testit "$t" bin/smbtorture $TORTURE_OPTIONS "-U$USERNAME%$PASSWORD" //$SERVER/_none_ $t
35 done
37 # only do the ldb tests when not in quick mode - they are quite slow, and ldb
38 # is now pretty well tested by the rest of the quick tests anyway
39 test "$TORTURE_QUICK" = "yes" || {
40 LDBDIR=lib/ldb
41 export LDBDIR
42 testit "ldb tests" $LDBDIR/tests/test-tdb.sh
45 SCRIPTDIR=../testprogs/ejs
47 testit "ejs ldap test" $SCRIPTDIR/ldap.js $CONFIGURATION $SERVER -U$USERNAME%$PASSWORD
49 testok $0 $failed