diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-11-03 17:41:10 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-11-03 18:31:16 +0000 |
commit | 54d4ba7103d15a096cdd08ac21fca30811fbd48c (patch) | |
tree | 8c68e21cbb9d5fb3a0971fffebde7df1e526601a /source4/dsdb | |
parent | 4b79a74c1bcb74198a911693e8027797081727cc (diff) | |
download | samba-54d4ba7103d15a096cdd08ac21fca30811fbd48c.tar.gz samba-54d4ba7103d15a096cdd08ac21fca30811fbd48c.tar.bz2 samba-54d4ba7103d15a096cdd08ac21fca30811fbd48c.zip |
s4:dsdb/tests/python/sam.py: test with member: <SID=...>
metze
Diffstat (limited to 'source4/dsdb')
-rwxr-xr-x | source4/dsdb/tests/python/sam.py | 16 |
1 files changed, 16 insertions, 0 deletions
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 <SID=...> + 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 = ("<SID=" + ldb.schema_format_value("objectSid", sid_bin) + ">").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) |