1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

s4:ldap.py - test the already mentioned structural object class sorting behaviour

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Matthias Dieter Wallnöfer
2012-03-25 23:35:23 +02:00
committed by Andrew Bartlett
parent 206421c8fd
commit fa1c7615d0

View File

@ -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):