diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-03 10:57:14 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-03 10:57:14 +0200 |
commit | 2904f3378d95c194fd7286ad5f321c6726819b8b (patch) | |
tree | 430cce7276e7e0d4897a5cfd98b7a6addbc11c5a /source4 | |
parent | 90828cc7022807a6036700d0edc8061c408ef8a7 (diff) | |
download | samba-2904f3378d95c194fd7286ad5f321c6726819b8b.tar.gz samba-2904f3378d95c194fd7286ad5f321c6726819b8b.tar.bz2 samba-2904f3378d95c194fd7286ad5f321c6726819b8b.zip |
s4:ldap.py - add a test for the "systemOnly" classes
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 17 |
1 files changed, 16 insertions, 1 deletions
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: |