From: Douglas Bagnall Date: Wed, 14 Aug 2024 01:26:37 +0000 (+1200) Subject: s4:drs:tests: repeat getncchanges test with zero reserved_usn X-Git-Tag: tdb-1.4.13~1274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c7609ab755291de27c620120a1c71b557452e4;p=thirdparty%2Fsamba.git s4:drs:tests: repeat getncchanges test with zero reserved_usn This emulates the behaviour of Azure AD. As this is quite slow we will later reduce the test load in this case, but for now we want to run all the getncchanges tests this way. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15701 Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton --- diff --git a/selftest/knownfail.d/getncchanges b/selftest/knownfail.d/getncchanges index bda9b31a1b1..04760f59891 100644 --- a/selftest/knownfail.d/getncchanges +++ b/selftest/knownfail.d/getncchanges @@ -6,3 +6,12 @@ samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncIntegri samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncIntegrityTestCase.test_repl_get_tgt_multivalued_links\(promoted_dc\) # Samba chooses to always increment the USN for the NC root at the point where it would otherwise show up. samba4.drs.getncchanges.python\(.*\).getncchanges.DrsReplicaSyncIntegrityTestCase.test_repl_nc_is_first_nc_change_only\( + +# These failures are repeated in the tests where the client forces +# reserved_usn to zero, emulating Azure AD. DrsReplicaSyncFakeAzureAdTests +samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_get_tgt\(promoted_dc\) +samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_get_tgt_chain\(promoted_dc\) +samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_get_tgt_and_anc\(promoted_dc\) +samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_get_tgt_multivalued_links\(promoted_dc\) +# Samba chooses to always increment the USN for the NC root at the point where it would otherwise show up. +samba4.drs.getncchanges.python\(.*\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_nc_is_first_nc_change_only\( diff --git a/selftest/knownfail.d/getncchanges-azure-ad b/selftest/knownfail.d/getncchanges-azure-ad new file mode 100644 index 00000000000..a8e05bb47f9 --- /dev/null +++ b/selftest/knownfail.d/getncchanges-azure-ad @@ -0,0 +1,5 @@ +^samba4.drs.getncchanges.python\(vampire_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_get_tgt_multivalued_links\(vampire_dc\) +^samba4.drs.getncchanges.python\(vampire_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_integrity\(vampire_dc\) +^samba4.drs.getncchanges.python\(vampire_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_integrity_link_attr\(vampire_dc\) +^samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_integrity\(promoted_dc\) +^samba4.drs.getncchanges.python\(promoted_dc\).getncchanges.DrsReplicaSyncFakeAzureAdTests.test_repl_integrity_link_attr\(promoted_dc\) diff --git a/source4/torture/drs/python/getncchanges.py b/source4/torture/drs/python/getncchanges.py index f7b1fe8eeff..d05c38d4950 100644 --- a/source4/torture/drs/python/getncchanges.py +++ b/source4/torture/drs/python/getncchanges.py @@ -1421,6 +1421,18 @@ class DrsReplicaSyncIntegrityTestCase(drs_base.DrsBaseTestCase): # The NC should not be present in this replication self._test_repl_nc_is_first(start_at_zero=False, nc_change=False, ou_change=False) + +class DrsReplicaSyncFakeAzureAdTests(DrsReplicaSyncIntegrityTestCase): + """This repeats all of DrsReplicaSyncIntegrityTestCase, but the client + always sets highwatermark.reserved_usn = 0. This is what Azure AD + / Entra ID Connect does. + """ + @staticmethod + def modify_highwatermark(hwm): + if hwm is not None: + hwm.reserved_usn = 0 + + class DcConnection: """Helper class to track a connection to another DC"""