diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-06-19 11:29:31 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-06-19 11:32:01 +1000 |
commit | 5c19c60c5741196fc0a2b8db901e1be02139ae4e (patch) | |
tree | e57cbaa105280b5509af75c25d30146b6d4271e4 /source4/lib | |
parent | a8e757ba4ca2a003c114295473fe08a8f80fb2c2 (diff) | |
download | samba-5c19c60c5741196fc0a2b8db901e1be02139ae4e.tar.gz samba-5c19c60c5741196fc0a2b8db901e1be02139ae4e.tar.bz2 samba-5c19c60c5741196fc0a2b8db901e1be02139ae4e.zip |
s4:ldb Add test for integer normalisation behaviour
This uses groupType as the example, but this actually applies to all
integer types in AD.
Andrew Bartlett
Diffstat (limited to 'source4/lib')
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index caa1c477d3..5418cc9d60 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -124,6 +124,23 @@ class BasicTests(unittest.TestCase): ldb.delete("cn=parentguidtest,cn=testotherusers," + self.base_dn) ldb.delete("cn=testotherusers," + self.base_dn) + def test_groupType(self): + """Test groupType behaviour + (should appear to be casted to a 32 bit signed integer before comparsion)""" + print "Testing groupType behaviour\n" + + res1 = ldb.search(base=self.base_dn, scope=SCOPE_SUBTREE, + attrs=["groupType"], expression="groupType=2147483650"); + + res2 = ldb.search(base=self.base_dn, scope=SCOPE_SUBTREE, + attrs=["groupType"], expression="groupType=-2147483646"); + + self.assertEquals(len(res1), len(res2)) + + self.assertTrue(res1.count > 0) + + self.assertEquals(res1[0]["groupType"][0], "-2147483646") + def test_all(self): """Basic tests""" |