[PATCH v2 34/38] tests: Modify wnm test sets for python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Masashi Honma <masashi.honma@xxxxxxxxx>
---
 tests/hwsim/test_wnm.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py
index 192761633..60f9513aa 100644
--- a/tests/hwsim/test_wnm.py
+++ b/tests/hwsim/test_wnm.py
@@ -363,7 +363,8 @@ def test_wnm_sleep_mode_rsn_badocv(dev, apdev):
                                  ACTION_CATEG_WNM, WNM_ACT_SLEEP_MODE_REQ, 0,
                                  WLAN_EID_WNMSLEEP, 4, WNM_SLEEP_MODE_EXIT, 0, 0,
                                  WLAN_EID_TFS_REQ, 0)
-    mgmt_tx(dev[0], "MGMT_TX {} {} freq=2412 wait_time=200 no_cck=1 action={}".format(msg['da'], msg['bssid'], binascii.hexlify(msg['payload'])))
+    mgmt_tx(dev[0], "MGMT_TX {} {} freq=2412 wait_time=200 no_cck=1 action={}".format(
+        msg['da'], msg['bssid'], binascii.hexlify(msg['payload']).decode()))
     ev = hapd.wait_event([ "OCV failed" ], timeout=5)
     if ev is None:
         raise Exception("AP did not report missing OCI element")
@@ -377,7 +378,8 @@ def test_wnm_sleep_mode_rsn_badocv(dev, apdev):
     oci_ie = struct.pack("<BBB", 81, 2, 0)
     msg['payload'] += struct.pack("<BBB", WLAN_EID_EXTENSION, 1 + len(oci_ie),
                                   WLAN_EID_EXT_OCV_OCI) + oci_ie
-    mgmt_tx(dev[0], "MGMT_TX {} {} freq=2412 wait_time=200 no_cck=1 action={}".format(msg['da'], msg['bssid'] , binascii.hexlify(msg['payload'])))
+    mgmt_tx(dev[0], "MGMT_TX {} {} freq=2412 wait_time=200 no_cck=1 action={}".format(
+        msg['da'], msg['bssid'] , binascii.hexlify(msg['payload']).decode()))
     ev = hapd.wait_event([ "OCV failed" ], timeout=5)
     if ev is None:
         raise Exception("AP did not report bad OCI element")
@@ -703,7 +705,7 @@ def test_wnm_bss_tm_req(dev, apdev):
     # Preferred Candidate List followed by vendor element
     req = bss_tm_req(addr, apdev[0]['bssid'],
                      req_mode=0x01, dialog_token=8)
-    subelems = ""
+    subelems = bytes()
     req['payload'] += struct.pack("<BB6BLBBB", 52, 13 + len(subelems),
                                   1, 2, 3, 4, 5, 6,
                                   0, 81, 1, 7) + subelems
@@ -1963,11 +1965,11 @@ def test_wnm_coloc_intf_reporting(dev, apdev):
         vals = ev.split(' ')
         if vals[2] != '1' or vals[3] != '5':
             raise Exception("Unexpected request values: " + ev)
-        dev[0].set("coloc_intf_elems", binascii.hexlify(no_intf))
+        dev[0].set("coloc_intf_elems", binascii.hexlify(no_intf).decode())
         ev = hapd.wait_event(["COLOC-INTF-REPORT"], timeout=1)
         if ev is None:
             raise Exception("No Collocated Interference Report frame seen")
-        if addr + " 1 " + binascii.hexlify(no_intf) not in ev:
+        if addr + " 1 " + binascii.hexlify(no_intf).decode() not in ev:
             raise Exception("Unexpected report values: " + ev)
 
         if "OK" not in hapd.request("COLOC_INTF_REQ %s 0 0" % addr):
@@ -1979,13 +1981,13 @@ def test_wnm_coloc_intf_reporting(dev, apdev):
         if vals[2] != '0' or vals[3] != '0':
             raise Exception("Unexpected request values: " + ev)
 
-        res = dev[0].request("COLOC_INTF_REPORT " + binascii.hexlify(no_intf))
+        res = dev[0].request("COLOC_INTF_REPORT " + binascii.hexlify(no_intf).decode())
         if "OK" not in res:
             raise Exception("Could not send unsolicited report")
         ev = hapd.wait_event(["COLOC-INTF-REPORT"], timeout=1)
         if ev is None:
             raise Exception("No Collocated Interference Report frame seen")
-        if addr + " 0 " + binascii.hexlify(no_intf) not in ev:
+        if addr + " 0 " + binascii.hexlify(no_intf).decode() not in ev:
             raise Exception("Unexpected report values: " + ev)
     finally:
         dev[0].set("coloc_intf_reporting", "0")
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux