From d6d0c23d49fd299d292b30338a9fc0ffcdaf1f2e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Nov 2009 17:00:05 +1100 Subject: [PATCH] s4:ldb Add Well Known GUID (WKGUID) tests to ldap.py --- source4/lib/ldb/tests/python/ldap.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index 0c247cf7f60..59bea8b3b06 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -778,6 +778,23 @@ objectClass: container self.delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn) self.delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) + def test_wkguid(self): + """Test Well known GUID behaviours (including DN+Binary)""" + print "Test Well known GUID behaviours (including DN+Binary)""" + + res = self.ldb.search(base=("" % self.base_dn), scope=SCOPE_BASE, attrs=[]) + self.assertEquals(len(res), 1) + + res2 = self.ldb.search(scope=SCOPE_BASE, attrs=["wellKnownObjects"], expression=("wellKnownObjects=B:32:ab1d30f3768811d1aded00c04fd8d5cd:%s" % res[0].dn)) + self.assertEquals(len(res2), 1) + + # Prove that the matching rule is over the whole DN+Binary + res2 = self.ldb.search(scope=SCOPE_BASE, attrs=["wellKnownObjects"], expression=("wellKnownObjects=B:32:ab1d30f3768811d1aded00c04fd8d5cd")) + self.assertEquals(len(res2), 0) + # Prove that the matching rule is over the whole DN+Binary + res2 = self.ldb.search(scope=SCOPE_BASE, attrs=["wellKnownObjects"], expression=("wellKnownObjects=%s") % res[0].dn) + self.assertEquals(len(res2), 0) + def test_all(self): """Basic tests""" -- 2.11.4.GIT