From: Noel Power Date: Fri, 15 Jun 2018 14:55:15 +0000 (+0100) Subject: s4/torture/drs: py2/py3 compat porting for samba4.drs.link_conflicts X-Git-Tag: tdb-1.3.17~1577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71900d92bb167399367a1d49e6d357f6026587e5;p=thirdparty%2Fsamba.git s4/torture/drs: py2/py3 compat porting for samba4.drs.link_conflicts Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/source4/torture/drs/python/link_conflicts.py b/source4/torture/drs/python/link_conflicts.py index 7c333ce5bc4..3b48a880e0c 100644 --- a/source4/torture/drs/python/link_conflicts.py +++ b/source4/torture/drs/python/link_conflicts.py @@ -210,7 +210,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): # attribute and it matches on both DCs self.assert_attrs_match(res1, res2, "managedBy", 1) - self.assertTrue(res1[0]["managedBy"][0] == target2_ou, + self.assertTrue(str(res1[0]["managedBy"][0]) == target2_ou, "Expected most recent update to win conflict") # we can't query the deleted links over LDAP, but we can check DRS @@ -301,8 +301,9 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): # we expect exactly 2 members in our test group (both DCs should agree) self.assert_attrs_match(res1, res2, "member", 2) - for val in res1[0]["member"]: + for val in [str(val) for val in res1[0]["member"]]: # check the expected conflicting object was renamed + #val = str(val) self.assertFalse("CNF:%s" % target2_guid in val) if "CNF:%s" % target1_guid in val: target1_conflict = True @@ -387,8 +388,9 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): # DCs agree) self.assert_attrs_match(res1, res2, "memberOf", 2) - for val in res1[0]["memberOf"]: + for val in [str(val) for val in res1[0]["memberOf"]]: # check the conflicting object was renamed + #val = str(val) self.assertFalse("CNF:%s" % src2_guid in val) if "CNF:%s" % src1_guid in val: src1_backlink = True @@ -606,7 +608,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): # trump DC1's active link self.assert_attrs_match(res1, res2, "managedBy", 1) - self.assertTrue(res1[0]["managedBy"][0] == target2_ou, + self.assertTrue(str(res1[0]["managedBy"][0]) == target2_ou, "Expected active link win conflict") # we can't query the deleted links over LDAP, but we can check that @@ -661,7 +663,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): # attribute and it matches on both DCs self.assert_attrs_match(res1, res2, "managedBy", 1) - self.assertTrue(res1[0]["managedBy"][0] == target1_ou, + self.assertTrue(str(res1[0]["managedBy"][0]) == target1_ou, "Expected most recent update to win conflict") # we can't query the deleted links over LDAP, but we can check DRS @@ -718,7 +720,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase): self.assert_attrs_match(res1, res2, "managedBy", 1) # here we expect DC2 to win because it has the more recent link - self.assertTrue(res1[0]["managedBy"][0] == target2_ou, + self.assertTrue(str(res1[0]["managedBy"][0]) == target2_ou, "Expected most recent update to win conflict") # we can't query the deleted links over LDAP, but we can check DRS