summaryrefslogtreecommitdiff
path: root/source4/script/tests/test_ldap.sh
blob: 84f1272631c31e464ac4a12f348134392457d165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

SERVER="$1"

# test some simple LDAP operations

echo "Testing RootDSE"
ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || exit 1

echo "Getting defaultNamingContext"
BASEDN=`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

echo "Listing Groups"
ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=group)' sAMAccountName || exit 1

echo "CLDAP test"
bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ LDAP-CLDAP || exit 1