diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 22:58:15 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 22:58:15 +0100 |
commit | 8f4e4d2e3039997106f9da3dcd5b057d99802ecf (patch) | |
tree | 65741566ca97d173135ffe5f39f5003e44e86331 /source4 | |
parent | 4fff36f618420dea2e004f87ae5a2699eabd140a (diff) | |
download | samba-8f4e4d2e3039997106f9da3dcd5b057d99802ecf.tar.gz samba-8f4e4d2e3039997106f9da3dcd5b057d99802ecf.tar.bz2 samba-8f4e4d2e3039997106f9da3dcd5b057d99802ecf.zip |
Adapt Zahari's test to the generic LDB Python tests.
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/lib/ldb/tests/python/api.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py index c372b8fa71..07500e2372 100755 --- a/source4/lib/ldb/tests/python/api.py +++ b/source4/lib/ldb/tests/python/api.py @@ -258,6 +258,19 @@ class SimpleLdb(unittest.TestCase): l = ldb.Ldb(filename()) l.set_debug(my_report_fn) + def test_zero_byte_string(self): + """Testing we do not get trapped in the \0 byte in a property string.""" + l = ldb.Ldb(filename()) + l.add({ + "dn" : "dc=somedn", + "objectclass" : "user", + "cN" : "LDAPtestUSER", + "givenname" : "ldap", + "displayname" : "foo\0bar", + }) + res = l.search(expression="(dn=dc=somedn)") + self.assertEquals("foo\0bar", res[0]["displayname"][0]) + class DnTests(unittest.TestCase): def setUp(self): |