mirror of
https://github.com/samba-team/samba.git
synced 2025-01-03 01:18:10 +03:00
s4:dsdb/tests/python/sam.py: test with member: <SID=...>
metze
This commit is contained in:
parent
4b79a74c1b
commit
54d4ba7103
@ -531,6 +531,22 @@ class SamTests(unittest.TestCase):
|
|||||||
except LdbError, (num, _):
|
except LdbError, (num, _):
|
||||||
self.assertEquals(num, ERR_ENTRY_ALREADY_EXISTS)
|
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
|
# Invalid member
|
||||||
m = Message()
|
m = Message()
|
||||||
m.dn = Dn(ldb, "cn=ldaptestgroup2,cn=users," + self.base_dn)
|
m.dn = Dn(ldb, "cn=ldaptestgroup2,cn=users," + self.base_dn)
|
||||||
|
Loading…
Reference in New Issue
Block a user