s4/torture/drs: convert print func to be py2/py3 compatible
authorNoel Power <noel.power@suse.com>
Fri, 9 Mar 2018 14:02:18 +0000 (14:02 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Mar 2018 06:28:24 +0000 (07:28 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/drs/python/delete_object.py
source4/torture/drs/python/drs_base.py
source4/torture/drs/python/fsmo.py
source4/torture/drs/python/getncchanges.py
source4/torture/drs/python/repl_move.py
source4/torture/drs/python/replica_sync.py

index 620a44659e71526aa66690b09f1d9d0942c2a449..d37e7044384b3e4fb8e165956bcab749f1f01a0b 100644 (file)
@@ -26,6 +26,7 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN delete_object -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
+from __future__ import print_function
 import time
 
 
@@ -121,7 +122,7 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -277,7 +278,7 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
index 66a0d8d6d7725dd371181ddbbd66bb868320467c..a6a2439c457f4e92dde87ab041387ec060482300 100644 (file)
@@ -20,6 +20,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+from __future__ import print_function
 import sys
 import time
 import os
@@ -511,19 +512,19 @@ class AbstractLink:
         """See CompareLinks() in MS-DRSR section 4.1.10.5.17"""
         if not isinstance(other, AbstractLink):
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other)
+                print("AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other))
             return NotImplemented
 
         c = cmp(self.selfGUID_blob, other.selfGUID_blob)
         if c != 0:
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c)
+                print("AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c))
             return c
 
         c = other.attid - self.attid
         if c != 0:
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => %d different attid" % (self, other, c)
+                print("AbstractLink.__internal_cmp__(%r, %r) => %d different attid" % (self, other, c))
             return c
 
         self_active = self.flags & drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE
@@ -532,19 +533,19 @@ class AbstractLink:
         c = self_active - other_active
         if c != 0:
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c)
+                print("AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c))
             return c
 
         c = cmp(self.targetGUID_blob, other.targetGUID_blob)
         if c != 0:
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c)
+                print("AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c))
             return c
 
         c = self.flags - other.flags
         if c != 0:
             if verbose:
-                print "AbstractLink.__internal_cmp__(%r, %r) => %d different flags" % (self, other, c)
+                print("AbstractLink.__internal_cmp__(%r, %r) => %d different flags" % (self, other, c))
             return c
 
         return 0
index 50b7dc3b2c4d21077b75e77ba8e500708e203530..6be55f8b70c813f9b11ad286db3c51270d37f57e 100644 (file)
@@ -25,6 +25,7 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN fsmo -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
+from __future__ import print_function
 import sys
 import time
 import os
@@ -98,7 +99,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
         """Triggers transfer of role from DC1 to DC2
            and vice versa so the role goes back to the original dc"""
         # dc2 gets the role from dc1
-        print "Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc1, self.dnsname_dc2)
+        print("Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc1, self.dnsname_dc2))
 
         self._net_fsmo_role_transfer(DC=self.dnsname_dc2, role=role)
         # check if the role is transfered
@@ -109,7 +110,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
                         "Transferring %s role to %s has failed, master is: %s!"%(role, self.dsServiceName_dc2, master))
 
         # dc1 gets back the role from dc2
-        print "Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)
+        print("Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1))
         self._net_fsmo_role_transfer(DC=self.dnsname_dc1, role=role)
         # check if the role is transfered
         (res, master) = self._wait_for_role_transfer(ldb_dc=self.ldb_dc1,
@@ -119,7 +120,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
                         "Transferring %s role to %s has failed, master is: %s!"%(role, self.dsServiceName_dc1, master))
 
         # dc1 keeps the role
-        print "Testing for no-op %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)
+        print("Testing for no-op %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1))
         self._net_fsmo_role_transfer(DC=self.dnsname_dc1, role=role, noop=True)
         # check if the role is transfered
         (res, master) = self._wait_for_role_transfer(ldb_dc=self.ldb_dc1,
index b60ec533c9a4de18a186c609b4604add22c8d2ae..1b619f146921087954b77e34a8cee13368024be6 100644 (file)
@@ -27,6 +27,7 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN getncchanges -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
+from __future__ import print_function
 import drs_base
 import samba.tests
 import ldb
index 43a6caece8217d1356b479b093f2835ede889af9..dfb48415c6f2e429b2fbb407e6de80dd0f062a4c 100644 (file)
@@ -27,6 +27,7 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN repl_move -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
+from __future__ import print_function
 import time
 import uuid
 
@@ -275,7 +276,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         initial_metadata = [
             (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1),
             (DRSUAPI_ATTID_cn, self.dc1_guid, 1),
@@ -548,7 +549,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         initial_metadata = [
             (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1),
             (DRSUAPI_ATTID_cn, self.dc1_guid, 1),
@@ -730,7 +731,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         initial_metadata = [
             (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1),
             (DRSUAPI_ATTID_cn, self.dc1_guid, 1),
@@ -910,7 +911,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         initial_metadata = [
             (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1),
             (DRSUAPI_ATTID_cn, self.dc1_guid, 1),
@@ -1091,7 +1092,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         initial_metadata = [
             (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1),
             (DRSUAPI_ATTID_cn, self.dc1_guid, 1),
@@ -1419,7 +1420,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         user_cur = self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         new_dn = ldb.Dn(self.ldb_dc1, "CN=%s" % username)
@@ -1480,7 +1481,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1546,7 +1547,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1612,7 +1613,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1679,7 +1680,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1745,7 +1746,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1794,7 +1795,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
         ou_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
@@ -1958,7 +1959,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         self.ldb_dc1.add(self.ou2)
@@ -2014,7 +2015,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         self.ldb_dc1.add(self.ou2)
@@ -2108,7 +2109,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         self.ldb_dc1.add(self.ou2)
@@ -2197,7 +2198,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         self.ldb_dc1.add(self.ou2)
@@ -2297,7 +2298,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase):
         user_dn   = ldb_res[0]["dn"]
 
         # check user info on DC1
-        print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))
+        print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])))
         self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False)
 
         self.ldb_dc1.add(self.ou2)
index fe013e63259e30b2afeeb067a93ab9623d3ec70f..c8a38333d24ff704970c3263325889879c327074 100644 (file)
@@ -27,6 +27,7 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN replica_sync -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
+from __future__ import print_function
 import drs_base
 import samba.tests
 import time
@@ -155,8 +156,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc2.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertFalse('CNF:%s' % self.ou2 in str(res2[0]["name"][0]))
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc2, self.domain_dn) not in str(res1[0].dn))
@@ -195,8 +196,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -234,8 +235,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0]), "Got %s for %s" % (str(res2[0]["name"][0]), self.ou2))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -276,8 +277,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -325,8 +326,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -364,8 +365,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -407,8 +408,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -455,8 +456,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -506,8 +507,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn))
@@ -558,8 +559,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % ou2_child,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % ou1_child in str(res1[0]["name"][0]) or 'CNF:%s' % ou2_child in str(res2[0]["name"][0]))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) in str(res1[0].dn))
         self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) in str(res2[0].dn))
@@ -625,9 +626,9 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res3 = self.ldb_dc2.search(base="<GUID=%s>" % ou3_child,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0].dn
-        print res2[0].dn
-        print res3[0].dn
+        print(res1[0].dn)
+        print(res2[0].dn)
+        print(res3[0].dn)
         self.assertEqual('Test Child 2', res1[0]["name"][0])
         self.assertEqual('Test Child', res2[0]["name"][0])
         self.assertEqual('Test CASE Child', res3[0]["name"][0])
@@ -645,9 +646,9 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res3 = self.ldb_dc1.search(base="<GUID=%s>" % ou3_child,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0].dn
-        print res2[0].dn
-        print res3[0].dn
+        print(res1[0].dn)
+        print(res2[0].dn)
+        print(res3[0].dn)
         self.assertEqual('Test Child 2', res1[0]["name"][0])
         self.assertEqual('Test Child', res2[0]["name"][0])
         self.assertEqual('Test CASE Child', res3[0]["name"][0])
@@ -723,8 +724,8 @@ objectClass: organizationalUnit
                                   scope=SCOPE_BASE, attrs=["name"])
         res2 = self.ldb_dc1.search(base="<GUID=%s>" % self.ou2,
                                   scope=SCOPE_BASE, attrs=["name"])
-        print res1[0]["name"][0]
-        print res2[0]["name"][0]
+        print(res1[0]["name"][0])
+        print(res2[0]["name"][0])
         self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0]))
         self.assertFalse('CNF:%s' % self.ou2 in str(res2[0]["name"][0]))