1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-13 08:23:49 +03:00
Files
samba-mirror/source/script/tests/test_ldap.sh
2007-10-10 13:18:26 -05:00

29 lines
902 B
Bash
Executable File

#!/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"
incdir=`dirname $0`
. $incdir/test_functions.sh
testit "RootDSE" bin/ldbsearch --basedn='' -H ldap://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
echo "Getting defaultNamingContext"
BASEDN=`bin/ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep ^defaultNamingContext | awk '{print $2}'`
echo "BASEDN is $BASEDN"
testit "Listing Users" bin/ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
testit "Listing Groups" bin/ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
testit "CLDAP" bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ LDAP-CLDAP || failed=`expr $failed + 1`