selftest: enable py3 for samba.tests.dcerpc.rpcecho
authorJoe Guo <joeg@catalyst.net.nz>
Wed, 11 Apr 2018 04:38:03 +0000 (16:38 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:12 +0000 (07:27 +0200)
Prefix `b` for bytes.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/dcerpc/rpcecho.py
source4/selftest/tests.py

index 099f8f619ce57dfc1bdd511622c5ebf13bfdd7bc..33cb867f09c262aa8162ebb90100663a183aaf8d 100644 (file)
@@ -53,7 +53,7 @@ class RpcEchoTests(RpcInterfaceTestCase):
         self.assertEquals(8 * [0], y.surrounding)
 
     def test_manual_request(self):
-        self.assertEquals("\x01\x00\x00\x00", self.conn.request(0, chr(0) * 4))
+        self.assertEquals(b"\x01\x00\x00\x00", self.conn.request(0, chr(0) * 4))
 
     def test_server_name(self):
         self.assertEquals(None, self.conn.server_name)
@@ -64,8 +64,8 @@ class NdrEchoTests(TestCase):
     def test_info1_push(self):
         x = echo.info1()
         x.v = 42
-        self.assertEquals("\x2a", ndr_pack(x))
+        self.assertEquals(b"\x2a", ndr_pack(x))
 
     def test_info1_pull(self):
-        x = ndr_unpack(echo.info1, "\x42")
+        x = ndr_unpack(echo.info1, b"\x42")
         self.assertEquals(x.v, 66)
index 95058b1ea2c5211dc43c8ee19f1255ac1e362326..076c0e28f487a4e35aa97d1109cd2607d6262a1b 100755 (executable)
@@ -619,7 +619,7 @@ planpythontestsuite("none", "samba.tests.samba_tool.help")
 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.sites")
 planpythontestsuite("chgdcpass:local", "samba.tests.samba_tool.dnscmd")
 
-planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho")
+planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho", py3_compatible=True)
 
 planoldpythontestsuite("nt4_dc", "samba.tests.netbios", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
 planoldpythontestsuite("ad_dc:local", "samba.tests.gpo", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)