From a9c6879bb52b7dcfbfd6c329635aa235199e7145 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Thu, 8 Sep 2016 14:40:08 +1200 Subject: [PATCH] tests: Assert vanishing links doesn't bump USN Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- .../dsdb/tests/python/linked_attributes.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source4/dsdb/tests/python/linked_attributes.py b/source4/dsdb/tests/python/linked_attributes.py index cea3a010652..0c46523a1ae 100644 --- a/source4/dsdb/tests/python/linked_attributes.py +++ b/source4/dsdb/tests/python/linked_attributes.py @@ -306,11 +306,31 @@ class LATests(samba.tests.TestCase): self.add_linked_attribute(g2, u1) self.add_linked_attribute(g2, u2) + res = self.samdb.search(g1, scope=ldb.SCOPE_BASE, + attrs=['uSNChanged']) + old_usn1 = int(res[0]['uSNChanged'][0]) + + res = self.samdb.search(g2, scope=ldb.SCOPE_BASE, + attrs=['uSNChanged']) + old_usn2 = int(res[0]['uSNChanged'][0]) + self.samdb.delete(u1) self.assert_forward_links(g1, []) self.assert_forward_links(g2, [u2]) + res = self.samdb.search(g1, scope=ldb.SCOPE_BASE, + attrs=['uSNChanged']) + new_usn1 = int(res[0]['uSNChanged'][0]) + + res = self.samdb.search(g2, scope=ldb.SCOPE_BASE, + attrs=['uSNChanged']) + new_usn2 = int(res[0]['uSNChanged'][0]) + + # Assert the USN on the alternate object is unchanged + self.assertEqual(old_usn1, new_usn1) + self.assertEqual(old_usn2, new_usn2) + def test_la_links_delete_user_reveal(self): u1, u2 = self.add_objects(2, 'user', 'u_del_user_reveal') g1, g2 = self.add_objects(2, 'group', 'g_del_user_reveal')