From 54d4ba7103d15a096cdd08ac21fca30811fbd48c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 3 Nov 2010 17:41:10 +0100 Subject: s4:dsdb/tests/python/sam.py: test with member: metze --- source4/dsdb/tests/python/sam.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source4') diff --git a/source4/dsdb/tests/python/sam.py b/source4/dsdb/tests/python/sam.py index e1dbc6b09c..245d051659 100755 --- a/source4/dsdb/tests/python/sam.py +++ b/source4/dsdb/tests/python/sam.py @@ -531,6 +531,22 @@ class SamTests(unittest.TestCase): except LdbError, (num, _): self.assertEquals(num, ERR_ENTRY_ALREADY_EXISTS) + # Already added, but as + res1 = ldb.search("cn=ldaptestuser,cn=users," + self.base_dn, + scope=SCOPE_BASE, attrs=["objectSid"]) + self.assertTrue(len(res1) == 1) + sid_bin = res1[0]["objectSid"][0] + sid_str = ("").upper() + + m = Message() + m.dn = Dn(ldb, "cn=ldaptestgroup2,cn=users," + self.base_dn) + m["member"] = MessageElement(sid_str, FLAG_MOD_ADD, "member") + try: + ldb.modify(m) + self.fail() + except LdbError, (num, _): + self.assertEquals(num, ERR_ENTRY_ALREADY_EXISTS) + # Invalid member m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup2,cn=users," + self.base_dn) -- cgit