From 2e235bda9f7e0aa8bce4846264eecd2e051a6c57 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 5 Nov 2018 19:00:20 +0000 Subject: [PATCH] python/samba/test: PY3 port samba.tests.domain_backup The restoredc already runs under python3, so before we can run the domain_backup tests against the restoredc, we need to make sure they work under python3. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Noel Power Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- python/samba/tests/domain_backup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/samba/tests/domain_backup.py b/python/samba/tests/domain_backup.py index b9e97eb3369..7147f0fdfe4 100644 --- a/python/samba/tests/domain_backup.py +++ b/python/samba/tests/domain_backup.py @@ -271,7 +271,7 @@ class DomainBackupBase(SambaToolCmdTest, TestCaseInTempDir): self.assertEqual(len(bkp_pd), 1) acn = bkp_pd[0].get('samAccountName') self.assertIsNotNone(acn) - self.assertEqual(acn[0].replace('$', ''), self.new_server) + self.assertEqual(str(acn[0]), self.new_server + '$') self.assertIsNotNone(bkp_pd[0].get('secret')) samdb = SamDB(url=paths.samdb, session_info=system_session(), @@ -552,8 +552,9 @@ class DomainBackupRename(DomainBackupBase): self.assertEqual(len(res), 1, "Failed to find renamed link source object") self.assertTrue(link_attr in res[0], "Missing link attribute") - self.assertTrue(new_target_dn in res[0][link_attr]) - self.assertTrue(new_server_dn in res[0][link_attr]) + link_values = [str(x) for x in res[0][link_attr]] + self.assertTrue(new_target_dn in link_values) + self.assertTrue(new_server_dn in link_values) # extra checks we run on the restored DB in the rename case def check_restored_database(self, lp, expect_secrets=True): -- 2.34.1