# PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN delete_object -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
#
+from __future__ import print_function
import time
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
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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+from __future__ import print_function
import sys
import time
import os
"""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
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
# 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
"""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
"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,
"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,
# 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
# PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN repl_move -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
#
+from __future__ import print_function
import time
import uuid
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),
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),
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),
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),
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),
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)
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
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
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
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
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
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
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)
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)
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)
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)
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)
# 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
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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])
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])
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]))