summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2017-10-25 10:54:42 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-10-26 01:32:14 +0200
commit046fc1f7de685afcbb7f0b92f0280ff0109ed4b7 (patch)
treeb89f67d4817bbd4438d0fb124c91a54ab190d9a1 /source4/dsdb
parent2d260b28f50ea6ee704d9fab2aaf26f760fa110f (diff)
downloadsamba-046fc1f7de685afcbb7f0b92f0280ff0109ed4b7.tar.gz
linked attribute tests: test against duplicates in replace
We should not be able to introduce duplicate links using MOD_REPLACE. It turns out we could and weren't testing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13095 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/tests/python/linked_attributes.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/linked_attributes.py b/source4/dsdb/tests/python/linked_attributes.py
index 6235bf77a89..705c9d5c0db 100644
--- a/source4/dsdb/tests/python/linked_attributes.py
+++ b/source4/dsdb/tests/python/linked_attributes.py
@@ -464,6 +464,16 @@ class LATests(samba.tests.TestCase):
self.assert_back_links(u3, [g1])
self.assert_back_links(u4, [])
+ try:
+ # adding u2 twice should be an error
+ self.replace_linked_attribute(g2, [u1, u2, u3, u2])
+ except ldb.LdbError as (num, msg):
+ if num != ldb.ERR_ENTRY_ALREADY_EXISTS:
+ self.fail("adding duplicate values, expected "
+ "ERR_ENTRY_ALREADY_EXISTS, (%d) "
+ "got %d" % (ldb.ERR_ENTRY_ALREADY_EXISTS, num))
+ else:
+ self.fail("replacing duplicate values succeeded when it shouldn't")
def test_la_links_replace2(self):
users = self.add_objects(12, 'user', 'u_replace2')