linked attribute tests: ensure duplicate deletes fail
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 24 Oct 2017 23:13:57 +0000 (12:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 25 Oct 2017 23:32:14 +0000 (01:32 +0200)
We can't remove the same thing twice in the same message.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/linked_attributes.py

index 705c9d5c0dbf6a5bc016735492f9c5984ca5883e..f0c260564bf2d604380d70eda3561bfa3913ed2e 100644 (file)
@@ -306,6 +306,11 @@ class LATests(samba.tests.TestCase):
         self.remove_linked_attribute(g1, [])
         self.assert_forward_links(g1, [])
 
+        # removing a duplicate link in the same message should fail
+        self.add_linked_attribute(g2, [u1, u2])
+        self.assertRaises(ldb.LdbError,
+                          self.remove_linked_attribute,g2, [u1, u1])
+
     def _test_la_links_delete_link_reveal(self):
         u1, u2 = self.add_objects(2, 'user', 'u_del_link_reveal')
         g1, g2 = self.add_objects(2, 'group', 'g_del_link_reveal')