[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Dec 14 03:14:03 UTC 2018


The branch, master has been updated
       via  f183fd32831 Change order of flags in Makefile so that crackcheck builds under Ubuntu
       via  49c1c0c38bc tests/smbcontrol: fix typo in class name
       via  89705734432 Add #include <unistd.h> to provide prototype for getopt()
       via  288338b4292 Correction of comment in winbindd_pam.c
       via  90f0460c69e buildtools/wafsamba: Ensure default python picked up is python3
       via  bae5364bf39 buildtools/wafsamba: re-write shebang for delivered python scripts
       via  0756b59f810 WHATSNEW: document build system default python version change.
       via  9116cc8cc81 s4/scripting: python3 fix string.find instance
       via  166d119d48e dynconfig/wscript: python3 fix string.find instance
       via  28ecdd97773 buildtools/wafsamba: Decode output of cmd_output (which is bytes)
       via  2b3c9b8e6a4 s4/dsdb/tests/python: Restore embed NULL tests for Python3
       via  d20f06986ee selftest: Convert samba4.ldap.sort.python to planoldpythontest
      from  e9a13d7fc84 selftest/knownfail.d/smb: avoid explicit python version

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f183fd328314d90a92659720adebf034917962ec
Author: Brian Candler <b.candler at pobox.com>
Date:   Thu Dec 14 20:39:09 2017 +0000

    Change order of flags in Makefile so that crackcheck builds under Ubuntu
    
    Signed-off-by: Brian Candler <b.candler at pobox.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Dec 14 04:13:38 CET 2018 on sn-devel-144

commit 49c1c0c38bc572d1b543a3e71e8beb4677d5c4a0
Author: Philipp Gesang <philipp.gesang at intra2net.com>
Date:   Mon Aug 20 10:38:04 2018 +0200

    tests/smbcontrol: fix typo in class name
    
    Signed-off-by: Philipp Gesang <philipp.gesang at intra2net.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 89705734432eec6c458f53b1dc7a10b4833f2215
Author: Brian Candler <b.candler at pobox.com>
Date:   Thu Dec 14 20:40:22 2017 +0000

    Add #include <unistd.h> to provide prototype for getopt()
    
    Signed-off-by: Brian Candler <b.candler at pobox.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 288338b42926f1d4fc7885eb6558a6f82586a02d
Author: amitkuma <amitkuma at redhat.com>
Date:   Thu Dec 21 22:44:38 2017 +0530

    Correction of comment in winbindd_pam.c
    
    Internal comment corrected.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 90f0460c69e4966195edb19ca98c5e774c8af5c5
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Dec 13 17:03:13 2018 +0000

    buildtools/wafsamba: Ensure default python picked up is python3
    
    1) set the default python searched for samba waf to be python3
    2) remove default setting of PYTHON variable if not defined (not needed)
    
    Signed-off-by: Noel Power <npower at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bae5364bf39f863d25e3c7caac59c6af28b4f441
Author: Noel Power <noel.power at suse.com>
Date:   Wed Dec 12 20:30:32 2018 +0000

    buildtools/wafsamba: re-write shebang for delivered python scripts
    
    Can't see how the orig code would have worked though
    a)
      task.env["PYTHON"] is a list
    b) task.env["PYTHON_SPECIFIED"] can (and is in our case false) looks
       like it would only be true for python2 but in anycase no harm we
       always rewrite the shebang
    
    So now it works as follows,
    
    1. PYTHON (which is where the shebang is got) is set to python3 by default
    2. To override the default you need to set PYTHON (e.g. to build with python2)
    3. If you give a full path in PYTHON then shebang is of the format
       "#!{FULL_PYTHON_INTERPRETER_PATH)
    4. If you specify PYTHON=python or PYTHON=python2 etc. shebang format is
       "#!!/usr/bin/env python", "#!!/usr/bin/env python2" etc.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0756b59f810ee9d4bf9b6d5eac02d8951751ff79
Author: Noel Power <noel.power at suse.com>
Date:   Tue Dec 11 12:13:34 2018 +0000

    WHATSNEW: document build system default python version change.
    
    build now uses python3 by default instead of python2
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 9116cc8cc81dd96ed6c303577c9e66fb3a10db3e
Author: Noel Power <noel.power at suse.com>
Date:   Tue Dec 11 12:17:59 2018 +0000

    s4/scripting: python3 fix string.find instance
    
        string.find doesn't exist in python3. Instead use the 'find' method
        of the string instance itself
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 166d119d48efd6b7b4f8f5978c71c50bad2109ca
Author: Noel Power <noel.power at suse.com>
Date:   Tue Dec 11 12:12:08 2018 +0000

    dynconfig/wscript: python3 fix string.find instance
    
    string.find doesn't exist in python3. Instead use the 'find' method
    of the string instance itself
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 28ecdd977735a02740e67861bc69d5b461d6c77f
Author: Noel Power <noel.power at suse.com>
Date:   Mon Dec 10 20:18:11 2018 +0000

    buildtools/wafsamba: Decode output of cmd_output (which is bytes)
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2b3c9b8e6a44420795768d6476ce843886222768
Author: Noel Power <noel.power at suse.com>
Date:   Tue Dec 11 10:46:35 2018 +0000

    s4/dsdb/tests/python: Restore embed NULL tests for Python3
    
    commit: 34ca15fb042e42773854c093ad9f1e67696c90ac changed the
    test so embedded NULLs were avoided when python3 was used.
    This was due to the fact the string comparison function
    'locale.strcoll' cannot handle embedded NULLs. This commit
    
    a) Restores the test data using embedded NULLs which was
       not used depending on the python runtime version
    b) Removes the problematic calculation of expected sorting order
       and instead uses sort order data stored in files.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d20f06986ee8f176106446c8ae32f0900ea4e4cf
Author: Noel Power <noel.power at suse.com>
Date:   Fri Dec 7 18:52:17 2018 +0000

    selftest: Convert samba4.ldap.sort.python to planoldpythontest
    
    Currently the test only runs fully under python2. As an interim
    measure while we figure out how to get this to work property under
    python3 I have converted the test to planoldpythontest so it also
    can run under python2
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 WHATSNEW.txt                                       | 21 +++++
 buildtools/wafsamba/samba_conftests.py             |  2 +-
 buildtools/wafsamba/samba_python.py                |  7 +-
 buildtools/wafsamba/wafsamba.py                    |  8 +-
 dynconfig/wscript                                  |  2 +-
 examples/auth/crackcheck/Makefile                  |  2 +-
 examples/auth/crackcheck/crackcheck.c              |  1 +
 python/samba/tests/blackbox/smbcontrol.py          |  4 +-
 source3/winbindd/winbindd_pam.c                    |  2 +-
 source4/dsdb/tests/python/sort.py                  | 95 ++++++++++------------
 .../dsdb/tests/python/testdata/simplesort.expected |  8 ++
 .../tests/python/testdata/unicodesort.expected     | 16 ++++
 source4/scripting/bin/rpcclient                    |  4 +-
 source4/selftest/tests.py                          |  3 +-
 14 files changed, 105 insertions(+), 70 deletions(-)
 create mode 100644 source4/dsdb/tests/python/testdata/simplesort.expected
 create mode 100644 source4/dsdb/tests/python/testdata/unicodesort.expected


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 0d7aed0c27e..ffbd48b040e 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -84,6 +84,27 @@ parameter.  The default value of 0, indicates there is no limit.  The limit
 is applied individually to netlogon and ldap.  When the process limit is
 exceeded Samba drops new connections immediately.
 
+python3 support
+---------------
+
+The version of python which is now the default for samba is python3.
+'configure' & 'make' will execute using python3. It is possible to still
+specify an additional python version with '--extra-python'
+e.g. '--extra-python=/usr/bin/python2'. It should be noted that support for
+this option will be deprecated in a future release.
+
+What if I need to build with python2? To build with python2 you *must* set
+the 'PYTHON' environent variable to override the python3 default for both
+'configure' and 'make' steps.
+
+   'PYTHON=python2 ./configure.developer'
+&
+   'PYTHON=python2 make'
+
+Note: Support for python2 (with the exception of a build configured with
+      'PYTHON=python2 ./configure --disable-python' and built with
+      'PYTHON=python2 make' will be deprecated in the next release.
+
 REMOVED FEATURES
 ================
 
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index d8f793638f5..c0b9ae49296 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -418,7 +418,7 @@ def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True, boolean=Fals
     if on_target:
         cmd.extend(conf.SAMBA_CROSS_ARGS(msg=msg))
     try:
-        ret = Utils.cmd_output(cmd)
+        ret = Utils.cmd_output(cmd).decode('utf8')
     except:
         conf.COMPOUND_END(False)
         return False
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index 419c559848f..fac0e34b3f1 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -29,11 +29,10 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,6,0)):
         interpreters.append(conf.env['PYTHON'])
         conf.setenv('default')
 
-    if not os.getenv('PYTHON', None):
-        conf.env['PYTHON'] = sys.executable
-    conf.find_program('python', var='PYTHON', mandatory=mandatory)
+    conf.find_program('python3', var='PYTHON', mandatory=mandatory)
     conf.load('python')
-    path_python = conf.find_program('python')
+    path_python = conf.find_program('python3')
+
     conf.env.PYTHON_SPECIFIED = (conf.env.PYTHON != path_python)
     conf.check_python_version(version)
 
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index f31432a0148..230a76d8f2c 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -772,10 +772,10 @@ def copy_and_fix_python_path(task):
         replacement="""sys.path.insert(0, "%s")
 sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
 
-    if task.env["PYTHON"][0] == "/":
-        replacement_shebang = "#!%s\n" % task.env["PYTHON"]
+    if task.env["PYTHON"][0].startswith("/"):
+        replacement_shebang = "#!%s\n" % task.env["PYTHON"][0]
     else:
-        replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PYTHON"]
+        replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PYTHON"][0]
 
     installed_location=task.outputs[0].bldpath(task.env)
     source_file = open(task.inputs[0].srcpath(task.env))
@@ -783,7 +783,7 @@ sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
     lineno = 0
     for line in source_file:
         newline = line
-        if (lineno == 0 and task.env["PYTHON_SPECIFIED"] is True and
+        if (lineno == 0 and
                 line[:2] == "#!"):
             newline = replacement_shebang
         elif pattern in line:
diff --git a/dynconfig/wscript b/dynconfig/wscript
index e9ca4e5b9df..e352712d284 100644
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -46,7 +46,7 @@ class SambaIndentedHelpFormatter (optparse.IndentedHelpFormatter):
         result.append(opts)
         if option.help:
             help_text = self.expand_default(option)
-            if string.find(help_text, '\n') == -1:
+            if help_text.find('\n') == -1:
                 help_lines = textwrap.wrap(help_text, self.help_width)
             else:
                 help_lines = help_text.splitlines()
diff --git a/examples/auth/crackcheck/Makefile b/examples/auth/crackcheck/Makefile
index 84377aafefe..edc764529b3 100644
--- a/examples/auth/crackcheck/Makefile
+++ b/examples/auth/crackcheck/Makefile
@@ -15,7 +15,7 @@ OBJS = crackcheck.o
 LIBS = -lcrack
 
 crackcheck: $(OBJS)
-	$(CC) $(CFLAGS) $(LIBS) -o crackcheck $(OBJS)
+	$(CC) $(CFLAGS) -o crackcheck $(OBJS) $(LIBS)
 
 clean:
 	rm -f core *.o crackcheck
diff --git a/examples/auth/crackcheck/crackcheck.c b/examples/auth/crackcheck/crackcheck.c
index 0c997bb00b6..c3037756f42 100644
--- a/examples/auth/crackcheck/crackcheck.c
+++ b/examples/auth/crackcheck/crackcheck.c
@@ -4,6 +4,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <crack.h>
+#include <unistd.h>
 
 void usage(char *command) {
 	char *c, *comm;
diff --git a/python/samba/tests/blackbox/smbcontrol.py b/python/samba/tests/blackbox/smbcontrol.py
index 37e0ab78974..e923efb71a5 100644
--- a/python/samba/tests/blackbox/smbcontrol.py
+++ b/python/samba/tests/blackbox/smbcontrol.py
@@ -24,10 +24,10 @@ PING    = "ping"
 USAGE   = "pool-usage"
 
 
-class SmbcontrolBlockboxTests(BlackboxTestCase):
+class SmbcontrolBlackboxTests(BlackboxTestCase):
 
     def setUp(self):
-        super(SmbcontrolBlockboxTests, self).setUp()
+        super(SmbcontrolBlackboxTests, self).setUp()
         lp_ctx = self.get_loadparm()
         self.msg_ctx = Messaging(lp_ctx=lp_ctx)
 
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index b7eb17556a4..83136e4be79 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1618,7 +1618,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
 		}
 
 		/* if we get access denied, a possible cause was that we had
-		   and open connection to the DC, but someone changed our
+		   an open connection to the DC, but someone changed our
 		   machine account password out from underneath us using 'net
 		   rpc changetrustpw' */
 
diff --git a/source4/dsdb/tests/python/sort.py b/source4/dsdb/tests/python/sort.py
index 0b87442af39..3bb1745c2ed 100644
--- a/source4/dsdb/tests/python/sort.py
+++ b/source4/dsdb/tests/python/sort.py
@@ -17,7 +17,6 @@ from samba.tests.subunitrun import SubunitOptions, TestProgram
 from samba.compat import cmp_fn
 from samba.compat import cmp_to_key_fn
 from samba.compat import text_type
-from samba.compat import PY3
 import samba.getopt as options
 
 from samba.auth import system_session
@@ -43,7 +42,15 @@ if len(args) < 1:
     parser.print_usage()
     sys.exit(1)
 
-host = args[0]
+datadir = os.getenv("DATA_DIR", None)
+if not datadir:
+    print("Please specify the location of the sort expected results with env variable DATA_DIR")
+    sys.exit(1)
+
+host = os.getenv("SERVER", None)
+if not host:
+    print("Please specify the host with env variable SERVER")
+    sys.exit(1)
 
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
@@ -59,7 +66,7 @@ def norm(x):
 # drastically different ways. The order here is what you get from
 # Windows2012R2.
 FIENDISH_TESTS = [' ', ' e', '\t-\t', '\n\t\t', '!@#!@#!', '¼', '¹', '1',
-                  '1/4', '1⁄4', '1\xe2\x81\x845', '3', 'abc',
+                  '1/4', '1⁄4', '1\xe2\x81\x845', '3', 'abc', 'fo\x00od',
 
                   # Here we also had '\x00food', but that seems to sort
                   # non-deterministically on Windows vis-a-vis 'fo\x00od'.
@@ -68,8 +75,7 @@ FIENDISH_TESTS = [' ', ' e', '\t-\t', '\n\t\t', '!@#!@#!', '¼', '¹', '1',
                   'sorttest', 'sorttēst11,', 'śorttest2', 'śoRttest2',
                   'ś-o-r-t-t-e-s-t-2', 'soRTTēst2,', 'ṡorttest4', 'ṡorttesT4',
                   'sörttest-5', 'sÖrttest-5', 'so-rttest7,', '桑巴']
-if not PY3:
-    FIENDISH_TESTS.append('fo\x00od')
+
 
 class BaseSortTests(samba.tests.TestCase):
     avoid_tricky_sort = False
@@ -82,7 +88,10 @@ class BaseSortTests(samba.tests.TestCase):
             'cn': name,
             "objectclass": "user",
             'givenName': "abcdefghijklmnopqrstuvwxyz"[i % 26],
-            "carLicense": "后来经",
+            "roomNumber": "%sb\x00c" % (n - i),
+            # with python3 re.sub(r'[^\w,.]', repl, string) doesn't
+            # work as expected with unicode as value for carLicense
+            "carLicense": "XXXXXXXXX" if self.avoid_tricky_sort else "后来经",
             "employeeNumber": "%s%sx" % (abs(i * (99 - i)), '\n' * (i & 255)),
             "accountExpires": "%s" % (10 ** 9 + 1000000 * i),
             "msTSExpireDate4": "19%02d0101010000.0Z" % (i % 100),
@@ -93,9 +102,6 @@ class BaseSortTests(samba.tests.TestCase):
             "comment": "Favourite colour is %d" % (n % (i + 1)),
         }
 
-        if not PY3:
-            user.update({"roomNumber": "%sb\x00c" % (n - i)})
-
         if self.avoid_tricky_sort:
             # We are not even going to try passing tests that assume
             # some kind of Unicode awareness.
@@ -106,9 +112,14 @@ class BaseSortTests(samba.tests.TestCase):
             fiendish_index = i % len(FIENDISH_TESTS)
             user.update({
                 # Sort doesn't look past a NUL byte.
+                "photo": "\x00%d" % (n - i),
                 "audio": "%sn octet string %s%s ♫♬\x00lalala" % ('Aa'[i & 1],
                                                                  chr(i & 255),
                                                                  i),
+                "displayNamePrintable": "%d\x00%c" % (i, i & 255),
+                "adminDisplayName": "%d\x00b" % (n - i),
+                "title": "%d%sb" % (n - i, '\x00' * i),
+
                 # Names that vary only in case. Windows returns
                 # equivalent addresses in the order they were put
                 # in ('a st', 'A st',...). We don't check that.
@@ -118,13 +129,6 @@ class BaseSortTests(samba.tests.TestCase):
                 "postalAddress": FIENDISH_TESTS[-fiendish_index],
             })
 
-            if not PY3:
-                user.update({
-                    "photo": "\x00%d" % (n - i),
-                    "displayNamePrintable": "%d\x00%c" % (i, i & 255),
-                    "adminDisplayName": "%d\x00b" % (n - i),
-                    "title": "%d%sb" % (n - i, '\x00' * i)})
-
         if attrs is not None:
             user.update(attrs)
 
@@ -177,44 +181,31 @@ class BaseSortTests(samba.tests.TestCase):
         self.expected_results = {}
         self.expected_results_binary = {}
 
-        for k in self.locale_sorted_keys:
-            # Using key=locale.strxfrm fails on \x00
-            forward = sorted((norm(x[k]) for x in self.users),
-                             key=cmp_to_key_fn(locale.strcoll))
-            reverse = list(reversed(forward))
-            self.expected_results[k] = (forward, reverse)
-
         for k in self.binary_sorted_keys:
             forward = sorted((x[k] for x in self.users))
             reverse = list(reversed(forward))
             self.expected_results_binary[k] = (forward, reverse)
-            self.expected_results[k] = (forward, reverse)
-
-        # Fix up some because Python gets it wrong, using Schwartzian tramsform
-        for k in ('adminDisplayName', 'title', 'streetAddress',
-                  'employeeNumber'):
-            if k in self.expected_results:
-                broken = self.expected_results[k][0]
-                tmp = [(x.replace('\x00', ''), x) for x in broken]
-                tmp.sort()
-                fixed = [x[1] for x in tmp]
-                self.expected_results[k] = (fixed, list(reversed(fixed)))
-        for k in ('streetAddress', 'postalAddress'):
-            if k in self.expected_results:
-                c = {}
-                for u in self.users:
-                    x = u[k]
-                    if x in c:
-                        c[x] += 1
-                        continue
-                    c[x] = 1
-                fixed = []
-                for x in FIENDISH_TESTS:
-                    fixed += [norm(x)] * c.get(x, 0)
-
-                rev = list(reversed(fixed))
-                self.expected_results[k] = (fixed, rev)
 
+        # FYI: Expected result data was generated from the old
+        # code that was manually sorting (while executing with
+        # python2)
+        # The resulting data was injected into the data file with
+        # code similar to:
+        #
+        # for k in self.expected_results:
+        #     f.write("%s = %s\n" % (k,  repr(self.expected_results[k][0])))
+
+        f = open(self.results_file, "r")
+        for line in f:
+            if len(line.split('=', 1)) == 2:
+                key = line.split('=', 1)[0].strip()
+                value = line.split('=', 1)[1].strip()
+                if value.startswith('['):
+                    import ast
+                    fwd_list = ast.literal_eval(value)
+                    rev_list = list(reversed(fwd_list))
+                    self.expected_results[key] = (fwd_list, rev_list)
+        f.close()
     def tearDown(self):
         super(BaseSortTests, self).tearDown()
         self.ldb.delete(self.ou, ['tree_delete:1'])
@@ -355,7 +346,7 @@ class BaseSortTests(samba.tests.TestCase):
 
 class SimpleSortTests(BaseSortTests):
     avoid_tricky_sort = True
-
+    results_file = os.path.join(datadir, "simplesort.expected")
     def test_server_sort_different_attr(self):
         self._test_server_sort_different_attr()
 
@@ -371,6 +362,7 @@ class SimpleSortTests(BaseSortTests):
 
 class UnicodeSortTests(BaseSortTests):
     avoid_tricky_sort = False
+    results_file = os.path.join(datadir, "unicodesort.expected")
 
     def test_server_sort_default(self):
         self._test_server_sort_default()
@@ -387,6 +379,3 @@ if "://" not in host:
         host = "tdb://%s" % host
     else:
         host = "ldap://%s" % host
-
-
-TestProgram(module=__name__, opts=subunitopts)
diff --git a/source4/dsdb/tests/python/testdata/simplesort.expected b/source4/dsdb/tests/python/testdata/simplesort.expected
new file mode 100644
index 00000000000..045337b5ec5
--- /dev/null
+++ b/source4/dsdb/tests/python/testdata/simplesort.expected
@@ -0,0 +1,8 @@
+comment = [u'FAVOURITEXCOLOURXISX0', u'FAVOURITEXCOLOURXISX0', u'FAVOURITEXCOLOURXISX0', u'FAVOURITEXCOLOURXISX0', u'FAVOURITEXCOLOURXISX1', u'FAVOURITEXCOLOURXISX1', u'FAVOURITEXCOLOURXISX1', u'FAVOURITEXCOLOURXISX1', u'FAVOURITEXCOLOURXISX1', u'FAVOURITEXCOLOURXISX10', u'FAVOURITEXCOLOURXISX11', u'FAVOURITEXCOLOURXISX12', u'FAVOURITEXCOLOURXISX13', u'FAVOURITEXCOLOURXISX14', u'FAVOURITEXCOLOURXISX15', u'FAVOURITEXCOLOURXISX16', u'FAVOURITEXCOLOURXISX2', u'FAVOURITEXCOLOURXISX3', u'FAVOURITEXCOLOURXISX3', u'FAVOURITEXCOLOURXISX3', u'FAVOURITEXCOLOURXISX3', u'FAVOURITEXCOLOURXISX3', u'FAVOURITEXCOLOURXISX4', u'FAVOURITEXCOLOURXISX5', u'FAVOURITEXCOLOURXISX5', u'FAVOURITEXCOLOURXISX5', u'FAVOURITEXCOLOURXISX6', u'FAVOURITEXCOLOURXISX6', u'FAVOURITEXCOLOURXISX7', u'FAVOURITEXCOLOURXISX7', u'FAVOURITEXCOLOURXISX8', u'FAVOURITEXCOLOURXISX9', u'FAVOURITEXCOLOURXISX9']
+msTSExpireDate4 = ['19000101010000.0Z', '19010101010000.0Z', '19020101010000.0Z', '19030101010000.0Z', '19040101010000.0Z', '19050101010000.0Z', '19060101010000.0Z', '19070101010000.0Z', '19080101010000.0Z', '19090101010000.0Z', '19100101010000.0Z', '19110101010000.0Z', '19120101010000.0Z', '19130101010000.0Z', '19140101010000.0Z', '19150101010000.0Z', '19160101010000.0Z', '19170101010000.0Z', '19180101010000.0Z', '19190101010000.0Z', '19200101010000.0Z', '19210101010000.0Z', '19220101010000.0Z', '19230101010000.0Z', '19240101010000.0Z', '19250101010000.0Z', '19260101010000.0Z', '19270101010000.0Z', '19280101010000.0Z', '19290101010000.0Z', '19300101010000.0Z', '19310101010000.0Z', '19320101010000.0Z']
+cn = [u'SORTTEST0', u'SORTTEST1', u'SORTTEST10', u'SORTTEST11', u'SORTTEST12', u'SORTTEST13', u'SORTTEST14', u'SORTTEST15', u'SORTTEST16', u'SORTTEST17', u'SORTTEST18', u'SORTTEST19', u'SORTTEST2', u'SORTTEST20', u'SORTTEST21', u'SORTTEST22', u'SORTTEST23', u'SORTTEST24', u'SORTTEST25', u'SORTTEST26', u'SORTTEST27', u'SORTTEST28', u'SORTTEST29', u'SORTTEST3', u'SORTTEST30', u'SORTTEST31', u'SORTTEST32', u'SORTTEST4', u'SORTTEST5', u'SORTTEST6', u'SORTTEST7', u'SORTTEST8', u'SORTTEST9']
+serialNumber = ['abcXAXX', 'abcXAXX', 'abcXAXX', 'abcXAXX', 'abcXAXX', 'abcXBzX', 'abcXBzX', 'abcXBzX', 'abcXBzX', 'abcXX3X', 'abcXX3X', 'abcXX3X', 'abcXX3X', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXXX', 'abcXXzX', 'abcXXzX', 'abcXXzX', 'abcXXzX', 'abcXa3X', 'abcXa3X', 'abcXa3X', 'abcXa3X', 'abcXbXX', 'abcXbXX', 'abcXbXX', 'abcXbXX']
+roomNumber = [u'10BXC', u'11BXC', u'12BXC', u'13BXC', u'14BXC', u'15BXC', u'16BXC', u'17BXC', u'18BXC', u'19BXC', u'1BXC', u'20BXC', u'21BXC', u'22BXC', u'23BXC', u'24BXC', u'25BXC', u'26BXC', u'27BXC', u'28BXC', u'29BXC', u'2BXC', u'30BXC', u'31BXC', u'32BXC', u'33BXC', u'3BXC', u'4BXC', u'5BXC', u'6BXC', u'7BXC', u'8BXC', u'9BXC']
+carLicense = [u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX', u'XXXXXXXXX']
+employeeNumber = [u'0X', u'1044XXXXXXXXXXXXX', u'1118XXXXXXXXXXXXXX', u'1190XXXXXXXXXXXXXXX', u'1260XXXXXXXXXXXXXXXX', u'1328XXXXXXXXXXXXXXXXX', u'1394XXXXXXXXXXXXXXXXXX', u'1458XXXXXXXXXXXXXXXXXXX', u'1520XXXXXXXXXXXXXXXXXXXX', u'1580XXXXXXXXXXXXXXXXXXXXX', u'1638XXXXXXXXXXXXXXXXXXXXXX', u'1694XXXXXXXXXXXXXXXXXXXXXXX', u'1748XXXXXXXXXXXXXXXXXXXXXXXX', u'1800XXXXXXXXXXXXXXXXXXXXXXXXX', u'1850XXXXXXXXXXXXXXXXXXXXXXXXXX', u'1898XXXXXXXXXXXXXXXXXXXXXXXXXXX', u'1944XXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'194XXX', u'1988XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'2030XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'2070XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'2108XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'2144XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', u'288XXXX', u'380XXXXX', u'470XXXXXX', u'558XXXXXXX', u'644XXXXXXXX', u'728XXXXXXXXX', u'810XXXXXXXXXX', u'890XXXXXXXXXXX', u'968XXXXXXXXXXXX', u'98XX']
+givenName = [u'A', u'A', u'B', u'B', u'C', u'C', u'D', u'D', u'E', u'E', u'F', u'F', u'G', u'G', u'H', u'I', u'J', u'K', u'L', u'M', u'N', u'O', u'P', u'Q', u'R', u'S', u'T', u'U', u'V', u'W', u'X', u'Y', u'Z']
diff --git a/source4/dsdb/tests/python/testdata/unicodesort.expected b/source4/dsdb/tests/python/testdata/unicodesort.expected
new file mode 100644
index 00000000000..de07cfc51c9
--- /dev/null
+++ b/source4/dsdb/tests/python/testdata/unicodesort.expected
@@ -0,0 +1,16 @@
+comment = [u'FAVOURITE COLOUR IS 0', u'FAVOURITE COLOUR IS 0', u'FAVOURITE COLOUR IS 0', u'FAVOURITE COLOUR IS 0', u'FAVOURITE COLOUR IS 1', u'FAVOURITE COLOUR IS 1', u'FAVOURITE COLOUR IS 1', u'FAVOURITE COLOUR IS 1', u'FAVOURITE COLOUR IS 1', u'FAVOURITE COLOUR IS 10', u'FAVOURITE COLOUR IS 11', u'FAVOURITE COLOUR IS 12', u'FAVOURITE COLOUR IS 13', u'FAVOURITE COLOUR IS 14', u'FAVOURITE COLOUR IS 15', u'FAVOURITE COLOUR IS 16', u'FAVOURITE COLOUR IS 2', u'FAVOURITE COLOUR IS 3', u'FAVOURITE COLOUR IS 3', u'FAVOURITE COLOUR IS 3', u'FAVOURITE COLOUR IS 3', u'FAVOURITE COLOUR IS 3', u'FAVOURITE COLOUR IS 4', u'FAVOURITE COLOUR IS 5', u'FAVOURITE COLOUR IS 5', u'FAVOURITE COLOUR IS 5', u'FAVOURITE COLOUR IS 6', u'FAVOURITE COLOUR IS 6', u'FAVOURITE COLOUR IS 7', u'FAVOURITE COLOUR IS 7', u'FAVOURITE COLOUR IS 8', u'FAVOURITE COLOUR IS 9', u'FAVOURITE COLOUR IS 9']
+msTSExpireDate4 = ['19000101010000.0Z', '19010101010000.0Z', '19020101010000.0Z', '19030101010000.0Z', '19040101010000.0Z', '19050101010000.0Z', '19060101010000.0Z', '19070101010000.0Z', '19080101010000.0Z', '19090101010000.0Z', '19100101010000.0Z', '19110101010000.0Z', '19120101010000.0Z', '19130101010000.0Z', '19140101010000.0Z', '19150101010000.0Z', '19160101010000.0Z', '19170101010000.0Z', '19180101010000.0Z', '19190101010000.0Z', '19200101010000.0Z', '19210101010000.0Z', '19220101010000.0Z', '19230101010000.0Z', '19240101010000.0Z', '19250101010000.0Z', '19260101010000.0Z', '19270101010000.0Z', '19280101010000.0Z', '19290101010000.0Z', '19300101010000.0Z', '19310101010000.0Z', '19320101010000.0Z']
+audio = ['An octet string \x000 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x022 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x044 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x066 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x088 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \n10 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x0c12 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x0e14 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1016 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1218 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1420 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1622 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1824 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1a26 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1c28 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string \x1e30 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'An octet string  3
 2 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x011 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x033 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x055 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x077 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \t9 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x0b11 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \r13 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x0f15 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1117 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1319 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1521 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1723 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1925 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1b27 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1d29 \xe2\x99\xab\xe2\x99\xac\x00lalala', 'an octet string \x1f31 \xe2\x99\xab\xe2\x99\xac\x00
 lalala']
+adminDisplayName = [u'10\x00B', u'11\x00B', u'12\x00B', u'13\x00B', u'14\x00B', u'15\x00B', u'16\x00B', u'17\x00B', u'18\x00B', u'19\x00B', u'1\x00B', u'20\x00B', u'21\x00B', u'22\x00B', u'23\x00B', u'24\x00B', u'25\x00B', u'26\x00B', u'27\x00B', u'28\x00B', u'29\x00B', u'2\x00B', u'30\x00B', u'31\x00B', u'32\x00B', u'33\x00B', u'3\x00B', u'4\x00B', u'5\x00B', u'6\x00B', u'7\x00B', u'8\x00B', u'9\x00B']
+cn = [u'SORTTEST0', u'SORTTEST1', u'SORTTEST10', u'SORTTEST11', u'SORTTEST12', u'SORTTEST13', u'SORTTEST14', u'SORTTEST15', u'SORTTEST16', u'SORTTEST17', u'SORTTEST18', u'SORTTEST19', u'SORTTEST2', u'SORTTEST20', u'SORTTEST21', u'SORTTEST22', u'SORTTEST23', u'SORTTEST24', u'SORTTEST25', u'SORTTEST26', u'SORTTEST27', u'SORTTEST28', u'SORTTEST29', u'SORTTEST3', u'SORTTEST30', u'SORTTEST31', u'SORTTEST32', u'SORTTEST4', u'SORTTEST5', u'SORTTEST6', u'SORTTEST7', u'SORTTEST8', u'SORTTEST9']
+title = [u'10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'20\x00\x00\x00\x00\x00\x00\x00\
 x00\x00\x00\x00\x00\x00B', u'21\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'24\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'25\x00\x00\x00\x00\x00\x00\x00\x00B', u'26\x00\x00\x00\x00\x00\x00\x00B', u'27\x00\x00\x00\x00\x00\x00B', u'28\x00\x00\x00\x00\x00B', u'29\x00\x00\x00\x00B', u'2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'30\x00\x00\x00B', u'31\x00\x00B', u'32\x00B', u'33B', u'3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B', u'9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B']
+photo = ['\x001', '\x0010', '\x0011', '\x0012', '\x0013', '\x0014', '\x0015', '\x0016', '\x0017', '\x0018', '\x0019', '\x002', '\x0020', '\x0021', '\x0022', '\x0023', '\x0024', '\x0025', '\x0026', '\x0027', '\x0028', '\x0029', '\x003', '\x0030', '\x0031', '\x0032', '\x0033', '\x004', '\x005', '\x006', '\x007', '\x008', '\x009']
+serialNumber = ['abc   "', 'abc   "', 'abc   "', 'abc   "', 'abc -z"', 'abc -z"', 'abc -z"', 'abc -z"', 'abc /}@', 'abc /}@', 'abc /}@', 'abc /}@', 'abc A "', 'abc A "', 'abc A "', 'abc A "', 'abc A "', 'abc Bz"', 'abc Bz"', 'abc Bz"', 'abc Bz"', 'abc a3@', 'abc a3@', 'abc a3@', 'abc a3@', 'abc b}@', 'abc b}@', 'abc b}@', 'abc b}@', 'abc |3@', 'abc |3@', 'abc |3@', 'abc |3@']
+roomNumber = [u'10B\x00C', u'11B\x00C', u'12B\x00C', u'13B\x00C', u'14B\x00C', u'15B\x00C', u'16B\x00C', u'17B\x00C', u'18B\x00C', u'19B\x00C', u'1B\x00C', u'20B\x00C', u'21B\x00C', u'22B\x00C', u'23B\x00C', u'24B\x00C', u'25B\x00C', u'26B\x00C', u'27B\x00C', u'28B\x00C', u'29B\x00C', u'2B\x00C', u'30B\x00C', u'31B\x00C', u'32B\x00C', u'33B\x00C', u'3B\x00C', u'4B\x00C', u'5B\x00C', u'6B\x00C', u'7B\x00C', u'8B\x00C', u'9B\x00C']
+carLicense = [u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf', u'\u540e\u6765\u7ecf']
+streetAddress = [u' ', u' ', u' E', u' E', u'\t-\t', u'\t-\t', u'\n\t\t', u'\n\t\t', u'!@#!@#!', u'1\u20444', u'1', u'1', u'1/4', u'1\u20444', u'1\u20445', u'3', u'ABC', u'K\u014cKAKO', u'\u014a\u01101\u204443\u0166 \u201c\xab\u0110\xd0', u'\u014a\u01101\u204443\u0166\u201c\xab\u0110\xd0', u'SORTTEST', u'SORTT\u0112ST11,', u'\u015aORTTEST2', u'\u015aORTTEST2', u'\u015a-O-R-T-T-E-S-T-2', u'SORTT\u0112ST2,', u'\u1e60ORTTEST4', u'\u1e60ORTTEST4', u'S\xd6RTTEST-5', u'S\xd6RTTEST-5', u'SO-RTTEST7,', u'\u6851\u5df4', u'FO\x00OD']
+street = [u'A ST', u'A ST', u'A ST', u'A ST', u'A ST', u'C ST', u'C ST', u'C ST', u'C ST', u'E ST', u'E ST', u'E ST', u'E ST', u'G ST', u'G ST', u'G ST', u'G ST', u'I ST', u'I ST', u'I ST', u'I ST', u'K ST', u'K ST', u'K ST', u'K ST', u'M ST', u'M ST', u'M ST', u'M ST', u'O ST', u'O ST', u'O ST', u'O ST']
+employeeNumber = [u'0X', u'1044\n\n\n\n\n\n\n\n\n\n\n\nX', u'1118\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1190\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1260\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1328\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1394\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1458\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1520\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1580\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1638\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1694\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1748\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1800\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1850\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1898\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'194\n\nX', u'1944\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'1988\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'2030\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'2070\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\
 n\n\n\n\n\n\n\n\n\n\n\n\nX', u'2108\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'2144\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nX', u'288\n\n\nX', u'380\n\n\n\nX', u'470\n\n\n\n\nX', u'558\n\n\n\n\n\nX', u'644\n\n\n\n\n\n\nX', u'728\n\n\n\n\n\n\n\nX', u'810\n\n\n\n\n\n\n\n\nX', u'890\n\n\n\n\n\n\n\n\n\nX', u'968\n\n\n\n\n\n\n\n\n\n\nX', u'98\nX']
+postalAddress = [u' ', u' ', u' E', u'\t-\t', u'\n\t\t', u'!@#!@#!', u'1\u20444', u'1', u'1', u'1/4', u'1\u20444', u'1\u20445', u'3', u'ABC', u'K\u014cKAKO', u'\u014a\u01101\u204443\u0166 \u201c\xab\u0110\xd0', u'\u014a\u01101\u204443\u0166\u201c\xab\u0110\xd0', u'SORTTEST', u'SORTT\u0112ST11,', u'\u015aORTTEST2', u'\u015aORTTEST2', u'\u015a-O-R-T-T-E-S-T-2', u'SORTT\u0112ST2,', u'\u1e60ORTTEST4', u'\u1e60ORTTEST4', u'S\xd6RTTEST-5', u'S\xd6RTTEST-5', u'SO-RTTEST7,', u'SO-RTTEST7,', u'\u6851\u5df4', u'\u6851\u5df4', u'FO\x00OD', u'FO\x00OD']
+givenName = [u'A', u'A', u'B', u'B', u'C', u'C', u'D', u'D', u'E', u'E', u'F', u'F', u'G', u'G', u'H', u'I', u'J', u'K', u'L', u'M', u'N', u'O', u'P', u'Q', u'R', u'S', u'T', u'U', u'V', u'W', u'X', u'Y', u'Z']
+displayNamePrintable = ['0\x00\x00', '1\x00\x01', '10\x00\n', '11\x00\x0b', '12\x00\x0c', '13\x00\r', '14\x00\x0e', '15\x00\x0f', '16\x00\x10', '17\x00\x11', '18\x00\x12', '19\x00\x13', '2\x00\x02', '20\x00\x14', '21\x00\x15', '22\x00\x16', '23\x00\x17', '24\x00\x18', '25\x00\x19', '26\x00\x1a', '27\x00\x1b', '28\x00\x1c', '29\x00\x1d', '3\x00\x03', '30\x00\x1e', '31\x00\x1f', '32\x00 ', '4\x00\x04', '5\x00\x05', '6\x00\x06', '7\x00\x07', '8\x00\x08', '9\x00\t']
diff --git a/source4/scripting/bin/rpcclient b/source4/scripting/bin/rpcclient
index cbab0d53820..cabd2e36350 100755
--- a/source4/scripting/bin/rpcclient
+++ b/source4/scripting/bin/rpcclient
@@ -278,11 +278,11 @@ if __name__ == '__main__':
         options.username = '%'
 
     domain = ''
-    if string.find(options.username, '\\') != -1:
+    if options.username.find('\\') != -1:
         domain, options.username = string.split(options.username, '\\')
 
     password = ''
-    if string.find(options.username, '%') != -1:
+    if options.username.find('%') != -1:
         options.username, password  = string.split(options.username, '%')
 
     username = options.username
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index e8ff47c5ef4..00c252e67ab 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -869,7 +869,8 @@ plantestsuite_loadlist("samba4.ldap.match_rules.python", "ad_dc_ntvfs", [python,
 plantestsuite_loadlist("samba4.ldap.notification.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/notification.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
 plantestsuite_loadlist("samba4.ldap.sites.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
 
-plantestsuite_loadlist("samba4.ldap.sort.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sort.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
+planoldpythontestsuite("ad_dc_ntvfs", "sort", environ={'SERVER' : '$SERVER', 'DATA_DIR' : os.path.join(samba4srcdir, 'dsdb/tests/python/testdata/')}, name="samba4.ldap.sort.python", extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')], extra_args=['-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'], py3_compatible=True)
+
 plantestsuite_loadlist("samba4.ldap.vlv.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/vlv.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
 plantestsuite_loadlist("samba4.ldap.linked_attributes.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/linked_attributes.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list