s4/selftest: enable samba.tests.samba_tool.user_wdigest for python3
authorNoel Power <noel.power@suse.com>
Mon, 23 Apr 2018 17:22:08 +0000 (18:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 3 Sep 2018 01:22:22 +0000 (03:22 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/user.py
source4/selftest/tests.py

index 0d13b30..640d478 100644 (file)
@@ -56,6 +56,7 @@ from samba.netcmd import (
 )
 from samba.compat import text_type
 from samba.compat import get_bytes
+from samba.compat import get_string
 
 try:
     import io
@@ -1169,7 +1170,7 @@ class GetPasswordCommand(Command):
                                  primary_wdigest)
             try:
                 digest = binascii.hexlify(bytearray(digests.hashes[i - 1].hash))
-                return "%s:%s:%s" % (user, realm, text_type(digest, 'utf8'))
+                return "%s:%s:%s" % (user, realm, get_string(digest))
             except IndexError:
                 return None
 
index a353ffa..4cf6acd 100755 (executable)
@@ -632,7 +632,7 @@ planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.gpo")
 
 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.processes", py3_compatible=True)
 planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user")
-planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user_wdigest")
+planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.samba_tool.user_wdigest",  py3_compatible=True)
 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user")
 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.user_virtualCryptSHA")
 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.user_check_password_script")