summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-09-13 15:49:43 +1200
committerAndrew Bartlett <abartlet@samba.org>2017-09-22 21:20:25 +0200
commit8565ca1c6d9d80a326525b1c66ee7e93dab08ead (patch)
tree35f1e14c5be23dbd491ae732db4b2a112a6f82f4 /lib/ldb
parentf0624d389010bd3ac760f8f07a7174fd708496be (diff)
downloadsamba-8565ca1c6d9d80a326525b1c66ee7e93dab08ead.tar.gz
ldb: Add test showing a search against the index is not possible
This is not actually a great test, as the filter would fail to match these anyway, but it at least checks the codepath is safe. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib/ldb')
-rwxr-xr-xlib/ldb/tests/python/api.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py
index 62e885acee7..5cb848a7c82 100755
--- a/lib/ldb/tests/python/api.py
+++ b/lib/ldb/tests/python/api.py
@@ -950,6 +950,22 @@ class SearchTests(TestCase):
expression="(&(ou=ouX)(y=a))")
self.assertEqual(len(res11), 0)
+ def test_subtree_and_idx_record(self):
+ """Testing a search against the index record"""
+
+ res11 = self.l.search(base="DC=SAMBA,DC=ORG",
+ scope=ldb.SCOPE_SUBTREE,
+ expression="(@IDXDN=DC=SAMBA,DC=ORG)")
+ self.assertEqual(len(res11), 0)
+
+ def test_subtree_and_idxone_record(self):
+ """Testing a search against the index record"""
+
+ res11 = self.l.search(base="DC=SAMBA,DC=ORG",
+ scope=ldb.SCOPE_SUBTREE,
+ expression="(@IDXONE=DC=SAMBA,DC=ORG)")
+ self.assertEqual(len(res11), 0)
+
class IndexedSearchTests(SearchTests):
"""Test searches using the index, to ensure the index doesn't