summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-02 18:49:11 +0200
committerStefan Metzmacher <metze@samba.org>2008-10-02 18:56:09 +0200
commita25fac13ebd6ffc1e5eac25182636cfa298435f4 (patch)
treee29890edd7978e00461fee3364d2d806d572c338 /testprogs
parent05994005a35b940efc9cd8d1b3b0eebf2d2e38d7 (diff)
downloadsamba-a25fac13ebd6ffc1e5eac25182636cfa298435f4.tar.gz
samba-a25fac13ebd6ffc1e5eac25182636cfa298435f4.tar.bz2
samba-a25fac13ebd6ffc1e5eac25182636cfa298435f4.zip
s4:blackblox/test_ldb: test searches via wellknownObjects
metze
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/test_ldb.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh
index 8e1af99719..7a657d2e8d 100755
--- a/testprogs/blackbox/test_ldb.sh
+++ b/testprogs/blackbox/test_ldb.sh
@@ -117,5 +117,67 @@ echo "Search Options Control Query test returned 0 items"
failed=`expr $failed + 1`
fi
+function wellkown_object_test() {
+ local guid=$1
+ local object=$2
+ local basedns
+ local dn
+ local r
+ local c
+ local n
+ local failed=0
+
+ basedns="<WKGUID=${guid},${BASEDN}> <wkGuId=${guid},${BASEDN}>"
+ for dn in ${basedns}; do
+ echo "Test ${dn} => ${object}"
+ r=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectClass=*)' -b "${dn}" | grep 'dn: '`
+ n=`echo "${r}" | grep 'dn: ' | wc -l`
+ c=`echo "${r}" | grep "${object}" | wc -l`
+
+ if [ $n -lt 1 ]; then
+ echo "Object not found by WKGUID"
+ failed=`expr $failed + 1`
+ continue
+ fi
+ if [ $c -lt 1 ]; then
+ echo "Wrong object found by WKGUID: [${r}]"
+ failed=`expr $failed + 1`
+ continue
+ fi
+ done
+
+ return $failed
+}
+
+wellkown_object_test 22B70C67D56E4EFB91E9300FCA3DC1AA ForeignSecurityPrincipals
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
+wellkown_object_test 2FBAC1870ADE11D297C400C04FD8D5CD Infrastructure
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
+wellkown_object_test AB1D30F3768811D1ADED00C04FD8D5CD System
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
+wellkown_object_test A361B2FFFFD211D1AA4B00C04FD7D83A Domain Controllers
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
+wellkown_object_test AA312825768811D1ADED00C04FD8D5CD Computers
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
+wellkown_object_test A9D1CA15768811D1ADED00C04FD8D5CD Users
+st=$?
+if [ x"$st" != x"0" ]; then
+ failed=`expr $failed + $st`
+fi
exit $failed