[PATCH v2 26/38] tests: Modify p2p_grpform 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_p2p_grpform.py  | 5 +++--
 tests/hwsim/test_p2p_messages.py | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py
index b967085f9..1fe56ecd3 100644
--- a/tests/hwsim/test_p2p_grpform.py
+++ b/tests/hwsim/test_p2p_grpform.py
@@ -1097,14 +1097,15 @@ def test_grpform_go_neg_dup_on_restart(dev):
     attrs = p2p_attr_capability(dev_capab=0x25, group_capab=0x08)
     attrs += p2p_attr_go_intent(go_intent=7, tie_breaker=1)
     attrs += p2p_attr_config_timeout()
-    attrs += p2p_attr_listen_channel(chan=(int(peer['listen_freq']) - 2407) / 5)
+    attrs += p2p_attr_listen_channel(chan=(int(peer['listen_freq']) - 2407) // 5)
     attrs += p2p_attr_intended_interface_addr(lower.p2p_dev_addr())
     attrs += p2p_attr_channel_list()
     attrs += p2p_attr_device_info(addr_low, config_methods=0x80, name="Device A")
     attrs += p2p_attr_operating_channel()
     wsc_attrs = struct.pack(">HHH", 0x1012, 2, 4)
     msg['payload'] += ie_p2p(attrs) + ie_wsc(wsc_attrs)
-    mgmt_tx(lower, "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(addr_high, addr_high, peer['listen_freq'], binascii.hexlify(msg['payload'])))
+    mgmt_tx(lower, "MGMT_TX {} {} freq={} wait_time=200 no_cck=1 action={}".format(
+        addr_high, addr_high, peer['listen_freq'], binascii.hexlify(msg['payload']).decode()))
 
     # Wait for the GO Negotiation Response frame which would have been sent in
     # this case previously, but not anymore after the check for
diff --git a/tests/hwsim/test_p2p_messages.py b/tests/hwsim/test_p2p_messages.py
index 7befbdce1..710522a30 100644
--- a/tests/hwsim/test_p2p_messages.py
+++ b/tests/hwsim/test_p2p_messages.py
@@ -85,7 +85,7 @@ def p2p_attr_device_info(addr, name="Test", config_methods=0, dev_type="00010050
     val2 = struct.unpack('8B', binascii.unhexlify(dev_type))
     t = (P2P_ATTR_DEVICE_INFO, 6 + 2 + 8 + 1 + 4 + len(name)) + val
     t2 = val2 + (0,)
-    return struct.pack("<BH6B", *t) + struct.pack(">H", config_methods) + struct.pack("8BB", *t2) + struct.pack('>HH', 0x1011, len(name)) +name
+    return struct.pack("<BH6B", *t) + struct.pack(">H", config_methods) + struct.pack("8BB", *t2) + struct.pack('>HH', 0x1011, len(name)) + name.encode()
 
 def p2p_attr_group_id(addr, ssid):
     val = struct.unpack('6B', binascii.unhexlify(addr.replace(':','')))
-- 
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