1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

ldb: tests for <= and >= integer indexing

Testing max, min and negative values for indexed 32 and 64 bit types.
This has to be done in two different files because the 64 bit type is
LDB_SYNTAX_INTEGER which is implemented at the ldb level, while the 32
bit is added in the ldb-samba module.  Schema syntax binding added for
ldb-samba.

We also need to make sure that full scans are not invoked for LMDB.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Aaron Haslett
2019-03-11 16:39:13 +13:00
committed by Andrew Bartlett
parent 6062d7241d
commit 18438c8af2
5 changed files with 279 additions and 0 deletions

View File

@ -189,6 +189,16 @@ class ComplexExpressionTests(TestCase):
py_expr = "%d <= {%s} <= %d" % (n-1, field, n+1)
self.assertLDAPQuery(expr, ou_dn, py_expr, ldap_objects)
half_n = int(n/2)
expr = "(%s<=%s)" % (field, half_n)
py_expr = "{%s} <= %d" % (field, half_n)
self.assertLDAPQuery(expr, ou_dn, py_expr, ldap_objects)
expr = "(%s>=%s)" % (field, half_n)
py_expr = "{%s} >= %d" % (field, half_n)
self.assertLDAPQuery(expr, ou_dn, py_expr, ldap_objects)
# Same test again for largeint and enum
def test_largeint_range(self):
self.test_int_range(self.largeint_f)
@ -455,6 +465,11 @@ class ComplexExpressionTests(TestCase):
py_expr = "{%s} <= %d" % (field, search_num)
self.assertLDAPQuery(expr, ou_dn, py_expr, ldap_objects)
expr = "(&(%s>=%d)(objectClass=user))" % (field, search_num)
py_expr = "{%s} >= %d" % (field, search_num)
self.assertLDAPQuery(expr, ou_dn, py_expr, ldap_objects)
# If we're called independently then import subunit, get host from first
# arg and run. Otherwise, subunit ran us so just set host from env.
# We always try to run over LDAP rather than direct file, so that