tests/drs: change sort order in tests to match Windows
authorGarming Sam <garming@catalyst.net.nz>
Thu, 9 Jun 2016 03:54:25 +0000 (15:54 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Jun 2016 12:13:18 +0000 (14:13 +0200)
Although we attempted to sort by GUID based on DRSR, it is actually
sorted by the ndr packed GUID.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11960

selftest/knownfail
source4/torture/drs/python/getnc_exop.py

index 2f2d6bffbaedce844550289a50ac5ed06e1ea137..42eba712e78f64bedd93b70a26d176e16508e646 100644 (file)
 # ad_dc requires signing
 #
 ^samba4.smb.signing.*disabled.*signing=off.*\(ad_dc\)
+^samba4.drs.getnc_exop.python.*.getnc_exop.DrsReplicaSyncSortTestCase
index 0ddac8b9244f0712d06ce6b60d77c670304f7d54..ca6c4434b3c9708f08da1b8dd4f11d9eab5e2164 100644 (file)
@@ -36,7 +36,7 @@ from ldb import SCOPE_BASE
 
 from samba.dcerpc import drsuapi, misc, drsblobs
 from samba.drs_utils import drs_DsBind
-from samba.ndr import ndr_unpack
+from samba.ndr import ndr_unpack, ndr_pack
 
 def _linked_attribute_compare(la1, la2):
     """See CompareLinks() in MS-DRSR section 4.1.10.5.17"""
@@ -44,7 +44,7 @@ def _linked_attribute_compare(la1, la2):
     la2, la2_target = la2
 
     # Ascending host object GUID
-    c = cmp(la1.identifier.guid, la2.identifier.guid)
+    c = cmp(ndr_pack(la1.identifier.guid), ndr_pack(la2.identifier.guid))
     if c != 0:
         return c
 
@@ -60,7 +60,7 @@ def _linked_attribute_compare(la1, la2):
         return 1 if la1_active else -1
 
     # Ascending target object GUID
-    return cmp(la1_target, la2_target)
+    return cmp(ndr_pack(la1_target), ndr_pack(la2_target))
 
 class AbstractLink:
     def __init__(self, attid, flags, identifier, targetGUID):