Signed-off-by: Masashi Honma <masashi.honma@xxxxxxxxx> --- tests/hwsim/test_wpas_ctrl.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index fece8f170..67d783a1f 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -11,6 +11,7 @@ import os import socket import subprocess import time +import binascii import hostapd import hwsim_utils @@ -872,7 +873,7 @@ def test_wpas_ctrl_disallow_aps(dev, apdev): raise Exception("Unexpected BSSID") dev[0].dump_monitor() - if "OK" not in dev[0].request("SET disallow_aps ssid " + "test".encode("hex")): + if "OK" not in dev[0].request("SET disallow_aps ssid " + binascii.hexlify("test".encode()).decode()): raise Exception("Failed to set disallow_aps") dev[0].wait_disconnected(timeout=5, error="Disconnection not seen") ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1) @@ -1617,7 +1618,7 @@ def test_wpas_ctrl_wait(dev, apdev, test_params): prg = '../../wpa_supplicant/wpa_supplicant' arg = [ prg ] cmd = subprocess.Popen(arg, stdout=subprocess.PIPE) - out = cmd.communicate()[0] + out = cmd.communicate()[0].decode() cmd.wait() tracing = "Linux tracing" in out @@ -1826,7 +1827,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): for i in range(20): logger.debug("Command %d" % i) try: - s.send("MIB") + s.send("MIB".encode()) except Exception as e: logger.info("Could not send command %d: %s" % (i, str(e))) break @@ -1845,7 +1846,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): for i in range(10): logger.debug("Command %d [2]" % i) try: - s2.send("MIB") + s2.send("MIB".encode()) except Exception as e: logger.info("Could not send command %d [2]: %s" % (i, str(e))) break @@ -1858,7 +1859,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): for i in range(10): logger.debug("Command %d [3]" % i) try: - s2.send("MIB") + s2.send("MIB".encode()) except Exception as e: logger.info("Could not send command %d [3]: %s" % (i, str(e))) break @@ -1877,8 +1878,8 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): counter += 1 s.bind(local) s.connect("/var/run/wpa_supplicant/wlan0") - s.send("ATTACH") - res = s.recv(100) + s.send("ATTACH".encode()) + res = s.recv(100).decode() if "OK" not in res: raise Exception("Could not attach a test socket") -- 2.17.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap