1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00

s4:dsdb/tests/python/sam.py: test with member: <SID=...>

metze
This commit is contained in:
Stefan Metzmacher 2010-11-03 17:41:10 +01:00
parent 4b79a74c1b
commit 54d4ba7103

View File

@ -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)