summaryrefslogtreecommitdiff
path: root/source4/torture/drs/python
AgeCommit message (Collapse)AuthorFilesLines
2026-04-23s4:torture: Retry DsExecuteKCC on NT_STATUS_DS_BUSYAndreas Schneider3-4/+21
The KCC service runs a periodic samba_kcc child process (every 300s, first at 15s after startup) with a 40 second timeout. If a test calls DsExecuteKCC while the periodic child is running, kccsrv returns NT_STATUS_DS_BUSY which propagates as EPT_NT_CANT_PERFORM_OP to the client, causing flaky test failures. UNEXPECTED(error): samba4.drs.samba_tool_drs_showrepl.python(schema_pair_dc).samba_tool_drs_showrepl.SambaToolDrsShowReplTests.test_samba_tool_showrepl(schema_pair_dc:local) REASON: Exception: Exception: Traceback (most recent call last): File "/builds/samba-testbase/samba-def-build/source4/torture/drs/python/samba_tool_drs_showrepl.py", line 57, in test_samba_tool_showrepl kcc_out = self.check_output("samba-tool drs kcc %s %s" % (self.dc1, File "/builds/samba-testbase/samba-def-build/bin/python/samba/tests/__init__.py", line 593, in check_output raise BlackboxProcessError(retcode, line, stdoutdata, stderrdata) samba.tests.BlackboxProcessError: Command 'python3 bin/samba-tool drs kcc liveupgrade1dc -USCHEMADOMAIN/Administrator%locDCpass1'; shell True; exit status 255; stdout: ''; stderr: 'ERROR(runtime): DsExecuteKCC failed - (3221356597, 'The operation cannot be performed.') 3221356597 => 0xc0020035 (EPT_NT_CANT_PERFORM_OP) Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Apr 23 07:55:04 UTC 2026 on atb-devel-224
2025-08-07pytest:repl_rodc: avoid using dsdb_dn.get_bytesDouglas Bagnall1-2/+2
Nobody else uses it, so let's just use .binary. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2025-08-07s4:pytest:repl_rodc: use BinaryDn not dsdb_dnDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2025-05-26s4:torture:drs: Pass through unused parametersJennifer Sutton1-1/+2
Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2024-11-06s4: s/the the\b/the/ in miscellaneous commentsDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-08-28s4:drs:test:getncchanges skips some tests with reserved_usn = 0Douglas Bagnall1-0/+37
These tests are not affected by the reserved_usn change, so there is no need to run them twice. The test_repl_get_tgt_multivalued_links fails with or without reserved_usn set to zero, but it fails differently in either case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15701 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
2024-08-28s4:drs:test:getncchanges: remove timeout failureDouglas Bagnall1-5/+0
We don't need a timeout failure any more, since replication should always work. Leaving the timeout in might sometimes cause a flapping test if replication is being slow for some reason. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15701 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
2024-08-28s4:drs:tests: repeat getncchanges test with zero reserved_usnDouglas Bagnall1-0/+12
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 <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
2024-08-28s4:drs:tests: add hook for changing highwatermarkDouglas Bagnall1-0/+7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15701 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
2024-08-28s4:drs:test:getncchanges: add a timeout failureDouglas Bagnall1-0/+5
In the next commit we are going to add tests in which the client modifies the highwatermark in a way that resets replication (on Samba only). After that we'll fix it. If we leave the test in an eternal loop, the commit history will not be bisectable, so we are temporarily going to turn long waits into failures. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15701 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
2024-06-12s4/pytest: remove py2 str/bytes workaround in getnc_exopDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-05dsdb: Remove calls to ldb.set_opaque_integer()Andrew Bartlett1-2/+2
This routine will shortly be removed, it is now replaced by an improved ldb.set_opaque() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2023-10-25s4:torture: Fix code spellingJoseph Sutton2-3/+3
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13s4:torture: Use assertEqual() instead of assertEquals()Joseph Sutton1-2/+2
assertEquals() was removed in Python 3.12. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13s3:script: Remove semicolonsJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-09-29netcmd: tests: bugfix: argument -U was already in creds so listed twiceRob van der Linde1-3/+3
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-14s4:torture:drs: Fix code spellingAndreas Schneider8-20/+20
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-13s4-torture/drs: Add test showing that if present in the set the NC root ↵Andrew Bartlett1-0/+147
leads and tmp_highest_usn moves The NC root, on any replication when it appears, is the first object to be replicated, including for all subsequent chunks in the replication. However the tmp_highest_usn is not updated by that USN, it must only be updated for the non-NC changes (to match Windows exactly), or at least only updated with the non-NC changes until it would naturally appear. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-08-13s4-torture/drs: Add test demonstrating that a GetNCChanges REPL_OBJ will not ↵Andrew Bartlett1-0/+55
reset the replication cookie This demonstrates the behaviour used by the "Azure AD Connect" cloud sync tool. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-08-13s4-torture/drs: Add a test matching Azure AD Connect REPL_OBJ behaviourAndrew Bartlett1-1/+24
Azure AD Connect will send a GUID but no DummyDN. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-08-13s4-torture/drs: Use addCleanup() in getchanges.py for OU handlingAndrew Bartlett1-10/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-08-13s4-torture/drs: Create temp OU with a unique name per testAndrew Bartlett1-1/+2
It is always better to keep the testing OUs unique if possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-08-13s4-torture/drs: Save the server dnsname on the DcConnection objectAndrew Bartlett1-0/+1
This object is used to hold one of many possible connections and it is helpful for debugging and uniqueness to know which DC is being connected to. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-03-14selftest/drs: Demonstrate ERROR(ldb): uncaught exception - Deleted target ↵Andrew Bartlett1-0/+135
CN=NTDS Settings... in join "samba-tool domain join" uses the replication API in a strange way, perhaps no longer required, except that we often still have folks upgrading from very old Samba versions. By deferring the writing out to the DB of link replication to the very end, we have a better chance that all the objects required are present, however the situation may have changed during the cycle, and a link could still be sent, pointing to a deleted object. We currently fail in this situation. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15329 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-03-03pytest/delete_object: Remove unused variablesJoseph Sutton1-2/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/getnc_exop: Remove unused variableJoseph Sutton1-1/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/repl_move: Remove unused variablesJoseph Sutton1-67/+50
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/repl_rodc: Remove unused variableJoseph Sutton1-5/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/replica_sync: Remove unused variableJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/ridalloc_exop: Remove unused variablesJoseph Sutton1-8/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/samba_tool_drs_critical: Remove unused variablesJoseph Sutton1-5/+5
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/samba_tool_drs_no_dns: Remove unused variablesJoseph Sutton1-6/+5
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/samba_tool_drs: Remove unused variablesJoseph Sutton1-31/+24
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03pytest/samba_tool_drs: Convert bytes to UTF-8 stringJoseph Sutton1-1/+1
We later use this variable as part of a string substitution, and if we leave it as bytes we will end up with b' ' quotes surrounding it, which we do not want. Fix this by converting it to a string. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-23selftest: source4: fix mutable default argumentsRob van der Linde2-4/+17
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-02-23selftest: make two samba-tool drs tests genericRob van der Linde1-11/+24
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15316 Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-02-23selftest: remove unused importRob van der Linde1-1/+0
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-02-23selftest: pep8: too many blank linesRob van der Linde1-1/+0
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-01-31s4-selftest/drs: Confirm GetNCChanges REPL_SECRET works with a DummyDN and ↵Andrew Bartlett2-1/+49
real GUID BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-31s4-selftest/drs: Confirm GetNCChanges full replication works with a DummyDN ↵Andrew Bartlett1-2/+50
and real GUID BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-31s4-selftest/drs: Confirm GetNCChanges REPL_OBJ works with a DummyDN and real ↵Andrew Bartlett1-6/+74
GUID BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-31s4-selftest/drs Allow re-run of DRS tests after failed cleanupAndrew Bartlett1-1/+2
Using a random base is a useful start, even if the better solution also includes a self.AddCleanup() BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-31s4-selftest/drs Allow some DRS tests to operate against an IPAndrew Bartlett4-29/+18
This is not comprehensive, but makes some manual test runs easier by avoiding the need for DNS names to resolve. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-31s4-selftest/drs Add test of expected return code for invaid DNs in GetNCChangesAndrew Bartlett2-3/+83
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10635 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-01-30python: Replace calls to deprecated methodsJoseph Sutton1-23/+23
These aliases are deprecated and have been removed in Python 3.12. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-10-04selftest: Add tests for GetNCChanges GET_ANC using samba-tool drs ↵Andrew Bartlett1-0/+98
clone-dc-database This test, compared with the direct to RPC tests, will succeed, then fail once the server is changed to emulate Samba 4.5 and and again succeed once the python code changes to allow skipping the DRSUAPI_DRS_CRITICAL_ONLY step BUG: https://bugzilla.samba.org/show_bug.cgi?id=15189 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-09-16pytests:s4/drs/getnc_schema: avoid unused importsDouglas Bagnall1-4/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-09-16pytests:s4/drs/repl_move: avoid unused and star importsDouglas Bagnall1-2/+34
Found the names using something like: flake8 repl_move.py | \ grep -oP "(?<=F405 ')[\w.]+" /tmp/repl_move | sort | uniq Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-09-16pytests:s4/drs/repl_rodc: avoid unused importsDouglas Bagnall1-2/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-09-16pytests:s4/drs/linked_attributes_drs: avoid unused importsDouglas Bagnall1-15/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>