From 2904f3378d95c194fd7286ad5f321c6726819b8b Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 3 Oct 2009 10:57:14 +0200 Subject: s4:ldap.py - add a test for the "systemOnly" classes --- source4/lib/ldb/tests/python/ldap.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index c4ebb7e03d..7fa25fb43e 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -117,6 +117,21 @@ class BasicTests(unittest.TestCase): self.delete_force(self.ldb, "cn=parentguidtest,cn=users," + self.base_dn) self.delete_force(self.ldb, "cn=parentguidtest,cn=testotherusers," + self.base_dn) self.delete_force(self.ldb, "cn=testotherusers," + self.base_dn) + self.delete_force(self.ldb, "cn=ldaptestobject," + self.base_dn) + + def test_system_only(self): + """Test systemOnly objects""" + print "Test systemOnly objects""" + + try: + self.ldb.add({ + "dn": "cn=ldaptestobject," + self.base_dn, + "objectclass": "configuration"}) + self.fail() + except LdbError, (num, _): + self.assertEquals(num, ERR_UNWILLING_TO_PERFORM) + + self.delete_force(self.ldb, "cn=ldaptestobject," + self.base_dn) def test_invalid_attribute(self): """Test adding invalid attributes (not in schema)""" @@ -136,7 +151,7 @@ class BasicTests(unittest.TestCase): "objectclass": "group"}) m = Message() - m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) + m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) m["thisdoesnotexist"] = MessageElement("x", FLAG_MOD_REPLACE, "thisdoesnotexist") try: -- cgit