summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2012-03-25 23:35:23 +0200
committerAndrew Bartlett <abartlet@samba.org>2012-03-26 00:57:29 +0200
commitfa1c7615d0809a124109713e1b340f71d9c4594f (patch)
tree2f5b0f0213ce943f4f4267cf60216ad278626d99 /source4/dsdb
parent206421c8fd28ca4bb6375b97e106d3531f1a5559 (diff)
downloadsamba-fa1c7615d0809a124109713e1b340f71d9c4594f.tar.gz
samba-fa1c7615d0809a124109713e1b340f71d9c4594f.tar.bz2
samba-fa1c7615d0809a124109713e1b340f71d9c4594f.zip
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>
Diffstat (limited to 'source4/dsdb')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py15
1 files changed, 15 insertions, 0 deletions
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):