summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-10-04 22:56:20 +0400
committerMatthieu Patou <mat@sn-devel-104.sn.samba.org>2010-10-04 20:23:31 +0000
commitd09cfc04fb29222c39ca4f170982c033fdc8206c (patch)
tree8ef7fc5f142a41ead3e1f2dd78d8810c292f47e3 /source4/lib/ldb
parent19f835dd69e7ea3ecc10732ebb031f78f79ec9f5 (diff)
downloadsamba-d09cfc04fb29222c39ca4f170982c033fdc8206c.tar.gz
samba-d09cfc04fb29222c39ca4f170982c033fdc8206c.tar.bz2
samba-d09cfc04fb29222c39ca4f170982c033fdc8206c.zip
unittests: add a test to avoid regression on previous fix
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Mon Oct 4 20:23:31 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4/lib/ldb')
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index 4b4415afb1..76de853ac7 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -7,6 +7,7 @@ import unittest
import ldb
+
def filename():
return os.tempnam()
@@ -321,6 +322,10 @@ class SimpleLdb(unittest.TestCase):
res = l.search(expression="(dn=dc=somedn)")
self.assertEquals("foo\0bar", res[0]["displayname"][0])
+ def test_no_crash_broken_expr(self):
+ l = ldb.Ldb(filename())
+ self.assertRaises(ldb.LdbError,lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"]))
+
class DnTests(unittest.TestCase):