From da8af833cfd2f3368d386621a0dd4e68dccb7a90 Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Wed, 27 Sep 2017 11:21:48 +1300 Subject: [PATCH] selftest: Print link meta-data when developer debugging is used For Windows, DRS is the only way to see the RMD_VERSION of a link, or to tell what inactive links the DC. Add some debug to display this information. By default, this debug is turned off. Signed-off-by: Tim Beale Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Oct 20 08:01:35 CEST 2017 on sn-devel-144 --- source4/torture/drs/python/drs_base.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index c2760e2cadf..10f2e63ae3b 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -253,10 +253,22 @@ class DrsBaseTestCase(SambaToolCmdTest): next_object = next_object.next_object print("Linked Attributes: %d" % ctr6.linked_attributes_count) - ctr6_links = self._get_ctr6_links(ctr6) - for link in ctr6_links: + for lidx in range(0, ctr6.linked_attributes_count): + l = ctr6.linked_attributes[lidx] + try: + target = ndr_unpack(drsuapi.DsReplicaObjectIdentifier3, + l.value.blob) + except: + target = ndr_unpack(drsuapi.DsReplicaObjectIdentifier3Binary, + l.value.blob) + print("Link Tgt %s... <-- Src %s" - %(link.targetDN[:25], link.identifier)) + %(target.dn[:25], l.identifier.guid)) + state = "Del" + if l.flags & drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE: + state = "Act" + print(" v%u %s changed %u" %(l.meta_data.version, state, + l.meta_data.originating_change_time)) print("HWM: %d" %(ctr6.new_highwatermark.highest_usn)) print("Tmp HWM: %d" %(ctr6.new_highwatermark.tmp_highest_usn)) -- 2.47.3