summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-02 19:31:56 +0200
committerStefan Metzmacher <metze@samba.org>2008-10-06 09:07:37 +0200
commitbb4e9d72dd7de46ae4635ff5fbe5427b2a93e7cc (patch)
tree8cee11b230e58fb91307c3d1bfd5b1e6813ea60c /testprogs
parent41ee314438fe15d3bdd6a86ad5acf953c255011c (diff)
downloadsamba-bb4e9d72dd7de46ae4635ff5fbe5427b2a93e7cc.tar.gz
s4:blackbox/test_ldb: test search by <GUID=...> and <SID=...>
metze
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/test_ldb.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh
index 1774dbc7a34..5209abeb2c2 100755
--- a/testprogs/blackbox/test_ldb.sh
+++ b/testprogs/blackbox/test_ldb.sh
@@ -180,4 +180,29 @@ if [ x"$st" != x"0" ]; then
failed=`expr $failed + $st`
fi
+echo "Getting HEX GUID/SID of $BASEDN"
+HEXDN=`bin/ldbsearch $CONFIGURATION $options -b "$BASEDN" -H $p://$SERVER -s base "(objectClass=*)" --controls=extended_dn:1:0 | grep 'dn: ' | cut -d ' ' -f2-`
+HEXGUID=`echo "$HEXDN" | cut -d ';' -f1`
+HEXSID=`echo "$HEXDN" | cut -d ';' -f2`
+echo "HEXGUID[$HEXGUID]"
+echo "HEXSID[$HEXSID]"
+
+echo "Getting STR GUID/SID of $BASEDN"
+STRDN=`bin/ldbsearch $CONFIGURATION $options -b "$BASEDN" -H $p://$SERVER -s base "(objectClass=*)" --controls=extended_dn:1:1 | grep 'dn: ' | cut -d ' ' -f2-`
+echo "STRDN: $STRDN"
+STRGUID=`echo "$STRDN" | cut -d ';' -f1`
+STRSID=`echo "$STRDN" | cut -d ';' -f2`
+echo "STRGUID[$STRGUID]"
+echo "STRSID[$STRSID]"
+
+SPECIALDNS="$HEXGUID $HEXSID $STRGUID $STRSID"
+for SPDN in $SPECIALDNS; do
+ echo "Search for $SPDN"
+ nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "$SPDN" '(objectClass=*)' | grep "dn: $BASEDN" | wc -l`
+ if [ $nentries -lt 1 ]; then
+ echo "Special search returned 0 items"
+ failed=`expr $failed + 1`
+ fi
+done
+
exit $failed