tests: Use binary mode for writing WPS attributes

This is needed for python3.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
Masashi Honma 2019-02-04 02:41:19 +02:00 committed by Jouni Malinen
parent 59aecb1c42
commit 4aa2336ed5

View file

@ -619,7 +619,7 @@ def test_ap_wps_reg_override_ap_settings(dev, apdev):
data += build_wsc_attr(ATTR_ENCR_TYPE, b'\x00\x01') data += build_wsc_attr(ATTR_ENCR_TYPE, b'\x00\x01')
data += build_wsc_attr(ATTR_NETWORK_KEY, b'') data += build_wsc_attr(ATTR_NETWORK_KEY, b'')
data += build_wsc_attr(ATTR_MAC_ADDR, binascii.unhexlify(apdev[1]['bssid'].replace(':', ''))) data += build_wsc_attr(ATTR_MAC_ADDR, binascii.unhexlify(apdev[1]['bssid'].replace(':', '')))
with open(ap_settings, "w") as f: with open(ap_settings, "wb") as f:
f.write(data) f.write(data)
ssid = "test-wps-reg-ap-pin" ssid = "test-wps-reg-ap-pin"
appin = "12345670" appin = "12345670"