The Samba-Bugzilla – Attachment 17849 Details for
Bug 15316
Flapping tests in samba_tool_drs_show_repl.py
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch in master backported to Samba 4.18
drs-flapping.patch (text/plain), 55.27 KB, created by
Andrew Bartlett
on 2023-03-29 20:27:33 UTC
(
hide
)
Description:
patch in master backported to Samba 4.18
Filename:
MIME Type:
Creator:
Andrew Bartlett
Created:
2023-03-29 20:27:33 UTC
Size:
55.27 KB
patch
obsolete
>From edc4e7303e60a6e161fc4944384bd9277543b836 Mon Sep 17 00:00:00 2001 >From: Joseph Sutton <josephsutton@catalyst.net.nz> >Date: Thu, 19 Jan 2023 08:37:03 +1300 >Subject: [PATCH 1/3] python: Replace calls to deprecated methods > >These aliases are deprecated and have been removed in Python 3.12. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15343 >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15316 > >Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >(cherry picked from commit 41aa379abb391ffab77238d65ee5ba11b9ab8538) > >[abartlet@samba.org BUG tag added as required patch for bug 15316] >--- > python/samba/tests/audit_log_dsdb.py | 40 ++++++++-------- > python/samba/tests/audit_log_pass_change.py | 28 +++++------ > python/samba/tests/gpo.py | 16 +++---- > python/samba/tests/group_audit.py | 48 +++++++++---------- > python/samba/tests/prefork_restart.py | 18 +++---- > python/samba/tests/samba_tool/computer.py | 6 +-- > python/samba/tests/samba_tool/contact.py | 6 +-- > .../samba_tool/drs_clone_dc_data_lmdb_size.py | 10 ++-- > .../samba/tests/samba_tool/join_lmdb_size.py | 10 ++-- > python/samba/tests/samba_tool/ou.py | 6 +-- > .../tests/samba_tool/passwordsettings.py | 4 +- > .../tests/samba_tool/promote_dc_lmdb_size.py | 10 ++-- > .../tests/samba_tool/provision_lmdb_size.py | 10 ++-- > .../samba_tool/provision_password_check.py | 4 +- > python/samba/tests/upgradeprovisionneeddc.py | 8 ++-- > .../dsdb/tests/python/urgent_replication.py | 20 ++++---- > .../drs/python/samba_tool_drs_showrepl.py | 46 +++++++++--------- > 17 files changed, 145 insertions(+), 145 deletions(-) > >diff --git a/python/samba/tests/audit_log_dsdb.py b/python/samba/tests/audit_log_dsdb.py >index 33884bf5407..82535dcaf2d 100644 >--- a/python/samba/tests/audit_log_dsdb.py >+++ b/python/samba/tests/audit_log_dsdb.py >@@ -144,8 +144,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Modify", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > # We skip the check for self.get_service_description() as this >@@ -185,8 +185,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Modify", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > # We skip the check for self.get_service_description() as this >@@ -227,8 +227,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Modify", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -266,8 +266,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Modify", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -297,8 +297,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Add", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >@@ -343,8 +343,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Delete", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > self.assertEqual(0, audit["statusCode"]) > self.assertEqual("Success", audit["status"]) >@@ -383,8 +383,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Delete", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertEqual(ERR_NO_SUCH_OBJECT, audit["statusCode"]) > self.assertEqual("No such object", audit["status"]) > self.assertTrue(self.is_guid(audit["sessionId"])) >@@ -431,8 +431,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Add", audit["operation"]) > self.assertTrue(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -480,8 +480,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Delete", audit["operation"]) > self.assertTrue(audit["performedAsSystem"]) > self.assertTrue(dn.lower(), audit["dn"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -514,8 +514,8 @@ class AuditLogDsdbTests(AuditLogTestBase): > self.assertEqual("Modify", audit["operation"]) > self.assertFalse(audit["performedAsSystem"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >diff --git a/python/samba/tests/audit_log_pass_change.py b/python/samba/tests/audit_log_pass_change.py >index 7c3e622de99..f7229a670d7 100644 >--- a/python/samba/tests/audit_log_pass_change.py >+++ b/python/samba/tests/audit_log_pass_change.py >@@ -125,8 +125,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_CHANGE, audit["eventId"]) > self.assertEqual("Change", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >@@ -154,8 +154,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_RESET, audit["eventId"]) > self.assertEqual("Reset", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >@@ -195,8 +195,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_RESET, audit["eventId"]) > self.assertEqual("Reset", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >@@ -232,8 +232,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_RESET, audit["eventId"]) > self.assertEqual("Reset", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >@@ -266,8 +266,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_CHANGE, audit["eventId"]) > self.assertEqual("Change", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -297,8 +297,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_RESET, audit["eventId"]) > self.assertEqual("Reset", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -324,8 +324,8 @@ class AuditLogPassChangeTests(AuditLogTestBase): > self.assertEqual(EVT_ID_PASSWORD_RESET, audit["eventId"]) > self.assertEqual("Reset", audit["action"]) > self.assertEqual(dn, audit["dn"]) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) > service_description = self.get_service_description() >diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py >index 91a97e05898..b9ded20c828 100644 >--- a/python/samba/tests/gpo.py >+++ b/python/samba/tests/gpo.py >@@ -6341,8 +6341,8 @@ class GPOTests(tests.TestCase): > gp_db = store.get_gplog(machine_creds.get_username()) > del_gpos = get_deleted_gpos_list(gp_db, []) > ext.process_group_policy(del_gpos, [], f.name) >- self.assertNotEquals(open(f.name, 'r').read(), text.text, >- 'The motd was not unapplied') >+ self.assertNotEqual(open(f.name, 'r').read(), text.text, >+ 'The motd was not unapplied') > > # Unstage the Registry.pol file > unstage_file(manifest) >@@ -6394,8 +6394,8 @@ class GPOTests(tests.TestCase): > gp_db = store.get_gplog(machine_creds.get_username()) > del_gpos = get_deleted_gpos_list(gp_db, []) > ext.process_group_policy(del_gpos, [], f.name) >- self.assertNotEquals(open(f.name, 'r').read(), text.text, >- 'The issue was not unapplied') >+ self.assertNotEqual(open(f.name, 'r').read(), text.text, >+ 'The issue was not unapplied') > > # Unstage the manifest.xml file > unstage_file(manifest) >@@ -7066,16 +7066,16 @@ class GPOTests(tests.TestCase): > 'Number of Chromium policies is incorrect') > omanaged_file = managed_file > managed_file = os.path.join(managed, managed_files[0]) >- self.assertNotEquals(omanaged_file, managed_file, >- 'The managed Chromium file did not change') >+ self.assertNotEqual(omanaged_file, managed_file, >+ 'The managed Chromium file did not change') > > recommended_files = os.listdir(recommended) > self.assertEquals(len(recommended_files), 1, > 'Number of Chromium policies is incorrect') > orecommended_file = recommended_file > recommended_file = os.path.join(recommended, recommended_files[0]) >- self.assertNotEquals(orecommended_file, recommended_file, >- 'The recommended Chromium file did not change') >+ self.assertNotEqual(orecommended_file, recommended_file, >+ 'The recommended Chromium file did not change') > > # Verify RSOP does not fail > ext.rsop([g for g in gpos if g.name == guid][0]) >diff --git a/python/samba/tests/group_audit.py b/python/samba/tests/group_audit.py >index a032a8ecd70..12efef2c046 100644 >--- a/python/samba/tests/group_audit.py >+++ b/python/samba/tests/group_audit.py >@@ -113,8 +113,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=domain users,cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -129,8 +129,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=domain users,cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -154,8 +154,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -180,8 +180,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_02 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -208,8 +208,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -234,8 +234,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -261,8 +261,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=domain users,cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -277,8 +277,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=domain users,cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -304,8 +304,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -352,8 +352,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -369,8 +369,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=domain users,cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >@@ -386,8 +386,8 @@ class GroupAuditTests(AuditLogTestBase): > group_dn = "cn=" + GROUP_NAME_01 + ",cn=users," + self.base_dn > self.assertTrue(user_dn.lower(), audit["user"].lower()) > self.assertTrue(group_dn.lower(), audit["group"].lower()) >- self.assertRegexpMatches(audit["remoteAddress"], >- self.remoteAddress) >+ self.assertRegex(audit["remoteAddress"], >+ self.remoteAddress) > self.assertTrue(self.is_guid(audit["sessionId"])) > session_id = self.get_session() > self.assertEqual(session_id, audit["sessionId"]) >diff --git a/python/samba/tests/prefork_restart.py b/python/samba/tests/prefork_restart.py >index 7d762196b58..9e35bd68a17 100644 >--- a/python/samba/tests/prefork_restart.py >+++ b/python/samba/tests/prefork_restart.py >@@ -190,12 +190,12 @@ class PreforkProcessRestartTests(TestCase): > self.assertIsNotNone(new_pid) > > # check that the pid has changed >- self.assertNotEquals(pid, new_pid) >+ self.assertNotEqual(pid, new_pid) > > # check that the worker processes have restarted > new_workers = self.get_worker_pids("ldap", NUM_WORKERS) > for x in range(NUM_WORKERS): >- self.assertNotEquals(workers[x], new_workers[x]) >+ self.assertNotEqual(workers[x], new_workers[x]) > > # check that the previous server entries have been removed. > self.check_for_duplicate_processes() >@@ -230,7 +230,7 @@ class PreforkProcessRestartTests(TestCase): > # check that the worker processes have restarted > new_workers = self.get_worker_pids("ldap", NUM_WORKERS) > # process 0 should have a new pid the others should be unchanged >- self.assertNotEquals(workers[0], new_workers[0]) >+ self.assertNotEqual(workers[0], new_workers[0]) > self.assertEqual(workers[1], new_workers[1]) > self.assertEqual(workers[2], new_workers[2]) > self.assertEqual(workers[3], new_workers[3]) >@@ -273,7 +273,7 @@ class PreforkProcessRestartTests(TestCase): > # check that the worker processes have restarted > new_workers = self.get_worker_pids("ldap", NUM_WORKERS) > for x in range(NUM_WORKERS): >- self.assertNotEquals(workers[x], new_workers[x]) >+ self.assertNotEqual(workers[x], new_workers[x]) > > # check that the previous server entries have been removed. > self.check_for_duplicate_processes() >@@ -306,12 +306,12 @@ class PreforkProcessRestartTests(TestCase): > self.assertIsNotNone(new_pid) > > # check that the pid has changed >- self.assertNotEquals(pid, new_pid) >+ self.assertNotEqual(pid, new_pid) > > # check that the worker processes have restarted > new_workers = self.get_worker_pids("rpc", NUM_WORKERS) > for x in range(NUM_WORKERS): >- self.assertNotEquals(workers[x], new_workers[x]) >+ self.assertNotEqual(workers[x], new_workers[x]) > > # check that the previous server entries have been removed. > self.check_for_duplicate_processes() >@@ -347,7 +347,7 @@ class PreforkProcessRestartTests(TestCase): > # check that the worker processes have restarted > new_workers = self.get_worker_pids("rpc", NUM_WORKERS) > # process 0 should have a new pid the others should be unchanged >- self.assertNotEquals(workers[0], new_workers[0]) >+ self.assertNotEqual(workers[0], new_workers[0]) > self.assertEqual(workers[1], new_workers[1]) > self.assertEqual(workers[2], new_workers[2]) > self.assertEqual(workers[3], new_workers[3]) >@@ -390,7 +390,7 @@ class PreforkProcessRestartTests(TestCase): > # check that the worker processes have restarted > new_workers = self.get_worker_pids("rpc", NUM_WORKERS) > for x in range(NUM_WORKERS): >- self.assertNotEquals(workers[x], new_workers[x]) >+ self.assertNotEqual(workers[x], new_workers[x]) > > # check that the previous server entries have been removed. > self.check_for_duplicate_processes() >@@ -434,7 +434,7 @@ class PreforkProcessRestartTests(TestCase): > # check that the worker processes have restarted > new_workers = self.get_worker_pids("echo", NUM_WORKERS) > for x in range(NUM_WORKERS): >- self.assertNotEquals(workers[x], new_workers[x]) >+ self.assertNotEqual(workers[x], new_workers[x]) > > # check that the previous server entries have been removed. > self.check_for_duplicate_processes() >diff --git a/python/samba/tests/samba_tool/computer.py b/python/samba/tests/samba_tool/computer.py >index a1f29993d01..231f369c52b 100644 >--- a/python/samba/tests/samba_tool/computer.py >+++ b/python/samba/tests/samba_tool/computer.py >@@ -253,9 +253,9 @@ class ComputerCmdTestCase(SambaToolCmdTest): > self.assertIn('Moved computer "%s"' % computer["name"], out) > > found = self._find_computer(computer["name"]) >- self.assertNotEquals(found.get("dn"), olddn, >- ("Moved computer '%s' still exists with the " >- "same dn" % computer["name"])) >+ self.assertNotEqual(found.get("dn"), olddn, >+ ("Moved computer '%s' still exists with the " >+ "same dn" % computer["name"])) > computername = computer["name"].rstrip('$') > newexpecteddn = ldb.Dn(self.samdb, > "CN=%s,OU=%s,%s" % >diff --git a/python/samba/tests/samba_tool/contact.py b/python/samba/tests/samba_tool/contact.py >index 65f1a6857c9..b499a38f812 100644 >--- a/python/samba/tests/samba_tool/contact.py >+++ b/python/samba/tests/samba_tool/contact.py >@@ -241,9 +241,9 @@ class ContactCmdTestCase(SambaToolCmdTest): > self.assertIn('Moved contact "%s"' % contact["expectedname"], out) > > found = self._find_contact(contact["expectedname"]) >- self.assertNotEquals(found.get("dn"), olddn, >- ("Moved contact '%s' still exists with the " >- "same dn" % contact["expectedname"])) >+ self.assertNotEqual(found.get("dn"), olddn, >+ ("Moved contact '%s' still exists with the " >+ "same dn" % contact["expectedname"])) > contactname = contact["expectedname"] > newexpecteddn = ldb.Dn(self.samdb, > "CN=%s,OU=%s,%s" % >diff --git a/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py b/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py >index 71521b6a07f..ff7cdb774cb 100644 >--- a/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py >+++ b/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py >@@ -95,21 +95,21 @@ class DrsCloneDcDataLmdbSizeTestCase(SambaToolCmdTest): > (result, out, err) = self.run_command( > 'samba-tool drs clone-dc-database --backend-store-size "2"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix ''") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix ''") > > def test_invalid_unit_suffix(self): > (result, out, err) = self.run_command( > 'samba-tool drs clone-dc-database --backend-store-size "2 cd"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix 'cd'") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix 'cd'") > > def test_non_numeric(self): > (result, out, err) = self.run_command( > 'samba-tool drs clone-dc-database --backend-store-size "two Gb"') > self.assertGreater(result, 0) >- self.assertRegexpMatches( >+ self.assertRegex( > err, > r"backend-store-size option requires a numeric value, with an" > " optional unit suffix") >diff --git a/python/samba/tests/samba_tool/join_lmdb_size.py b/python/samba/tests/samba_tool/join_lmdb_size.py >index 8f2e376bc05..db166690bd9 100644 >--- a/python/samba/tests/samba_tool/join_lmdb_size.py >+++ b/python/samba/tests/samba_tool/join_lmdb_size.py >@@ -128,21 +128,21 @@ class JoinLmdbSizeTestCase(SambaToolCmdTest): > (result, out, err) = self.run_command( > 'samba-tool domain join --backend-store-size "2"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix ''") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix ''") > > def test_invalid_unit_suffix(self): > (result, out, err) = self.run_command( > 'samba-tool domain join --backend-store-size "2 cd"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix 'cd'") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix 'cd'") > > def test_non_numeric(self): > (result, out, err) = self.run_command( > 'samba-tool domain join --backend-store-size "two Gb"') > self.assertGreater(result, 0) >- self.assertRegexpMatches( >+ self.assertRegex( > err, > r"backend-store-size option requires a numeric value, with an" > " optional unit suffix") >diff --git a/python/samba/tests/samba_tool/ou.py b/python/samba/tests/samba_tool/ou.py >index 3cc50b799bd..af678b53f9b 100644 >--- a/python/samba/tests/samba_tool/ou.py >+++ b/python/samba/tests/samba_tool/ou.py >@@ -204,9 +204,9 @@ class OUCmdTestCase(SambaToolCmdTest): > self.assertIn('Moved ou "%s"' % full_ou_dn, out) > > found = self._find_ou(ou["name"]) >- self.assertNotEquals(found.get("dn"), olddn, >- "Moved ou '%s' still exists with the same dn" % >- ou["name"]) >+ self.assertNotEqual(found.get("dn"), olddn, >+ "Moved ou '%s' still exists with the same dn" % >+ ou["name"]) > newexpecteddn = ldb.Dn(self.samdb, > "OU=%s,OU=%s,%s" % > (ou["name"], parentou["name"], >diff --git a/python/samba/tests/samba_tool/passwordsettings.py b/python/samba/tests/samba_tool/passwordsettings.py >index 4d83d346717..f2d7a6e6a79 100644 >--- a/python/samba/tests/samba_tool/passwordsettings.py >+++ b/python/samba/tests/samba_tool/passwordsettings.py >@@ -459,7 +459,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest): > self.assertCmdSuccess(result, out, err) > self.assertEqual(err, "", "Shouldn't be any error messages") > self.assertIn("successful", out) >- self.assertNotEquals(max_pwd_age, self.ldb.get_maxPwdAge()) >+ self.assertNotEqual(max_pwd_age, self.ldb.get_maxPwdAge()) > > # check we can't set the domain min password age to more than the max > min_pwd_age = self.ldb.get_minPwdAge() >@@ -481,4 +481,4 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest): > self.assertCmdSuccess(result, out, err) > self.assertEqual(err, "", "Shouldn't be any error messages") > self.assertIn("successful", out) >- self.assertNotEquals(min_pwd_age, self.ldb.get_minPwdAge()) >+ self.assertNotEqual(min_pwd_age, self.ldb.get_minPwdAge()) >diff --git a/python/samba/tests/samba_tool/promote_dc_lmdb_size.py b/python/samba/tests/samba_tool/promote_dc_lmdb_size.py >index 56fcdcf72f0..ba1086f291e 100644 >--- a/python/samba/tests/samba_tool/promote_dc_lmdb_size.py >+++ b/python/samba/tests/samba_tool/promote_dc_lmdb_size.py >@@ -150,21 +150,21 @@ class PromoteDcLmdbSizeTestCase(SambaToolCmdTest): > (result, out, err) = self.run_command( > 'samba-tool domain dcpromo --backend-store-size "2"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix ''") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix ''") > > def test_invalid_unit_suffix(self): > (result, out, err) = self.run_command( > 'samba-tool domain dcpromo --backend-store-size "2 cd"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix 'cd'") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix 'cd'") > > def test_non_numeric(self): > (result, out, err) = self.run_command( > 'samba-tool domain dcpromo --backend-store-size "two Gb"') > self.assertGreater(result, 0) >- self.assertRegexpMatches( >+ self.assertRegex( > err, > r"backend-store-size option requires a numeric value, with an" > " optional unit suffix") >diff --git a/python/samba/tests/samba_tool/provision_lmdb_size.py b/python/samba/tests/samba_tool/provision_lmdb_size.py >index 970486622df..6b0d2b74117 100644 >--- a/python/samba/tests/samba_tool/provision_lmdb_size.py >+++ b/python/samba/tests/samba_tool/provision_lmdb_size.py >@@ -108,21 +108,21 @@ class ProvisionLmdbSizeTestCase(SambaToolCmdTest): > (result, out, err) = self.run_command( > 'samba-tool domain provision --backend-store-size "2"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix ''") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix ''") > > def test_invalid_unit_suffix(self): > (result, out, err) = self.run_command( > 'samba-tool domain provision --backend-store-size "2 cd"') > self.assertGreater(result, 0) >- self.assertRegexpMatches(err, >- r"--backend-store-size invalid suffix 'cd'") >+ self.assertRegex(err, >+ r"--backend-store-size invalid suffix 'cd'") > > def test_non_numeric(self): > (result, out, err) = self.run_command( > 'samba-tool domain provision --backend-store-size "two Gb"') > self.assertGreater(result, 0) >- self.assertRegexpMatches( >+ self.assertRegex( > err, > r"backend-store-size option requires a numeric value, with an" > " optional unit suffix") >diff --git a/python/samba/tests/samba_tool/provision_password_check.py b/python/samba/tests/samba_tool/provision_password_check.py >index a8fb8578ecc..83304292568 100644 >--- a/python/samba/tests/samba_tool/provision_password_check.py >+++ b/python/samba/tests/samba_tool/provision_password_check.py >@@ -41,12 +41,12 @@ class ProvisionPasswordTestCase(SambaToolCmdTest): > def test_short(self): > (result, out, err) = self._provision_with_password("Fo0!_9") > self.assertCmdFail(result) >- self.assertRegexpMatches(err, r"minimum password length") >+ self.assertRegex(err, r"minimum password length") > > def test_low_quality(self): > (result, out, err) = self._provision_with_password("aaaaaaaaaaaaaaaaa") > self.assertCmdFail(result) >- self.assertRegexpMatches(err, r"quality standards") >+ self.assertRegex(err, r"quality standards") > > def test_good(self): > (result, out, err) = self._provision_with_password("Fo0!_9.") >diff --git a/python/samba/tests/upgradeprovisionneeddc.py b/python/samba/tests/upgradeprovisionneeddc.py >index 45a29da0d17..d3f7b19dfd9 100644 >--- a/python/samba/tests/upgradeprovisionneeddc.py >+++ b/python/samba/tests/upgradeprovisionneeddc.py >@@ -66,8 +66,8 @@ class UpgradeProvisionBasicLdbHelpersTestCase(TestCaseInTempDir): > paths, smb_conf_path, lp) > self.assertEqual(names.realm, "SAMBA.EXAMPLE.COM") > self.assertEqual(str(names.rootdn).lower(), rootdn.lower()) >- self.assertNotEquals(names.policyid_dc, None) >- self.assertNotEquals(names.ntdsguid, "") >+ self.assertNotEqual(names.policyid_dc, None) >+ self.assertNotEqual(names.ntdsguid, "") > > > class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir): >@@ -158,7 +158,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir): > realm = self.lp.get("realm") > basedn = "DC=%s" % realm.replace(".", ", DC=") > oem = getOEMInfo(self.ldbs.sam, basedn) >- self.assertNotEquals(oem, "") >+ self.assertNotEqual(oem, "") > > def test_update_dns_account(self): > update_dns_account_password(self.ldbs.sam, self.ldbs.secrets, >@@ -170,7 +170,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir): > oem = getOEMInfo(self.ldbs.sam, basedn) > updateOEMInfo(self.ldbs.sam, basedn) > oem2 = getOEMInfo(self.ldbs.sam, basedn) >- self.assertNotEquals(str(oem), str(oem2)) >+ self.assertNotEqual(str(oem), str(oem2)) > self.assertTrue(re.match(".*upgrade to.*", str(oem2))) > > def tearDown(self): >diff --git a/source4/dsdb/tests/python/urgent_replication.py b/source4/dsdb/tests/python/urgent_replication.py >index 485b1fd8df5..0d39c38e403 100755 >--- a/source4/dsdb/tests/python/urgent_replication.py >+++ b/source4/dsdb/tests/python/urgent_replication.py >@@ -59,7 +59,7 @@ class UrgentReplicationTests(samba.tests.TestCase): > > # urgent replication should not be enabled when creating > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should not be enabled when modifying > m = Message() >@@ -68,12 +68,12 @@ class UrgentReplicationTests(samba.tests.TestCase): > "description") > self.ldb.modify(m) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should not be enabled when deleting > self.delete_force(self.ldb, "cn=nonurgenttest,cn=users," + self.base_dn) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > def test_nTDSDSA_object(self): > """Test if the urgent replication is activated when handling a nTDSDSA object.""" >@@ -104,7 +104,7 @@ systemFlags: 33554432""", ["relax:0"]) > "options") > self.ldb.modify(m) > res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should be enabled when deleting > self.delete_force(self.ldb, "cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn) >@@ -137,7 +137,7 @@ systemFlags: 33554432""", ["relax:0"]) > "systemFlags") > self.ldb.modify(m) > res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should be enabled when deleting > self.delete_force(self.ldb, "cn=test crossRef,CN=Partitions,CN=Configuration," + self.base_dn) >@@ -244,7 +244,7 @@ defaultHidingValue: TRUE""") > # urgent replication should NOT be enabled when deleting > self.delete_force(self.ldb, "cn=test secret,cn=System," + self.base_dn) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > def test_rIDManager_object(self): > """Test if the urgent replication is activated when handling a rIDManager object.""" >@@ -275,7 +275,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"]) > # urgent replication should NOT be enabled when deleting > self.delete_force(self.ldb, "CN=RID Manager test,CN=System," + self.base_dn) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > def test_urgent_attributes(self): > """Test if the urgent replication is activated when handling urgent attributes of an object.""" >@@ -291,7 +291,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"]) > > # urgent replication should NOT be enabled when creating > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should be enabled when modifying userAccountControl > m = Message() >@@ -328,12 +328,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"]) > FLAG_MOD_REPLACE, "description") > self.ldb.modify(m) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > # urgent replication should NOT be enabled when deleting > self.delete_force(self.ldb, "cn=user UrgAttr test,cn=users," + self.base_dn) > res = self.ldb.load_partition_usn(self.base_dn) >- self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]) >+ self.assertNotEqual(res["uSNHighest"], res["uSNUrgent"]) > > > TestProgram(module=__name__, opts=subunitopts) >diff --git a/source4/torture/drs/python/samba_tool_drs_showrepl.py b/source4/torture/drs/python/samba_tool_drs_showrepl.py >index 8ed1fa0fcc7..de7f89336e3 100644 >--- a/source4/torture/drs/python/samba_tool_drs_showrepl.py >+++ b/source4/torture/drs/python/samba_tool_drs_showrepl.py >@@ -78,12 +78,12 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > self.assertEqual(_outbound, ' OUTBOUND NEIGHBORS ') > self.assertEqual(_conn, ' KCC CONNECTION OBJECTS ') > >- self.assertRegexpMatches(header, >- r'^Default-First-Site-Name\\LOCALDC\s+' >- r"DSA Options: %s\s+" >- r"DSA object GUID: %s\s+" >- r"DSA invocationId: %s" % >- (HEX8_RE, GUID_RE, GUID_RE)) >+ self.assertRegex(header, >+ r'^Default-First-Site-Name\\LOCALDC\s+' >+ r"DSA Options: %s\s+" >+ r"DSA object GUID: %s\s+" >+ r"DSA invocationId: %s" % >+ (HEX8_RE, GUID_RE, GUID_RE)) > > # We don't assert the DomainDnsZones and ForestDnsZones are > # there because we don't know that they have been set up yet. >@@ -91,7 +91,7 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > for p in ['CN=Configuration,DC=samba,DC=example,DC=com', > 'DC=samba,DC=example,DC=com', > 'CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com']: >- self.assertRegexpMatches( >+ self.assertRegex( > inbound, > r'%s\n' > r'\tDefault-First-Site-Name\\[A-Z]+ via RPC\n' >@@ -102,7 +102,7 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > r'\n' % (p, GUID_RE), > msg="%s inbound missing" % p) > >- self.assertRegexpMatches( >+ self.assertRegex( > outbound, > r'%s\n' > r'\tDefault-First-Site-Name\\[A-Z]+ via RPC\n' >@@ -113,13 +113,13 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > r'\n' % (p, GUID_RE), > msg="%s outbound missing" % p) > >- self.assertRegexpMatches(conn, >- r'Connection --\n' >- r'\tConnection name: %s\n' >- r'\tEnabled : TRUE\n' >- r'\tServer DNS name : \w+.samba.example.com\n' >- r'\tServer DN name : %s' >- r'\n' % (GUID_RE, DN_RE)) >+ self.assertRegex(conn, >+ r'Connection --\n' >+ r'\tConnection name: %s\n' >+ r'\tEnabled : TRUE\n' >+ r'\tServer DNS name : \w+.samba.example.com\n' >+ r'\tServer DN name : %s' >+ r'\n' % (GUID_RE, DN_RE)) > > def test_samba_tool_showrepl_json(self): > """Tests 'samba-tool drs showrepl --json' command. >@@ -134,30 +134,30 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > > # dsa > for k in ["objectGUID", "invocationId"]: >- self.assertRegexpMatches(d['dsa'][k], '^%s$' % GUID_RE) >+ self.assertRegex(d['dsa'][k], '^%s$' % GUID_RE) > self.assertTrue(isinstance(d['dsa']["options"], int)) > > # repsfrom and repsto > for reps in (d['repsFrom'], d['repsTo']): > for r in reps: > for k in ('NC dn', "NTDS DN"): >- self.assertRegexpMatches(r[k], '^%s$' % DN_RE) >+ self.assertRegex(r[k], '^%s$' % DN_RE) > for k in ("last attempt time", > "last attempt message", > "last success"): > self.assertTrue(isinstance(r[k], str)) >- self.assertRegexpMatches(r["DSA objectGUID"], '^%s$' % GUID_RE) >+ self.assertRegex(r["DSA objectGUID"], '^%s$' % GUID_RE) > self.assertTrue(isinstance(r["consecutive failures"], int)) > > # ntdsconnection > for n in d["NTDSConnections"]: >- self.assertRegexpMatches(n["dns name"], >- r'^[\w]+\.samba\.example\.com$') >- self.assertRegexpMatches(n["name"], "^%s$" % GUID_RE) >+ self.assertRegex(n["dns name"], >+ r'^[\w]+\.samba\.example\.com$') >+ self.assertRegex(n["name"], "^%s$" % GUID_RE) > self.assertTrue(isinstance(n['enabled'], bool)) > self.assertTrue(isinstance(n['options'], int)) > self.assertTrue(isinstance(n['replicates NC'], list)) >- self.assertRegexpMatches(n["remote DN"], "^%s$" % DN_RE) >+ self.assertRegex(n["remote DN"], "^%s$" % DN_RE) > > def _force_all_reps(self, samdb, dc, direction): > if direction == 'inbound': >@@ -354,7 +354,7 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > e.returncode, > e.msg, > e.cmd)) >- self.assertRegexpMatches( >+ self.assertRegex( > e_stdout, > r'result 845[67] ' > r'\(WERR_DS_DRA_(SINK|SOURCE)_DISABLED\)', >-- >2.25.1 > > >From 53173e795c2a919068f54e9de56014dc98bc7e90 Mon Sep 17 00:00:00 2001 >From: Rob van der Linde <rob@catalyst.net.nz> >Date: Thu, 23 Feb 2023 16:56:07 +1300 >Subject: [PATCH 2/3] selftest: make two samba-tool drs tests generic > >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> >(cherry picked from commit 1368e359b2a75b6b683aff274b2b2084f3cd469b) >--- > .../drs/python/samba_tool_drs_showrepl.py | 35 +++++++++++++------ > 1 file changed, 24 insertions(+), 11 deletions(-) > >diff --git a/source4/torture/drs/python/samba_tool_drs_showrepl.py b/source4/torture/drs/python/samba_tool_drs_showrepl.py >index de7f89336e3..bba840ce379 100644 >--- a/source4/torture/drs/python/samba_tool_drs_showrepl.py >+++ b/source4/torture/drs/python/samba_tool_drs_showrepl.py >@@ -50,6 +50,21 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > def test_samba_tool_showrepl(self): > """Tests 'samba-tool drs showrepl' command. > """ >+ nc_list = [self.config_dn, self.domain_dn, self.schema_dn] >+ dns_name = self.ldb_dc1.domain_dns_name() >+ >+ # Manually run kcc to create a "Connection" object, so we can find >+ # this for the expected output below. >+ kcc_out = self.check_output("samba-tool drs kcc %s %s" % (self.dc1, >+ self.cmdline_creds)) >+ self.assertIn(b"successful", kcc_out) >+ >+ # Run replicate to ensure there are incoming and outgoing partners >+ # exist, so we can expect these in the output below. >+ for nc in nc_list: >+ self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=nc, forced=True) >+ self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, nc_dn=nc, forced=True) >+ > # Output should be like: > # <site-name>/<domain-name> > # DSA Options: <hex-options> >@@ -79,22 +94,20 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > self.assertEqual(_conn, ' KCC CONNECTION OBJECTS ') > > self.assertRegex(header, >- r'^Default-First-Site-Name\\LOCALDC\s+' >+ r'^Default-First-Site-Name\\%s\s+' > r"DSA Options: %s\s+" > r"DSA object GUID: %s\s+" > r"DSA invocationId: %s" % >- (HEX8_RE, GUID_RE, GUID_RE)) >+ (self.dc1.upper(), HEX8_RE, GUID_RE, GUID_RE)) > > # We don't assert the DomainDnsZones and ForestDnsZones are > # there because we don't know that they have been set up yet. > >- for p in ['CN=Configuration,DC=samba,DC=example,DC=com', >- 'DC=samba,DC=example,DC=com', >- 'CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com']: >+ for p in nc_list: > self.assertRegex( > inbound, > r'%s\n' >- r'\tDefault-First-Site-Name\\[A-Z]+ via RPC\n' >+ r'\tDefault-First-Site-Name\\[A-Z0-9]+ via RPC\n' > r'\t\tDSA object GUID: %s\n' > r'\t\tLast attempt @ [^\n]+\n' > r'\t\t\d+ consecutive failure\(s\).\n' >@@ -105,7 +118,7 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > self.assertRegex( > outbound, > r'%s\n' >- r'\tDefault-First-Site-Name\\[A-Z]+ via RPC\n' >+ r'\tDefault-First-Site-Name\\[A-Z0-9]+ via RPC\n' > r'\t\tDSA object GUID: %s\n' > r'\t\tLast attempt @ [^\n]+\n' > r'\t\t\d+ consecutive failure\(s\).\n' >@@ -117,13 +130,14 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > r'Connection --\n' > r'\tConnection name: %s\n' > r'\tEnabled : TRUE\n' >- r'\tServer DNS name : \w+.samba.example.com\n' >+ r'\tServer DNS name : \w+.%s\n' > r'\tServer DN name : %s' >- r'\n' % (GUID_RE, DN_RE)) >+ r'\n' % (GUID_RE, dns_name, DN_RE)) > > def test_samba_tool_showrepl_json(self): > """Tests 'samba-tool drs showrepl --json' command. > """ >+ dns_name = self.ldb_dc1.domain_dns_name() > out = self.check_output("samba-tool drs showrepl %s %s --json" % > (self.dc1, self.cmdline_creds)) > d = json.loads(get_string(out)) >@@ -151,8 +165,7 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): > > # ntdsconnection > for n in d["NTDSConnections"]: >- self.assertRegex(n["dns name"], >- r'^[\w]+\.samba\.example\.com$') >+ self.assertTrue(n["dns name"].endswith(dns_name)) > self.assertRegex(n["name"], "^%s$" % GUID_RE) > self.assertTrue(isinstance(n['enabled'], bool)) > self.assertTrue(isinstance(n['options'], int)) >-- >2.25.1 > > >From 11e6c92cf00a8fcaa6a285f1a99c8c2fc2c62890 Mon Sep 17 00:00:00 2001 >From: Rob van der Linde <rob@catalyst.net.nz> >Date: Thu, 23 Feb 2023 16:56:30 +1300 >Subject: [PATCH 3/3] selftest: fix flapping samba-tool drs showrepl test > >Test should have been using "schema_pair_dc", it was picking this up from the variable env in the loop above it. > >However, it was hardcoded to use promoted_dc. > >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> >(cherry picked from commit 3687ab318a9553883d8c0d1214e2d49b83ec91ba) >--- > source4/selftest/tests.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py >index 774b874edbd..ea052c48bbb 100755 >--- a/source4/selftest/tests.py >+++ b/source4/selftest/tests.py >@@ -1552,7 +1552,8 @@ planoldpythontestsuite(env, "getnc_schema", > # not the set of environments connected with ad_dc. > > # This will show the replication state of ad_dc >-planoldpythontestsuite("promoted_dc:local", "samba_tool_drs_showrepl", >+env = "schema_pair_dc" >+planoldpythontestsuite("%s:local" % env, "samba_tool_drs_showrepl", > extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')], > name="samba4.drs.samba_tool_drs_showrepl.python(%s)" % env, > environ={'DC1': '$DC_SERVER', 'DC2': '$SERVER'}, >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
dbagnall
:
review+
abartlet
:
ci-passed+
Actions:
View
Attachments on
bug 15316
: 17849