From fa1c7615d0809a124109713e1b340f71d9c4594f Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 25 Mar 2012 23:35:23 +0200 Subject: s4:ldap.py - test the already mentioned structural object class sorting behaviour Reviewed-by: Andrew Bartlett Signed-off-by: Andrew Bartlett --- source4/dsdb/tests/python/ldap.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source4/dsdb/tests/python/ldap.py') diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 61443ef7a5..0682939edf 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -433,6 +433,21 @@ class BasicTests(samba.tests.TestCase): "objectClass") ldb.modify(m) + # Add a new auxiliary object class "posixAccount" to "ldaptestuser" + m = Message() + m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) + m["objectClass"] = MessageElement("posixAccount", FLAG_MOD_ADD, + "objectClass") + ldb.modify(m) + + # Be sure that "top" is the first and the (most) structural object class + # the last value of the "objectClass" attribute - MS-ADTS 3.1.1.1.4 + res = ldb.search("cn=ldaptestuser,cn=users," + self.base_dn, + scope=SCOPE_BASE, attrs=["objectClass"]) + self.assertTrue(len(res) == 1) + self.assertEquals(res[0]["objectClass"][0], "top") + self.assertEquals(res[0]["objectClass"][len(res[0]["objectClass"])-1], "user") + delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn) def test_system_only(self): -- cgit