From: Noel Power Date: Mon, 23 Apr 2018 17:22:08 +0000 (+0100) Subject: s4/selftest: enable samba.tests.samba_tool.user_wdigest for python3 X-Git-Tag: tdb-1.3.17~1926 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d29fdb02e6aeee9d229367dc2133cfaffc3bc8cd;p=thirdparty%2Fsamba.git s4/selftest: enable samba.tests.samba_tool.user_wdigest for python3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py index 0d13b30a3c9..640d478c813 100644 --- a/python/samba/netcmd/user.py +++ b/python/samba/netcmd/user.py @@ -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 diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index a353ffa5c15..4cf6acdfb57 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -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")