From patchwork Thu Jan 24 07:45:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b2y/lQdp"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AsQJTHTU"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lcs03qQJz9s55 for ; Thu, 24 Jan 2019 20:52:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZrLex9fgLoh88WSI9j6MKbhKnKIApZl29nj8l6WxMI8=; b=b2y/lQdp6eDK+ErhL8eDzy06+Z osmXAckXKgwESvsFfGKeOmot98siAJj0vWdLbyNn8Jonl1yN+K6CwGSXzfvlUutq5cRbSpGeSoAcc 8b6ccxtpebZlJ8ZpLs3NDwgH9c0sq9f9YJZG4Fno7cA6lp6dNWVDjJ9mqRiP4mY6eVIn5LVexbReS 32YpbIiUKHA92lozcIiemot/ZfiPs5RoU/+E3If4W3kdbD0hXy8a0+vTz05uSi/WnLbVKMAWXP3Ep TRN1RvJwCNh6N0wMu9dd9bSRwi/8+bqJIayUD+jnjZuvNpHDfqDYEv+z5D2g5ZAi1u4PIz4nCeChS uwaocV/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmbgM-0000wp-VD; Thu, 24 Jan 2019 09:52:22 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZiq-0005eK-Pm for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:07 +0000 Received: by mail-pl1-x634.google.com with SMTP id a14so2493847plm.12 for ; Wed, 23 Jan 2019 23:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5djrs6jWyhyWBFgG6PVZAZ1YPBWZBap1RcD8OOXpbow=; b=AsQJTHTUY5r2odF8QpMiGq6nJsd1QFmU2pmZ9KJMbEE1pmlePfOurNF2RKHvBpk8Tm pgeqr5tvvv1ebE9vfJn8JV8fURXMMGfLULjoTJECrqRiSa/57cRLrhlFycdDUP73w1WZ qpLGy2v4lTd7AktZN+NVmj95YD6hmDMRlQ81Reh+V0yNAxwNGGP9L+B3gK3aYpnBm7ZE Qsdy2w/+GiE0GgHlAhTX+WLuBjSYSKsAjx4iolUajicyDsL9FMwn0+tmrBVGg7e+0LSv S1NwY9CSJBTJP2M+/+wReQaTZCtl/+i1lZSphH4vAPB93Zlp5svpbZX+hSWzOO8tS8FU tpwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5djrs6jWyhyWBFgG6PVZAZ1YPBWZBap1RcD8OOXpbow=; b=hFWdsFruNOV+aXS672hU+lzXsn3IFJPGYKqOImkge2hrIAcplcOl3T/RMcw48ikGAL l/J7RmmQ2hFrE4ADbNU7lNexYt4/Ma8qISDYtpZ4azQzT23vzF0qk9GE6QwDguKgUHgZ +ha2kDTqPujozoLZErnTDseU7HHMZdTSd4gSKyE1t+gmz4V3b0en+iIcQLaJcJ1M0RjD wtuv4UbgV66tVLyFNceHW/XAONaCCyJtJko7fw0qD3COBOqH9GT8P8s+WzKDuqFQDZ38 p7t/iiFIOA2c9JCtBeoQH+/ublkoBF5QDTH8h8URxgAA2GZjTmsQTHDTRLW75KHFjfPN rx6g== X-Gm-Message-State: AJcUukfIKZ3ty8f9cu0F2+rMgxjmPIndEtS1QQyQScCShFrpe2VFU+K4 bDd6ishasI67tgLVbGLD2JfazJ+C X-Google-Smtp-Source: ALg8bN4JFFdq+Q0hQ0zApmVAJYHwDWyJT7lQWXZvkXHObXbd/qAnWRZThPmoHzvswQnOAUmDywS02A== X-Received: by 2002:a17:902:28c1:: with SMTP id f59mr5548801plb.37.1548316005240; Wed, 23 Jan 2019 23:46:45 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:44 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 01/50] tests: Use python3 compatible "except" statement Date: Thu, 24 Jan 2019 16:45:41 +0900 Message-Id: <20190124074630.4192-2-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-Spam-Note: CRM114 run bypassed due to message size (143273 bytes) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:634 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Mailman-Approved-At: Thu, 24 Jan 2019 01:52:21 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f except -w -n Signed-off-by: Masashi Honma --- hostapd/wps-ap-nfc.py | 12 +- tests/hwsim/fst_module_aux.py | 2 +- tests/hwsim/hwsim.py | 2 +- tests/hwsim/hwsim_utils.py | 2 +- tests/hwsim/p2p_utils.py | 4 +- tests/hwsim/run-tests.py | 28 +-- tests/hwsim/test_ap_ciphers.py | 4 +- tests/hwsim/test_ap_dynamic.py | 4 +- tests/hwsim/test_ap_eap.py | 4 +- tests/hwsim/test_ap_ft.py | 4 +- tests/hwsim/test_ap_hs20.py | 4 +- tests/hwsim/test_ap_open.py | 2 +- tests/hwsim/test_ap_params.py | 2 +- tests/hwsim/test_ap_pmf.py | 6 +- tests/hwsim/test_ap_tdls.py | 6 +- tests/hwsim/test_ap_vht.py | 32 +-- tests/hwsim/test_ap_vlan.py | 2 +- tests/hwsim/test_ap_wps.py | 26 +- tests/hwsim/test_dbus.py | 234 +++++++++--------- tests/hwsim/test_dbus_old.py | 52 ++-- tests/hwsim/test_fils.py | 2 +- tests/hwsim/test_fst_config.py | 4 +- tests/hwsim/test_fst_module.py | 46 ++-- tests/hwsim/test_hostapd_oom.py | 4 +- tests/hwsim/test_ibss.py | 8 +- tests/hwsim/test_macsec.py | 2 +- tests/hwsim/test_mbo.py | 2 +- tests/hwsim/test_ocv.py | 8 +- tests/hwsim/test_p2p_channel.py | 2 +- tests/hwsim/test_rfkill.py | 2 +- tests/hwsim/test_rrm.py | 6 +- tests/hwsim/test_wext.py | 2 +- tests/hwsim/test_wmediumd.py | 4 +- tests/hwsim/test_wnm.py | 4 +- tests/hwsim/test_wpas_ctrl.py | 8 +- tests/hwsim/test_wpas_mesh.py | 6 +- tests/hwsim/test_wpas_wmm_ac.py | 14 +- tests/hwsim/tshark.py | 6 +- tests/hwsim/wlantest.py | 2 +- tests/hwsim/wpasupplicant.py | 4 +- tests/remote/run-tests.py | 12 +- wpa_supplicant/examples/dpp-qrcode.py | 4 +- wpa_supplicant/examples/p2p-nfc.py | 28 +-- wpa_supplicant/examples/p2p/p2p_connect.py | 4 +- wpa_supplicant/examples/p2p/p2p_disconnect.py | 2 +- wpa_supplicant/examples/p2p/p2p_find.py | 2 +- wpa_supplicant/examples/p2p/p2p_flush.py | 2 +- wpa_supplicant/examples/p2p/p2p_group_add.py | 2 +- wpa_supplicant/examples/p2p/p2p_invite.py | 2 +- wpa_supplicant/examples/p2p/p2p_listen.py | 2 +- wpa_supplicant/examples/p2p/p2p_stop_find.py | 2 +- wpa_supplicant/examples/wpas-dbus-new.py | 4 +- wpa_supplicant/examples/wpas-test.py | 4 +- wpa_supplicant/examples/wps-nfc.py | 20 +- wpaspy/test.py | 4 +- 55 files changed, 331 insertions(+), 331 deletions(-) diff --git a/hostapd/wps-ap-nfc.py b/hostapd/wps-ap-nfc.py index 2fc301296..9e24d6088 100755 --- a/hostapd/wps-ap-nfc.py +++ b/hostapd/wps-ap-nfc.py @@ -42,7 +42,7 @@ def wpas_connect(): if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] - except OSError, error: + except OSError as error: print "Could not find hostapd: ", error return None @@ -54,7 +54,7 @@ def wpas_connect(): try: wpas = wpaspy.Ctrl(ctrl) return wpas - except Exception, e: + except Exception as e: pass return None @@ -134,7 +134,7 @@ class HandoverServer(nfc.handover.HandoverServer): summary("HandoverServer - request received") try: print "Parsed handover request: " + request.pretty() - except Exception, e: + except Exception as e: print e print str(request).encode("hex") @@ -161,7 +161,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "Handover select:" try: print sel.pretty() - except Exception, e: + except Exception as e: print e print str(sel).encode("hex") @@ -236,7 +236,7 @@ def rdwr_connected(tag): print "NDEF tag: " + tag.type try: print tag.ndef.message.pretty() - except Exception, e: + except Exception as e: print e success = wps_tag_read(tag) if only_one and success: @@ -324,7 +324,7 @@ def main(): llcp={'on-startup': llcp_startup, 'on-connect': llcp_connected}): break - except Exception, e: + except Exception as e: print "clf.connect failed" global srv diff --git a/tests/hwsim/fst_module_aux.py b/tests/hwsim/fst_module_aux.py index 9fd838fd5..d929134e0 100644 --- a/tests/hwsim/fst_module_aux.py +++ b/tests/hwsim/fst_module_aux.py @@ -629,7 +629,7 @@ class FstAP (FstDevice): self.remove_all_sessions() try: self.send_iface_detach_request(self.iface) - except Exception, e: + except Exception as e: logger.info(str(e)) self.reg_ctrl.stop() del self.global_instance diff --git a/tests/hwsim/hwsim.py b/tests/hwsim/hwsim.py index e21c814f2..23bfe32e9 100644 --- a/tests/hwsim/hwsim.py +++ b/tests/hwsim/hwsim.py @@ -65,7 +65,7 @@ class HWSimRadio(object): raise Exception("Failed to create radio (err:%d)" % self._radio_id) try: iface = os.listdir('/sys/class/mac80211_hwsim/hwsim%d/net/' % self._radio_id)[0] - except Exception,e: + except Exception as e: self._controller.destroy_radio(self._radio_id) raise e return self._radio_id, iface diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py index 718d53f46..8ad08fcd5 100644 --- a/tests/hwsim/hwsim_utils.py +++ b/tests/hwsim/hwsim_utils.py @@ -198,7 +198,7 @@ def test_connectivity(dev1, dev2, dscp=None, tos=None, max_tries=1, broadcast=broadcast, send_len=send_len) success = True break - except Exception, e: + except Exception as e: last_err = e if i + 1 < max_tries: time.sleep(1) diff --git a/tests/hwsim/p2p_utils.py b/tests/hwsim/p2p_utils.py index f72865253..1a4646dc7 100644 --- a/tests/hwsim/p2p_utils.py +++ b/tests/hwsim/p2p_utils.py @@ -227,7 +227,7 @@ def go_neg_init(i_dev, r_dev, pin, i_method, i_intent, res): try: i_res = i_dev.p2p_go_neg_init(r_dev.p2p_dev_addr(), pin, i_method, timeout=20, go_intent=i_intent) logger.debug("i_res: " + str(i_res)) - except Exception, e: + except Exception as e: i_res = None logger.info("go_neg_init thread caught an exception from p2p_go_neg_init: " + str(e)) res.put(i_res) @@ -305,7 +305,7 @@ def go_neg_init_pbc(i_dev, r_dev, i_intent, res, freq, provdisc): timeout=20, go_intent=i_intent, freq=freq, provdisc=provdisc) logger.debug("i_res: " + str(i_res)) - except Exception, e: + except Exception as e: i_res = None logger.info("go_neg_init_pbc thread caught an exception from p2p_go_neg_init: " + str(e)) res.put(i_res) diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 4f5fb4e09..1649f3fdb 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -47,7 +47,7 @@ def reset_devs(dev, apdev): for d in dev: try: d.reset() - except Exception, e: + except Exception as e: logger.info("Failed to reset device " + d.ifname) print str(e) ok = False @@ -59,7 +59,7 @@ def reset_devs(dev, apdev): for iface in ifaces: if iface.startswith("wlan"): wpas.interface_remove(iface) - except Exception, e: + except Exception as e: pass if wpas: wpas.close_ctrl() @@ -74,7 +74,7 @@ def reset_devs(dev, apdev): hapd.remove('wlan3-2') for ap in apdev: hapd.remove(ap['ifname']) - except Exception, e: + except Exception as e: logger.info("Failed to remove hostapd interface") print str(e) ok = False @@ -93,7 +93,7 @@ def add_log_file(conn, test, run, type, path): try: conn.execute(sql, params) conn.commit() - except Exception, e: + except Exception as e: print "sqlite: " + str(e) print "sql: %r" % (params, ) @@ -112,7 +112,7 @@ def report(conn, prefill, build, commit, run, test, result, duration, logdir, conn.execute(sql, params) if sql_commit: conn.commit() - except Exception, e: + except Exception as e: print "sqlite: " + str(e) print "sql: %r" % (params, ) @@ -180,7 +180,7 @@ def rename_log(logdir, basename, testname, dev): if dev: dev.relog() subprocess.call(['chown', '-f', getpass.getuser(), srcname]) - except Exception, e: + except Exception as e: logger.info("Failed to rename log files") logger.info(e) @@ -303,7 +303,7 @@ def main(): params = (name, t.__doc__) try: conn.execute(sql, params) - except Exception, e: + except Exception as e: print "sqlite: " + str(e) print "sql: %r" % (params,) if conn: @@ -477,7 +477,7 @@ def main(): if not d.global_ping(): raise Exception("Global PING failed for {}".format(d.ifname)) d.request("NOTE TEST-START " + name) - except Exception, e: + except Exception as e: logger.info("Failed to issue TEST-START before " + name + " for " + d.ifname) logger.info(e) print "FAIL " + name + " - could not start test" @@ -522,15 +522,15 @@ def main(): print "Country code remains set - expect following test cases to fail" logger.info("Country code remains set - expect following test cases to fail") break - except HwsimSkip, e: + except HwsimSkip as e: logger.info("Skip test case: %s" % e) result = "SKIP" - except NameError, e: + except NameError as e: import traceback logger.info(e) traceback.print_exc() result = "FAIL" - except Exception, e: + except Exception as e: import traceback logger.info(e) traceback.print_exc() @@ -542,7 +542,7 @@ def main(): try: d.dump_monitor() d.request("NOTE TEST-STOP " + name) - except Exception, e: + except Exception as e: logger.info("Failed to issue TEST-STOP after {} for {}".format(name, d.ifname)) logger.info(e) result = "FAIL" @@ -556,7 +556,7 @@ def main(): rename_log(args.logdir, 'log5', name, wpas) if not args.no_reset: wpas.remove_ifname() - except Exception, e: + except Exception as e: pass if wpas: wpas.close_ctrl() @@ -565,7 +565,7 @@ def main(): rename_log(args.logdir, 'log' + str(i), name, dev[i]) try: hapd = HostapdGlobal() - except Exception, e: + except Exception as e: print "Failed to connect to hostapd interface" print str(e) reset_ok = False diff --git a/tests/hwsim/test_ap_ciphers.py b/tests/hwsim/test_ap_ciphers.py index abed26fe5..8e5b2d68b 100644 --- a/tests/hwsim/test_ap_ciphers.py +++ b/tests/hwsim/test_ap_ciphers.py @@ -485,7 +485,7 @@ def get_rx_spec(phy, gtk=False): continue with open(keydir + "/rx_spec") as f: return f.read() - except OSError, e: + except OSError as e: raise HwsimSkip("debugfs not supported in mac80211") return None @@ -501,7 +501,7 @@ def get_tk_replay_counter(phy, gtk=False): continue with open(keydir + "/replays") as f: return int(f.read()) - except OSError, e: + except OSError as e: raise HwsimSkip("debugfs not supported in mac80211") return None diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 2fef02191..9b6ba11a6 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -206,7 +206,7 @@ def invalid_ap(ap): try: hapd.enable() started = True - except Exception, e: + except Exception as e: started = False if started: raise Exception("ENABLE command succeeded unexpectedly") @@ -516,7 +516,7 @@ def test_ap_duplicate_bssid(dev, apdev): try: hostapd.add_bss(apdev[0], ifname2, 'bss-2-dup.conf') raise Exception("BSS add succeeded unexpectedly") - except Exception, e: + except Exception as e: if "Could not add hostapd BSS" in str(e): pass else: diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 0fa64e235..4d7fcb9b5 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -2881,7 +2881,7 @@ def test_ap_wpa2_eap_eke_server_oom(dev, apdev): if hapd.request("GET_ALLOC_FAIL").startswith('0'): break dev[0].request("REMOVE_NETWORK all") - except Exception, e: + except Exception as e: if str(e) == "Allocation failure did not trigger": if count < 30: raise Exception("Too few allocation failures") @@ -3699,7 +3699,7 @@ def test_ap_wpa2_eap_fast_cipher_suites(dev, apdev): ca_cert="auth_serv/ca.pem", phase2="auth=GTC", pac_file="blob://fast_pac_ciphers", report_failure=True) - except Exception, e: + except Exception as e: if cipher == "RC4-SHA" and \ ("Could not select EAP method" in str(e) or \ "EAP failed" in str(e)): diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 6ab4f8ca2..2de21d498 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -446,7 +446,7 @@ def test_ap_ft_ocv(dev, apdev): params["ocv"] = "1" try: hapd0 = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -582,7 +582,7 @@ def test_ap_ft_over_ds_ocv(dev, apdev): params["ocv"] = "1" try: hapd0 = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 99a01a92d..ec5ac026b 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -4853,7 +4853,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): try: hwsim_utils.test_connectivity_iface(dev[0], hapd, "ap-br0") - except Exception, e: + except Exception as e: logger.info("test_connectibity_iface failed: " + str(e)) raise HwsimSkip("Assume kernel did not have the required patches for proxyarp") hwsim_utils.test_connectivity_iface(dev[1], hapd, "ap-br0") @@ -5110,7 +5110,7 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False): try: hwsim_utils.test_connectivity_iface(dev[0], hapd, "ap-br0") - except Exception, e: + except Exception as e: logger.info("test_connectibity_iface failed: " + str(e)) raise HwsimSkip("Assume kernel did not have the required patches for proxyarp") hwsim_utils.test_connectivity_iface(dev[1], hapd, "ap-br0") diff --git a/tests/hwsim/test_ap_open.py b/tests/hwsim/test_ap_open.py index de7c6d416..390792535 100644 --- a/tests/hwsim/test_ap_open.py +++ b/tests/hwsim/test_ap_open.py @@ -330,7 +330,7 @@ def _test_ap_open_wpas_in_bridge(dev, apdev): try: wpas.interface_add(ifname, br_ifname=br_ifname) raise Exception("Interface addition succeeded unexpectedly") - except Exception, e: + except Exception as e: if "Failed to add" in str(e): logger.info("Ignore expected interface_add failure due to missing bridge interface: " + str(e)) else: diff --git a/tests/hwsim/test_ap_params.py b/tests/hwsim/test_ap_params.py index a39bfcee2..16da15ae4 100644 --- a/tests/hwsim/test_ap_params.py +++ b/tests/hwsim/test_ap_params.py @@ -666,7 +666,7 @@ def test_ap_missing_psk(dev, apdev): # "WPA-PSK enabled, but PSK or passphrase is not configured." hostapd.add_ap(apdev[0], params) raise Exception("AP setup succeeded unexpectedly") - except Exception, e: + except Exception as e: if "Failed to enable hostapd" in str(e): pass else: diff --git a/tests/hwsim/test_ap_pmf.py b/tests/hwsim/test_ap_pmf.py index e2f6529b2..071f9e629 100644 --- a/tests/hwsim/test_ap_pmf.py +++ b/tests/hwsim/test_ap_pmf.py @@ -67,7 +67,7 @@ def test_ocv_sa_query(dev, apdev): params["ocv"] = "1" try: hapd = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -104,7 +104,7 @@ def test_ocv_sa_query_csa(dev, apdev): params["ocv"] = "1" try: hapd = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -194,7 +194,7 @@ def test_ap_pmf_negative(dev, apdev): scan_freq="2412") hwsim_utils.test_connectivity(dev[1], hapd) raise Exception("PMF required STA connected to no PMF AP") - except Exception, e: + except Exception as e: logger.debug("Ignore expected exception: " + str(e)) wt.require_ap_no_pmf(apdev[0]['bssid']) diff --git a/tests/hwsim/test_ap_tdls.py b/tests/hwsim/test_ap_tdls.py index 2d1fc2cf5..bba2bacf3 100644 --- a/tests/hwsim/test_ap_tdls.py +++ b/tests/hwsim/test_ap_tdls.py @@ -428,7 +428,7 @@ def test_ap_open_tdls_vht80(dev, apdev): res = cmd.stdout.read() cmd.stdout.close() logger.info("Station dump on dev[%d]:\n%s" % (i, res)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -472,7 +472,7 @@ def test_ap_open_tdls_vht80plus80(dev, apdev): res = cmd.stdout.read() cmd.stdout.close() logger.info("Station dump on dev[%d]:\n%s" % (i, res)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -516,7 +516,7 @@ def test_ap_open_tdls_vht160(dev, apdev): res = cmd.stdout.read() cmd.stdout.close() logger.info("Station dump on dev[%d]:\n%s" % (i, res)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py index 1e1583976..d1fc0e830 100644 --- a/tests/hwsim/test_ap_vht.py +++ b/tests/hwsim/test_ap_vht.py @@ -74,7 +74,7 @@ def test_ap_vht80(dev, apdev): raise Exception("Missing STA flag: HT") if "[VHT]" not in sta['flags']: raise Exception("Missing STA flag: VHT") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -104,7 +104,7 @@ def vht80_test(apdev, dev, channel, ht_capab): dev.connect("vht", key_mgmt="NONE", scan_freq=str(5000 + 5 * channel)) hwsim_utils.test_connectivity(dev, hapd) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -165,7 +165,7 @@ def test_ap_vht80_params(dev, apdev): raise Exception("dev[0] did not support SGI") if capab2 & 0x60 != 0: raise Exception("dev[2] claimed support for SGI") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -194,7 +194,7 @@ def test_ap_vht80_invalid(dev, apdev): ev = hapd.wait_event(["AP-DISABLED"], timeout=5) if ev is None: raise Exception("AP-DISABLED not reported") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -225,7 +225,7 @@ def test_ap_vht80_invalid2(dev, apdev): ev = hapd.wait_event(["AP-DISABLED"], timeout=5) if ev is None: raise Exception("AP-DISABLED not reported") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -371,7 +371,7 @@ def test_ap_vht160(dev, apdev): raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig)) if "WIDTH=160 MHz" not in sig: raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -445,7 +445,7 @@ def test_ap_vht160b(dev, apdev): raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig)) if "WIDTH=160 MHz" not in sig: raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -525,7 +525,7 @@ def run_ap_vht160_no_dfs(dev, apdev, channel, ht_capab): raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig)) if "WIDTH=160 MHz" not in sig: raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -567,7 +567,7 @@ def test_ap_vht160_no_ht40(dev, apdev): if "AP-ENABLED" in ev: # This was supposed to fail due to sec_channel_offset == 0 raise Exception("Unexpected AP-ENABLED") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -634,7 +634,7 @@ def test_ap_vht80plus80(dev, apdev): raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig)) if "CENTER_FRQ2=5775" not in sig: raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig)) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -671,7 +671,7 @@ def test_ap_vht80plus80_invalid(dev, apdev): ev = hapd.wait_event(["AP-DISABLED"], timeout=5) if ev is None: raise Exception("AP-DISABLED not reported") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80/160 MHz channel not supported in regulatory information") @@ -723,7 +723,7 @@ def test_ap_vht80_csa(dev, apdev): # extra code coverage. hapd.request("CHAN_SWITCH 5 5745") hapd.wait_event(["AP-CSA-FINISHED"], timeout=1) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -969,7 +969,7 @@ def test_ap_vht80_pwr_constraint(dev, apdev): dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180") dev[0].wait_regdom(country_ie=True) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -1003,7 +1003,7 @@ def test_ap_vht_use_sta_nsts(dev, apdev): dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180") hwsim_utils.test_connectivity(dev[0], hapd) - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -1050,7 +1050,7 @@ def test_ap_vht_tkip(dev, apdev): raise Exception("Unexpected STATUS ieee80211ac value") if status["secondary_channel"] != "0": raise Exception("Unexpected STATUS secondary_channel value") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -1122,7 +1122,7 @@ def test_ap_vht80_to_24g_ht(dev, apdev): hapd.enable() dev[0].connect("vht", key_mgmt="NONE", scan_freq="2412") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py index 62e1d32b1..bde4338a3 100644 --- a/tests/hwsim/test_ap_vlan.py +++ b/tests/hwsim/test_ap_vlan.py @@ -294,7 +294,7 @@ def generic_ap_vlan_wpa2_radius_id_change(dev, apdev, tagged): ifname2="brvlan1") else: hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan1") - except Exception, e: + except Exception as e: # It is possible for new bridge setup to not be ready immediately, so # try again to avoid reporting issues related to that. logger.info("First VLAN-ID 1 data test failed - try again") diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index b8fcfb320..ad72faf7f 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -2329,7 +2329,7 @@ def test_ap_wps_auto_setup_with_config_file(dev, apdev): try: [name,value] = l.split('=', 1) vals[name] = value - except ValueError, e: + except ValueError as e: if "# WPS configuration" in l: pass else: @@ -3322,7 +3322,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): try: conn.request(cmd, "hello") resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3330,7 +3330,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("HEAD", "hello", "\r\n\r\n", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3338,7 +3338,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("HEAD", "hello", "\r\n\r\n", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3346,7 +3346,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("HEAD", "hello", "\r\n\r\nhello", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3368,7 +3368,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("HEAD", 5000 * 'A') try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3383,7 +3383,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("POST", "hello", 10 * 'A' + "\r\n\r\n", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3396,7 +3396,7 @@ def test_ap_wps_upnp_http_proto(dev, apdev): conn.request("POST", "hello", 60000 * 'A' + "\r\n\r\n") try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -3442,7 +3442,7 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): conn.send("0\r\n\r\n") resp = conn.getresponse() completed = True - except Exception, e: + except Exception as e: pass conn.close() if completed: @@ -3452,14 +3452,14 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): conn.request("POST", "hello", "80000000\r\na", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() conn.request("POST", "hello", "10000000\r\na", headers) try: resp = conn.getresponse() - except Exception, e: + except Exception as e: pass conn.close() @@ -4203,7 +4203,7 @@ def send_wlanevent(url, uuid, data, no_response=False): if no_response: try: conn.getresponse() - except Exception, e: + except Exception as e: pass return resp = conn.getresponse() @@ -5127,7 +5127,7 @@ def wps_run_pbc_fail_ap(apdev, dev, hapd): try: dev.flush_scan_cache() break - except Exception, e: + except Exception as e: if str(e).startswith("Failed to trigger scan"): # Try again time.sleep(1) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index 3baca4c54..e0703fae0 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -51,7 +51,7 @@ def prepare_dbus(dev): path = wpas.GetInterface(dev.ifname) if_obj = bus.get_object(WPAS_DBUS_SERVICE, path) return (bus,wpas_obj,path,if_obj) - except Exception, e: + except Exception as e: raise HwsimSkip("Could not connect to D-Bus: %s" % e) class TestDbus(object): @@ -182,7 +182,7 @@ def test_dbus_getall_oom(dev, apdev): try: props = net_obj.GetAll(WPAS_DBUS_NETWORK, dbus_interface=dbus.PROPERTIES_IFACE) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass def dbus_get(dbus, wpas_obj, prop, expect=None, byte_arrays=False): @@ -210,7 +210,7 @@ def test_dbus_properties(dev, apdev): try: dbus_set(dbus, wpas_obj, "DebugLevel", val) raise Exception("Invalid DebugLevel value accepted: " + str(val)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message: " + str(e)) dbus_set(dbus, wpas_obj, "DebugLevel", "msgdump") @@ -222,7 +222,7 @@ def test_dbus_properties(dev, apdev): try: dbus_set(dbus, wpas_obj, "DebugTimestamp", "foo") raise Exception("Invalid DebugTimestamp value accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message: " + str(e)) dbus_set(dbus, wpas_obj, "DebugTimestamp", True) @@ -234,7 +234,7 @@ def test_dbus_properties(dev, apdev): try: dbus_set(dbus, wpas_obj, "DebugShowKeys", "foo") raise Exception("Invalid DebugShowKeys value accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message: " + str(e)) dbus_set(dbus, wpas_obj, "DebugShowKeys", True) @@ -261,7 +261,7 @@ def test_dbus_properties(dev, apdev): try: dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray('\x00')) raise Exception("Invalid WFDIEs value accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message: " + str(e)) dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray('')) @@ -275,7 +275,7 @@ def test_dbus_properties(dev, apdev): try: dbus_set(dbus, wpas_obj, "EapMethods", res) raise Exception("Invalid Set accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: Property is read-only" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -283,7 +283,7 @@ def test_dbus_properties(dev, apdev): wpas_obj.SetFoo(WPAS_DBUS_SERVICE, "DebugShowKeys", True, dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Unknown method accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownMethod" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -291,7 +291,7 @@ def test_dbus_properties(dev, apdev): wpas_obj.Get("foo", "DebugShowKeys", dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Get accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: No such property" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -301,14 +301,14 @@ def test_dbus_properties(dev, apdev): test_obj.Get(123, "DebugShowKeys", dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Get accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: Invalid arguments" not in str(e): raise Exception("Unexpected error message: " + str(e)) try: test_obj.Get(WPAS_DBUS_SERVICE, 123, dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Get accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: Invalid arguments" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -317,7 +317,7 @@ def test_dbus_properties(dev, apdev): dbus.ByteArray('', variant_level=2), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: invalid message format" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -351,7 +351,7 @@ def test_dbus_invalid_method(dev, apdev): try: wps.Foo() raise Exception("Unknown method accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownMethod" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -360,7 +360,7 @@ def test_dbus_invalid_method(dev, apdev): try: test_wps.Start(123) raise Exception("WPS.Start with incorrect signature accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs: Invalid arg" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -537,7 +537,7 @@ def test_dbus_wps_invalid(dev, apdev): try: wps.Start(args) raise Exception("Invalid WPS.Start() arguments accepted: " + str(args)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.w1.wpa_supplicant1.InvalidArgs"): raise Exception("Unexpected error message: " + str(e)) @@ -571,7 +571,7 @@ def test_dbus_wps_oom(dev, apdev): try: bss_obj.Get(WPAS_DBUS_BSS, "Rates", dbus_interface=dbus.PROPERTIES_IFACE) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass id = dev[0].add_network() @@ -1031,7 +1031,7 @@ def test_dbus_scan_invalid(dev, apdev): try: iface.Scan(t) raise Exception("Invalid Scan() arguments accepted: " + str(t)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message for invalid Scan(%s): %s" % (str(t), str(e))) @@ -1162,7 +1162,7 @@ def test_dbus_scan_busy(dev, apdev): try: iface.Scan({'Type': 'active', 'AllowRoam': False}) raise Exception("Scan() accepted when busy") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "ScanError: Scan request reject" not in str(e): raise Exception("Unexpected error message: " + str(e)) @@ -1436,13 +1436,13 @@ def test_dbus_connect_oom(dev, apdev): signature='sv') try: self.netw = iface.AddNetwork(args) - except Exception, e: + except Exception as e: logger.info("Exception on AddNetwork: " + str(e)) self.loop.quit() return False try: iface.SelectNetwork(self.netw) - except Exception, e: + except Exception as e: logger.info("Exception on SelectNetwork: " + str(e)) self.loop.quit() @@ -1499,14 +1499,14 @@ def test_dbus_while_not_connected(dev, apdev): try: iface.Disconnect() raise Exception("Disconnect() accepted when not connected") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NotConnected" not in str(e): raise Exception("Unexpected error message for invalid Disconnect: " + str(e)) try: iface.Reattach() raise Exception("Reattach() accepted when not connected") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NotConnected" not in str(e): raise Exception("Unexpected error message for invalid Reattach: " + str(e)) @@ -1661,13 +1661,13 @@ def test_dbus_network(dev, apdev): try: iface.RemoveNetwork(netw) raise Exception("Invalid RemoveNetwork() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NetworkUnknown" not in str(e): raise Exception("Unexpected error message for invalid RemoveNetwork: " + str(e)) try: iface.SelectNetwork(netw) raise Exception("Invalid SelectNetwork() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NetworkUnknown" not in str(e): raise Exception("Unexpected error message for invalid RemoveNetwork: " + str(e)) @@ -1704,7 +1704,7 @@ def test_dbus_network(dev, apdev): net_obj.Set(WPAS_DBUS_NETWORK, "Enabled", dbus.UInt32(1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(Enabled,1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(Enabled,1): " + str(e)) @@ -1734,7 +1734,7 @@ def test_dbus_network(dev, apdev): try: iface.AddNetwork(args) raise Exception("Invalid AddNetwork args accepted: " + str(args)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid AddNetwork: " + str(e)) @@ -1770,7 +1770,7 @@ def test_dbus_network_oom(dev, apdev): # Currently, AddNetwork() succeeds even if os_strdup() for path # fails, so remove the network if that occurs. iface.RemoveNetwork(netw) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass for i in range(1, 3): @@ -1780,7 +1780,7 @@ def test_dbus_network_oom(dev, apdev): # Currently, AddNetwork() succeeds even if network registration # fails, so remove the network if that occurs. iface.RemoveNetwork(netw) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass with alloc_fail_dbus(dev[0], 1, @@ -1857,7 +1857,7 @@ def _test_dbus_interface(dev, apdev): try: wpas.CreateInterface(params) raise Exception("Invalid CreateInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InterfaceExists" not in str(e): raise Exception("Unexpected error message for invalid CreateInterface: " + str(e)) @@ -1865,7 +1865,7 @@ def _test_dbus_interface(dev, apdev): try: wpas.RemoveInterface(path) raise Exception("Invalid RemoveInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InterfaceUnknown" not in str(e): raise Exception("Unexpected error message for invalid RemoveInterface: " + str(e)) @@ -1875,7 +1875,7 @@ def _test_dbus_interface(dev, apdev): try: wpas.CreateInterface(params) raise Exception("Invalid CreateInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid CreateInterface: " + str(e)) @@ -1883,14 +1883,14 @@ def _test_dbus_interface(dev, apdev): try: wpas.CreateInterface(params) raise Exception("Invalid CreateInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid CreateInterface: " + str(e)) try: wpas.GetInterface("lo") raise Exception("Invalid GetInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InterfaceUnknown" not in str(e): raise Exception("Unexpected error message for invalid RemoveInterface: " + str(e)) @@ -1920,7 +1920,7 @@ def test_dbus_interface_oom(dev, apdev): raise Exception("CreateInterface succeeded during out-of-memory") if not state.startswith('0:'): break - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass for arg in [ 'Driver', 'Ifname', 'ConfigFile', 'BridgeIfname' ]: @@ -1939,7 +1939,7 @@ def test_dbus_blob(dev, apdev): try: iface.AddBlob('blob1', dbus.ByteArray("\x01\x02\x04")) raise Exception("Invalid AddBlob() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "BlobExists" not in str(e): raise Exception("Unexpected error message for invalid AddBlob: " + str(e)) res = iface.GetBlob('blob1') @@ -1956,13 +1956,13 @@ def test_dbus_blob(dev, apdev): try: iface.RemoveBlob('blob1') raise Exception("Invalid RemoveBlob() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "BlobUnknown" not in str(e): raise Exception("Unexpected error message for invalid RemoveBlob: " + str(e)) try: iface.GetBlob('blob1') raise Exception("Invalid GetBlob() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "BlobUnknown" not in str(e): raise Exception("Unexpected error message for invalid GetBlob: " + str(e)) @@ -2045,14 +2045,14 @@ def test_dbus_tdls_invalid(dev, apdev): try: iface.TDLSDiscover("foo") raise Exception("Invalid TDLSDiscover() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSDiscover: " + str(e)) try: iface.TDLSStatus("foo") raise Exception("Invalid TDLSStatus() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSStatus: " + str(e)) @@ -2063,35 +2063,35 @@ def test_dbus_tdls_invalid(dev, apdev): try: iface.TDLSSetup("foo") raise Exception("Invalid TDLSSetup() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSSetup: " + str(e)) try: iface.TDLSTeardown("foo") raise Exception("Invalid TDLSTeardown() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSTeardown: " + str(e)) try: iface.TDLSTeardown("00:11:22:33:44:55") raise Exception("TDLSTeardown accepted for unknown peer") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: error performing TDLS teardown" not in str(e): raise Exception("Unexpected error message: " + str(e)) try: iface.TDLSChannelSwitch({}) raise Exception("Invalid TDLSChannelSwitch() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSChannelSwitch: " + str(e)) try: iface.TDLSCancelChannelSwitch("foo") raise Exception("Invalid TDLSCancelChannelSwitch() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid TDLSCancelChannelSwitch: " + str(e)) @@ -2227,7 +2227,7 @@ def test_dbus_tdls_channel_switch(dev, apdev): signature='sv') try: iface.TDLSChannelSwitch(args) - except Exception, e: + except Exception as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected exception") @@ -2235,7 +2235,7 @@ def test_dbus_tdls_channel_switch(dev, apdev): args = dbus.Dictionary({}, signature='sv') try: iface.TDLSChannelSwitch(args) - except Exception, e: + except Exception as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected exception") @@ -2244,7 +2244,7 @@ def test_dbus_tdls_channel_switch(dev, apdev): signature='sv') try: iface.TDLSChannelSwitch(args) - except Exception, e: + except Exception as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected exception") @@ -2254,7 +2254,7 @@ def test_dbus_tdls_channel_switch(dev, apdev): signature='sv') try: iface.TDLSChannelSwitch(args) - except Exception, e: + except Exception as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected exception") @@ -2295,13 +2295,13 @@ def test_dbus_pkcs11(dev, apdev): try: iface.SetPKCS11EngineAndModulePath("foo", "bar") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: Reinit of the EAPOL" not in str(e): raise Exception("Unexpected error message for invalid SetPKCS11EngineAndModulePath: " + str(e)) try: iface.SetPKCS11EngineAndModulePath("foo", "") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: Reinit of the EAPOL" not in str(e): raise Exception("Unexpected error message for invalid SetPKCS11EngineAndModulePath: " + str(e)) @@ -2352,7 +2352,7 @@ def _test_dbus_apscan(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "ApScan", dbus.Int16(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(ApScan,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(ApScan,-1): " + str(e)) @@ -2360,7 +2360,7 @@ def _test_dbus_apscan(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "ApScan", dbus.UInt32(123), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(ApScan,123) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: ap_scan must be 0, 1, or 2" not in str(e): raise Exception("Unexpected error message for invalid Set(ApScan,123): " + str(e)) @@ -2415,7 +2415,7 @@ def test_dbus_fastreauth(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "FastReauth", dbus.Int16(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(FastReauth,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(ApScan,-1): " + str(e)) @@ -2444,7 +2444,7 @@ def test_dbus_bss_expire(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "BSSExpireAge", dbus.Int16(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(BSSExpireAge,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(BSSExpireAge,-1): " + str(e)) @@ -2452,7 +2452,7 @@ def test_dbus_bss_expire(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "BSSExpireAge", dbus.UInt32(9), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(BSSExpireAge,9) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: BSSExpireAge must be >= 10" not in str(e): raise Exception("Unexpected error message for invalid Set(BSSExpireAge,9): " + str(e)) @@ -2460,7 +2460,7 @@ def test_dbus_bss_expire(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "BSSExpireCount", dbus.Int16(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(BSSExpireCount,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(BSSExpireCount,-1): " + str(e)) @@ -2468,7 +2468,7 @@ def test_dbus_bss_expire(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "BSSExpireCount", dbus.UInt32(0), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(BSSExpireCount,0) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: BSSExpireCount must be > 0" not in str(e): raise Exception("Unexpected error message for invalid Set(BSSExpireCount,0): " + str(e)) @@ -2513,7 +2513,7 @@ def _test_dbus_country(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "Country", dbus.Int16(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(Country,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(Country,-1): " + str(e)) @@ -2521,7 +2521,7 @@ def _test_dbus_country(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "Country", "F", dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(Country,F) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: invalid country code" not in str(e): raise Exception("Unexpected error message for invalid Set(Country,F): " + str(e)) @@ -2560,7 +2560,7 @@ def _test_dbus_scan_interval(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "ScanInterval", dbus.UInt16(100), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(ScanInterval,100) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: wrong property type" not in str(e): raise Exception("Unexpected error message for invalid Set(ScanInterval,100): " + str(e)) @@ -2568,7 +2568,7 @@ def _test_dbus_scan_interval(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "ScanInterval", dbus.Int32(-1), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(ScanInterval,-1) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: scan_interval must be >= 0" not in str(e): raise Exception("Unexpected error message for invalid Set(ScanInterval,-1): " + str(e)) @@ -2626,7 +2626,7 @@ def test_dbus_probe_req_reporting(dev, apdev): try: t.iface.UnsubscribeProbeReq() raise Exception("Invalid UnsubscribeProbeReq() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NoSubscription" not in str(e): raise Exception("Unexpected error message for invalid UnsubscribeProbeReq(): " + str(e)) t.group_p2p.Disconnect() @@ -2650,7 +2650,7 @@ def test_dbus_probe_req_reporting_oom(dev, apdev): try: iface.UnsubscribeProbeReq() was_subscribed = True - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: was_subscribed = False pass @@ -2671,14 +2671,14 @@ def test_dbus_p2p_invalid(dev, apdev): try: p2p.RejectPeer(path + "/Peers/00112233445566") raise Exception("Invalid RejectPeer accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: Failed to call wpas_p2p_reject" not in str(e): raise Exception("Unexpected error message for invalid RejectPeer(): " + str(e)) try: p2p.RejectPeer("/foo") raise Exception("Invalid RejectPeer accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid RejectPeer(): " + str(e)) @@ -2691,7 +2691,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: p2p.RemoveClient(t) raise Exception("Invalid RemoveClient accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid RemoveClient(): " + str(e)) @@ -2717,7 +2717,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: p2p.Find(dbus.Dictionary(t)) raise Exception("Invalid Find accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Find(): " + str(e)) @@ -2727,7 +2727,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: p2p.RemovePersistentGroup(dbus.ObjectPath(p)) raise Exception("Invalid RemovePersistentGroup accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid RemovePersistentGroup: " + str(e)) @@ -2735,7 +2735,7 @@ def test_dbus_p2p_invalid(dev, apdev): dev[0].request("P2P_SET disabled 1") p2p.Listen(5) raise Exception("Invalid Listen accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: Could not start P2P listen" not in str(e): raise Exception("Unexpected error message for invalid Listen: " + str(e)) finally: @@ -2746,7 +2746,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: test_p2p.Listen("foo") raise Exception("Invalid Listen accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Listen: " + str(e)) @@ -2754,7 +2754,7 @@ def test_dbus_p2p_invalid(dev, apdev): dev[0].request("P2P_SET disabled 1") p2p.ExtendedListen(dbus.Dictionary({})) raise Exception("Invalid ExtendedListen accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: failed to initiate a p2p_ext_listen" not in str(e): raise Exception("Unexpected error message for invalid ExtendedListen: " + str(e)) finally: @@ -2766,7 +2766,7 @@ def test_dbus_p2p_invalid(dev, apdev): 'duration2': 20000, 'interval2': 102400 } p2p.PresenceRequest(args) raise Exception("Invalid PresenceRequest accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: Failed to invoke presence request" not in str(e): raise Exception("Unexpected error message for invalid PresenceRequest: " + str(e)) finally: @@ -2776,7 +2776,7 @@ def test_dbus_p2p_invalid(dev, apdev): params = dbus.Dictionary({'frequency': dbus.Int32(-1)}) p2p.GroupAdd(params) raise Exception("Invalid GroupAdd accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid GroupAdd: " + str(e)) @@ -2786,14 +2786,14 @@ def test_dbus_p2p_invalid(dev, apdev): 'frequency': 2412}) p2p.GroupAdd(params) raise Exception("Invalid GroupAdd accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid GroupAdd: " + str(e)) try: p2p.Disconnect() raise Exception("Invalid Disconnect accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: failed to disconnect" not in str(e): raise Exception("Unexpected error message for invalid Disconnect: " + str(e)) @@ -2801,7 +2801,7 @@ def test_dbus_p2p_invalid(dev, apdev): dev[0].request("P2P_SET disabled 1") p2p.Flush() raise Exception("Invalid Flush accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Flush: " + str(e)) finally: @@ -2815,7 +2815,7 @@ def test_dbus_p2p_invalid(dev, apdev): 'frequency': 2412 } pin = p2p.Connect(args) raise Exception("Invalid Connect accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Connect: " + str(e)) finally: @@ -2828,7 +2828,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: pin = p2p.Connect(args) raise Exception("Invalid Connect accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Connect: " + str(e)) @@ -2837,7 +2837,7 @@ def test_dbus_p2p_invalid(dev, apdev): args = { 'peer': path } pin = p2p.Invite(args) raise Exception("Invalid Invite accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Invite: " + str(e)) finally: @@ -2847,7 +2847,7 @@ def test_dbus_p2p_invalid(dev, apdev): args = { 'foo': 'bar' } pin = p2p.Invite(args) raise Exception("Invalid Invite accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Connect: " + str(e)) @@ -2870,7 +2870,7 @@ def test_dbus_p2p_invalid(dev, apdev): try: p2p.ProvisionDiscoveryRequest(p, method) raise Exception("Invalid ProvisionDiscoveryRequest accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message for invalid ProvisionDiscoveryRequest: " + str(e)) @@ -2879,7 +2879,7 @@ def test_dbus_p2p_invalid(dev, apdev): if_obj.Get(WPAS_DBUS_IFACE_P2PDEVICE, "Peers", dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Get(Peers) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Get(Peers): " + str(e)) finally: @@ -3075,7 +3075,7 @@ def run_dbus_p2p_discovery(dev, apdev): try: p2p.RejectPeer(path) raise Exception("Invalid RejectPeer accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "UnknownError: Failed to call wpas_p2p_reject" not in str(e): raise Exception("Unexpected error message for invalid RejectPeer(): " + str(e)) self.loop.quit() @@ -3121,7 +3121,7 @@ def run_dbus_p2p_discovery(dev, apdev): try: p2p.ExtendedListen(dbus.Dictionary({'foo': 100})) raise Exception("Invalid ExtendedListen accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid ExtendedListen(): " + str(e)) @@ -3191,7 +3191,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.DeleteService(args) raise Exception("Invalid DeleteService() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid DeleteService(): " + str(e)) @@ -3201,7 +3201,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.DeleteService(args) raise Exception("Invalid DeleteService() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid DeleteService(): " + str(e)) @@ -3213,7 +3213,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.DeleteService(args) raise Exception("Invalid DeleteService() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid DeleteService(): " + str(e)) @@ -3233,7 +3233,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.DeleteService(args) raise Exception("Invalid DeleteService() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid DeleteService(): " + str(e)) @@ -3256,7 +3256,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.AddService(args) raise Exception("Invalid AddService() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid AddService(): " + str(e)) @@ -3266,13 +3266,13 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.ServiceDiscoveryCancelRequest(ref) raise Exception("Invalid ServiceDiscoveryCancelRequest() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid AddService(): " + str(e)) try: p2p.ServiceDiscoveryCancelRequest(dbus.UInt64(0)) raise Exception("Invalid ServiceDiscoveryCancelRequest() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid AddService(): " + str(e)) @@ -3307,7 +3307,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.ServiceDiscoveryRequest(args) raise Exception("Invalid ServiceDiscoveryRequest accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid ServiceDiscoveryRequest(): " + str(e)) @@ -3315,7 +3315,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): try: p2p.ServiceDiscoveryResponse(dbus.Dictionary(args, signature='sv')) raise Exception("Invalid ServiceDiscoveryResponse accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid ServiceDiscoveryResponse(): " + str(e)) @@ -3564,7 +3564,7 @@ def test_dbus_p2p_autogo(dev, apdev): wps.Start(params) self.exceptions = True raise Exception("Invalid WPS.Start() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): self.exceptions = True raise Exception("Unexpected error message: " + str(e)) @@ -3641,7 +3641,7 @@ def test_dbus_p2p_autogo(dev, apdev): dbus_interface=dbus.PROPERTIES_IFACE) self.exceptions = True raise Exception("Invalid Set(WPSVendorExtensions) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed" not in str(e): self.exceptions = True raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e)) @@ -3652,7 +3652,7 @@ def test_dbus_p2p_autogo(dev, apdev): dbus_interface=dbus.PROPERTIES_IFACE) self.exceptions = True raise Exception("Invalid Set(WPSVendorExtensions) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): self.exceptions = True raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e)) @@ -3663,7 +3663,7 @@ def test_dbus_p2p_autogo(dev, apdev): dbus_interface=dbus.PROPERTIES_IFACE) self.exceptions = True raise Exception("Invalid Set(WPSVendorExtensions) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed" not in str(e): self.exceptions = True raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e)) @@ -3674,7 +3674,7 @@ def test_dbus_p2p_autogo(dev, apdev): dbus_interface=dbus.PROPERTIES_IFACE) self.exceptions = True raise Exception("Invalid Set(WPSVendorExtensions) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed" not in str(e): self.exceptions = True raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e)) @@ -3953,7 +3953,7 @@ def test_dbus_p2p_join(dev, apdev): g_obj.Set(WPAS_DBUS_GROUP, 'WPSVendorExtensions', res, dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(WPSVendorExtensions) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: Failed to set property" not in str(e): raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e)) @@ -4105,7 +4105,7 @@ def _test_dbus_p2p_config(dev, apdev): dbus_interface=dbus.PROPERTIES_IFACE, byte_arrays=True) raise Exception("Invalid Get(P2PDeviceConfig) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Invite: " + str(e)) finally: @@ -4118,7 +4118,7 @@ def _test_dbus_p2p_config(dev, apdev): dbus.Dictionary(changes, signature='sv'), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(P2PDeviceConfig) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "Error.Failed: P2P is not available for this interface" not in str(e): raise Exception("Unexpected error message for invalid Invite: " + str(e)) finally: @@ -4133,7 +4133,7 @@ def _test_dbus_p2p_config(dev, apdev): dbus.Dictionary(changes, signature='sv'), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set(P2PDeviceConfig) accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Invite: " + str(e)) @@ -4226,7 +4226,7 @@ def test_dbus_p2p_persistent(dev, apdev): try: p2p.RemovePersistentGroup(persistent) raise Exception("Invalid RemovePersistentGroup accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "NetworkUnknown: There is no such persistent group" not in str(e): raise Exception("Unexpected error message for invalid RemovePersistentGroup: " + str(e)) @@ -4295,7 +4295,7 @@ def test_dbus_p2p_reinvoke_persistent(dev, apdev): try: pin = p2p.Invite(args) raise Exception("Invalid Invite accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Invite: " + str(e)) @@ -4412,7 +4412,7 @@ def test_dbus_p2p_go_neg_rx(dev, apdev): try: p2p.Connect(args) raise Exception("Invalid Connect accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "ConnectChannelUnsupported" not in str(e): raise Exception("Unexpected error message for invalid Connect: " + str(e)) @@ -4494,7 +4494,7 @@ def test_dbus_p2p_go_neg_auth(dev, apdev): try: p2p.Connect(args) raise Exception("Invalid Connect accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid Connect: " + str(e)) @@ -5113,7 +5113,7 @@ def test_dbus_p2p_cancel(dev, apdev): try: p2p.Cancel() raise Exception("Unexpected p2p.Cancel() success") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: pass addr0 = dev[0].p2p_dev_addr() @@ -5536,7 +5536,7 @@ def test_dbus_save_config(dev, apdev): try: iface.SaveConfig() raise Exception("SaveConfig() accepted unexpectedly") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.w1.wpa_supplicant1.UnknownError: Not allowed to update configuration"): raise Exception("Unexpected error message for SaveConfig(): " + str(e)) @@ -5557,7 +5557,7 @@ def _test_dbus_vendor_elem(dev, apdev): ie = dbus.ByteArray("\x00\x00") iface.VendorElemAdd(-1, ie) raise Exception("Invalid VendorElemAdd() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid ID" not in str(e): raise Exception("Unexpected error message for invalid VendorElemAdd[1]: " + str(e)) @@ -5565,7 +5565,7 @@ def _test_dbus_vendor_elem(dev, apdev): ie = dbus.ByteArray("") iface.VendorElemAdd(1, ie) raise Exception("Invalid VendorElemAdd() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid value" not in str(e): raise Exception("Unexpected error message for invalid VendorElemAdd[2]: " + str(e)) @@ -5573,21 +5573,21 @@ def _test_dbus_vendor_elem(dev, apdev): ie = dbus.ByteArray("\x00\x01") iface.VendorElemAdd(1, ie) raise Exception("Invalid VendorElemAdd() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Parse error" not in str(e): raise Exception("Unexpected error message for invalid VendorElemAdd[3]: " + str(e)) try: iface.VendorElemGet(-1) raise Exception("Invalid VendorElemGet() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid ID" not in str(e): raise Exception("Unexpected error message for invalid VendorElemGet[1]: " + str(e)) try: iface.VendorElemGet(1) raise Exception("Invalid VendorElemGet() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "ID value does not exist" not in str(e): raise Exception("Unexpected error message for invalid VendorElemGet[2]: " + str(e)) @@ -5595,7 +5595,7 @@ def _test_dbus_vendor_elem(dev, apdev): ie = dbus.ByteArray("\x00\x00") iface.VendorElemRem(-1, ie) raise Exception("Invalid VendorElemRemove() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid ID" not in str(e): raise Exception("Unexpected error message for invalid VendorElemRemove[1]: " + str(e)) @@ -5603,7 +5603,7 @@ def _test_dbus_vendor_elem(dev, apdev): ie = dbus.ByteArray("") iface.VendorElemRem(1, ie) raise Exception("Invalid VendorElemRemove() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid value" not in str(e): raise Exception("Unexpected error message for invalid VendorElemRemove[1]: " + str(e)) @@ -5634,7 +5634,7 @@ def _test_dbus_vendor_elem(dev, apdev): test_ie = dbus.ByteArray("\x01\x01") iface.VendorElemRem(1, test_ie) raise Exception("Invalid VendorElemRemove() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Parse error" not in str(e): raise Exception("Unexpected error message for invalid VendorElemRemove[1]: " + str(e)) @@ -5647,7 +5647,7 @@ def _test_dbus_vendor_elem(dev, apdev): try: iface.VendorElemGet(1) raise Exception("Invalid VendorElemGet() accepted after removal") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "ID value does not exist" not in str(e): raise Exception("Unexpected error message for invalid VendorElemGet after removal: " + str(e)) diff --git a/tests/hwsim/test_dbus_old.py b/tests/hwsim/test_dbus_old.py index 9034fdd27..bb6043e7e 100644 --- a/tests/hwsim/test_dbus_old.py +++ b/tests/hwsim/test_dbus_old.py @@ -36,7 +36,7 @@ def prepare_dbus(dev): path = wpas.getInterface(dev.ifname) if_obj = bus.get_object(WPAS_DBUS_OLD_SERVICE, path) return (bus,wpas_obj,path,if_obj) - except Exception, e: + except Exception as e: raise HwsimSkip("Could not connect to D-Bus: %s" % e) class TestDbusOldWps(TestDbus): @@ -83,7 +83,7 @@ def test_dbus_old(dev, apdev): try: if_obj.setAPScan(t, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid setAPScan() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidOptions" not in str(e): raise Exception("Unexpected error message for invalid setAPScan: " + str(e)) @@ -93,7 +93,7 @@ def test_dbus_old(dev, apdev): try: obj.disable(dbus_interface=WPAS_DBUS_OLD_NETWORK) raise Exception("Invalid disable() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidNetwork" not in str(e): raise Exception("Unexpected error message for invalid disable: " + str(e)) @@ -103,7 +103,7 @@ def test_dbus_old(dev, apdev): try: obj.properties(dbus_interface=WPAS_DBUS_OLD_BSSID) raise Exception("Invalid properties() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidBSSID" not in str(e): raise Exception("Unexpected error message for invalid properties: " + str(e)) @@ -162,7 +162,7 @@ def test_dbus_old_scan(dev, apdev): try: bss_obj.properties2(dbus_interface=WPAS_DBUS_OLD_BSSID) raise Exception("Unknown BSSID method accepted") - except Exception, e: + except Exception as e: logger.debug("Unknown BSSID method exception: " + str(e)) if not if_obj.flush(0, dbus_interface=WPAS_DBUS_OLD_IFACE): @@ -175,13 +175,13 @@ def test_dbus_old_scan(dev, apdev): try: if_obj.flush("foo", dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid flush arguments accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid flush: " + str(e)) try: bss_obj.properties(dbus_interface=WPAS_DBUS_OLD_BSSID, byte_arrays=True) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.Interface.InvalidBSSID"): raise Exception("Unexpected error message for invalid BSS: " + str(e)) @@ -193,14 +193,14 @@ def test_dbus_old_debug(dev, apdev): try: wpas.setDebugParams(123) raise Exception("Invalid setDebugParams accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidOptions" not in str(e): raise Exception("Unexpected error message for invalid setDebugParam: " + str(e)) try: wpas.setDebugParams(123, True, True) raise Exception("Invalid setDebugParams accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidOptions" not in str(e): raise Exception("Unexpected error message for invalid setDebugParam: " + str(e)) @@ -233,7 +233,7 @@ def test_dbus_old_smartcard(dev, apdev): try: if_obj.setSmartcardModules(t, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid setSmartcardModules accepted: " + str(t)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid setSmartcardModules(%s): %s" % (str(t), str(e))) @@ -266,7 +266,7 @@ def test_dbus_old_interface(dev, apdev): try: wpas.getInterface(ifname) raise Exception("Invalid getInterface accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message for invalid getInterface: " + str(e)) @@ -278,7 +278,7 @@ def test_dbus_old_interface(dev, apdev): try: wpas.removeInterface(path) raise Exception("Invalid removeInterface() accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidInterface" not in str(e): raise Exception("Unexpected error message for invalid removeInterface: " + str(e)) @@ -302,14 +302,14 @@ def test_dbus_old_interface(dev, apdev): else: wpas.addInterface(ifname, params) raise Exception("Invalid addInterface accepted: " + str(params)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message for invalid addInterface(%s): %s" % (str(params), str(e))) try: wpas.removeInterface(123) raise Exception("Invalid removeInterface accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid removeInterface: " + str(e)) @@ -345,7 +345,7 @@ def test_dbus_old_blob(dev, apdev): try: if_obj.setBlobs(arg, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid setBlobs() accepted: " + str(arg)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: logger.debug("setBlobs(%s): %s" % (str(arg), str(e))) if err not in str(e): raise Exception("Unexpected error message for invalid setBlobs: " + str(e)) @@ -358,7 +358,7 @@ def test_dbus_old_blob(dev, apdev): try: if_obj.removeBlobs(arg, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid removeBlobs() accepted: " + str(arg)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: logger.debug("removeBlobs(%s): %s" % (str(arg), str(e))) if err not in str(e): raise Exception("Unexpected error message for invalid removeBlobs: " + str(e)) @@ -412,21 +412,21 @@ def test_dbus_old_connect(dev, apdev): try: if_obj.removeNetwork(obj, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid removeNetwork accepted: " + p) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.Interface.InvalidNetwork"): raise Exception("Unexpected error message for invalid removeNetwork: " + str(e)) try: if_obj.removeNetwork("foo", dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid removeNetwork accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid removeNetwork: " + str(e)) try: if_obj.removeNetwork(path, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid removeNetwork accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.Interface.InvalidNetwork"): raise Exception("Unexpected error message for invalid removeNetwork: " + str(e)) @@ -442,7 +442,7 @@ def test_dbus_old_connect(dev, apdev): try: if_obj.selectNetwork(t, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid selectNetwork accepted: " + str(t)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if err not in str(e): raise Exception("Unexpected error message for invalid selectNetwork(%s): %s" % (str(t), str(e))) @@ -456,7 +456,7 @@ def test_dbus_old_connect(dev, apdev): try: netw_obj.set(t, dbus_interface=WPAS_DBUS_OLD_NETWORK) raise Exception("Invalid set() accepted: " + str(t)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidOptions" not in str(e): raise Exception("Unexpected error message for invalid set: " + str(e)) params = dbus.Dictionary({ 'ssid': ssid, @@ -521,7 +521,7 @@ def test_dbus_old_connect(dev, apdev): if_obj.removeNetwork(self.path, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid removeNetwork accepted") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.Interface.InvalidNetwork"): raise Exception("Unexpected error message for invalid wpsPbc: " + str(e)) @@ -637,7 +637,7 @@ def test_dbus_old_network_set(dev, apdev): try: netw_obj.set(params, dbus_interface=WPAS_DBUS_OLD_NETWORK) raise Exception("set succeeded with unexpected type") - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if "InvalidOptions" not in str(e): raise Exception("Unexpected error message for unexpected type: " + str(e)) @@ -662,7 +662,7 @@ def _test_dbus_old_wps_pbc(dev, apdev): try: if_obj.wpsPbc(arg, dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid wpsPbc arguments accepted: " + str(arg)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid wpsPbc: " + str(e)) @@ -730,7 +730,7 @@ def _test_dbus_old_wps_pin(dev, apdev): try: if_obj.wpsPin(arg[0], arg[1], dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid wpsPin arguments accepted: " + str(arg)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid wpsPbc: " + str(e)) @@ -784,7 +784,7 @@ def _test_dbus_old_wps_reg(dev, apdev): try: if_obj.wpsReg(arg[0], arg[1], dbus_interface=WPAS_DBUS_OLD_IFACE) raise Exception("Invalid wpsReg arguments accepted: " + str(arg)) - except dbus.exceptions.DBusException, e: + except dbus.exceptions.DBusException as e: if not str(e).startswith("fi.epitest.hostap.WPASupplicant.InvalidOptions"): raise Exception("Unexpected error message for invalid wpsPbc: " + str(e)) diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index 7d8b5f45c..f4c5af2a9 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -198,7 +198,7 @@ def test_fils_sk_pmksa_caching_ocv(dev, apdev, params): params['ocv'] = '1' try: hapd = hostapd.add_ap(apdev[0]['ifname'], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise diff --git a/tests/hwsim/test_fst_config.py b/tests/hwsim/test_fst_config.py index 9244740cd..0c0107cb2 100644 --- a/tests/hwsim/test_fst_config.py +++ b/tests/hwsim/test_fst_config.py @@ -243,7 +243,7 @@ class FstLauncher: try: pid = int(pidtxt) break - except Exception, e: + except Exception as e: self.logger.debug("kill_pid: No valid PID found: %s" % str(e)) time.sleep(1) self.logger.debug("kill_pid %s --> pid %d" % (pidfile, pid)) @@ -257,7 +257,7 @@ class FstLauncher: break # Wait and check again time.sleep(1) - except Exception, e: + except Exception as e: self.logger.debug("Didn't stop the pid=%d. Was it stopped already? (%s)" % (pid, str(e))) diff --git a/tests/hwsim/test_fst_module.py b/tests/hwsim/test_fst_module.py index 4e182b97e..7e7f09605 100644 --- a/tests/hwsim/test_fst_module.py +++ b/tests/hwsim/test_fst_module.py @@ -142,7 +142,7 @@ def fst_start_session(apdev, test_params, bad_param_type, start_on_ap, sid = '-1' initiator.set_fst_parameters(llt=llt) initiator.configure_session(sid, new_iface, old_iface) - except Exception, e: + except Exception as e: if e.args[0].startswith("Cannot add FST session with groupid"): if bad_param_type == bad_param_group_id or bad_param_type == bad_param_session_add_no_params: bad_parameter_detected = True @@ -302,7 +302,7 @@ def fst_initiate_session(apdev, test_params, bad_param_type, init_on_ap): bad_parameter_detected = True else: initiator.initiate_session(sid, "accept") - except Exception, e: + except Exception as e: if e.args[0].startswith("Cannot initiate fst session"): if bad_param_type != bad_param_none: bad_parameter_detected = True @@ -364,7 +364,7 @@ def fst_transfer_session(apdev, test_params, bad_param_type, init_on_ap, elif bad_param_type == bad_param_session_transfer_bad_session_id: sid = '-1' initiator.transfer_session(sid) - except Exception, e: + except Exception as e: if e.args[0].startswith("Cannot transfer fst session"): if bad_param_type != bad_param_none: bad_parameter_detected = True @@ -427,7 +427,7 @@ def fst_tear_down_session(apdev, test_params, bad_param_type, init_on_ap): elif bad_param_type == bad_param_session_teardown_bad_session_id: sid = '-1' initiator.teardown_session(sid) - except Exception, e: + except Exception as e: if e.args[0].startswith("Cannot tear down fst session"): if (bad_param_type == bad_param_session_teardown_no_params or bad_param_type == bad_param_session_teardown_bad_session_id or @@ -503,7 +503,7 @@ def fst_remove_session(apdev, test_params, remove_session_scenario, init_on_ap): elif remove_session_scenario == remove_scenario_bad_session_id: sid = '-1' initiator.remove_session(sid) - except Exception, e: + except Exception as e: if e.args[0].startswith("Cannot remove fst session"): if (remove_session_scenario == remove_scenario_no_params or remove_session_scenario == remove_scenario_bad_session_id): @@ -592,7 +592,7 @@ def fst_send_unexpected_frame(apdev, test_params, frame_type, send_from_ap, addi #fsts_id doesn't matter, no actual session exists sender.send_test_tear_down('0') receiver.wait_for_session_event(5) - except Exception, e: + except Exception as e: if e.args[0].startswith("No FST-EVENT-SESSION received"): if frame_type != frame_type_session_request: frame_receive_timeout = True @@ -716,7 +716,7 @@ def fst_bad_transfer(apdev, test_params, bad_scenario_type, init_on_ap): responder.wait_for_session_event(5, ["EVENT_FST_SESSION_STATE"]) else: raise Exception("Unknown bad scenario identifier") - except Exception, e: + except Exception as e: if e.args[0].startswith("No FST-EVENT-SESSION received"): bad_parameter_detected = True if not bad_parameter_detected: @@ -753,7 +753,7 @@ def test_fst_sta_connect_to_non_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -773,7 +773,7 @@ def test_fst_sta_connect_to_fst_ap(dev, apdev, test_params): res_sta2_mbies = sta2.get_local_mbies() if res_sta2_mbies == orig_sta2_mbies: raise Exception("Failure. MB IEs have not been updated") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -792,7 +792,7 @@ def test_fst_ap_connect_to_fst_sta(dev, apdev, test_params): res_ap_mbies = ap1.get_local_mbies() if res_ap_mbies != orig_ap_mbies: raise Exception("Failure. MB IEs have been unexpectedly updated on the AP") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -811,7 +811,7 @@ def test_fst_ap_connect_to_non_fst_sta(dev, apdev, test_params): res_ap_mbies = ap2.get_local_mbies() if res_ap_mbies != orig_ap_mbies: raise Exception("Failure. MB IEs have been unexpectedly updated on the AP") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -839,7 +839,7 @@ def test_fst_second_sta_connect_to_non_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -869,7 +869,7 @@ def test_fst_second_sta_connect_to_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -900,7 +900,7 @@ def test_fst_disconnect_1_of_2_stas_from_non_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -931,7 +931,7 @@ def test_fst_disconnect_1_of_2_stas_from_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -964,7 +964,7 @@ def test_fst_disconnect_2_of_2_stas_from_non_fst_ap(dev, apdev, test_params): res_sta1_mbies.startswith("FAIL") or res_sta2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs must be present on the stations") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -1014,7 +1014,7 @@ def test_fst_disconnect_2_of_2_stas_from_fst_ap(dev, apdev, test_params): addr_sta2_mbie1 != addr_sta2_mbie2 or addr_sta2_mbie1 != addr_sta1_str): raise Exception("Failure. STA Address in MB IEs should have been same as the other STA's") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -1045,7 +1045,7 @@ def test_fst_disconnect_non_fst_sta(dev, apdev, test_params): res_ap_mbies = ap2.get_local_mbies() if res_ap_mbies != orig_ap_mbies: raise Exception("Failure. MB IEs have been unexpectedly updated on the AP") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -1076,7 +1076,7 @@ def test_fst_disconnect_fst_sta(dev, apdev, test_params): res_ap_mbies = ap2.get_local_mbies() if res_ap_mbies != orig_ap_mbies: raise Exception("Failure. MB IEs have been unexpectedly updated on the AP") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -1137,7 +1137,7 @@ def test_fst_dynamic_iface_attach(dev, apdev, test_params): res_sta2_mbies.startswith("FAIL") or res_ap2_mbies.startswith("FAIL")): raise Exception("Failure. MB IEs should have appeared on the station and on the AP") - except Exception, e: + except Exception as e: logger.info(e) raise finally: @@ -1498,13 +1498,13 @@ def test_fst_ap_ctrl_iface(dev, apdev, test_params): ap1.send_iface_attach_request(ap1.iface, ap1.fst_group, ap1.fst_llt, ap1.fst_pri) raise Exception("Duplicate FST-ATTACH succeeded") - except Exception, e: + except Exception as e: if not str(e).startswith("Cannot attach"): raise try: ap1.get_fsts_id_by_sid("123") - except Exception, e: + except Exception as e: if not str(e).startswith("Cannot get fsts_id for sid"): raise finally: @@ -2537,7 +2537,7 @@ def _test_fst_setup_mbie_diff(dev, apdev, test_params): with alloc_fail(hapd, 1, "mb_ies_by_info"): fst_setup_req(wpas, hglobal, 5180, apdev[0]['bssid'], req, stie, mbie, no_wait=True) - except HwsimSkip, e: + except HwsimSkip as e: # Skip exception to allow proper cleanup pass diff --git a/tests/hwsim/test_hostapd_oom.py b/tests/hwsim/test_hostapd_oom.py index ed64fd1bd..f0010e434 100644 --- a/tests/hwsim/test_hostapd_oom.py +++ b/tests/hwsim/test_hostapd_oom.py @@ -35,7 +35,7 @@ def hostapd_oom_loop(apdev, params, start_func="main"): count += 1 if count == 5: break - except Exception, e: + except Exception as e: logger.info("Iteration %d - %s" % (i, str(e))) @remote_compatible @@ -57,7 +57,7 @@ def test_hostapd_oom_wpa2_psk(dev, apdev): try: hostapd.add_ap(apdev[1], params, timeout=2.5) raise Exception("Unexpected add_ap() success during OOM") - except Exception, e: + except Exception as e: if "Failed to enable hostapd" in str(e): pass else: diff --git a/tests/hwsim/test_ibss.py b/tests/hwsim/test_ibss.py index 2c58b2200..a9935dfb7 100644 --- a/tests/hwsim/test_ibss.py +++ b/tests/hwsim/test_ibss.py @@ -240,15 +240,15 @@ def test_ibss_wpa_none(dev): # mac80211 currently.. try: hwsim_utils.test_connectivity(dev[0], dev[1]) - except Exception, e: + except Exception as e: logger.info("Ignoring known connectivity failure: " + str(e)) try: hwsim_utils.test_connectivity(dev[0], dev[2]) - except Exception, e: + except Exception as e: logger.info("Ignoring known connectivity failure: " + str(e)) try: hwsim_utils.test_connectivity(dev[1], dev[2]) - except Exception, e: + except Exception as e: logger.info("Ignoring known connectivity failure: " + str(e)) key_mgmt = dev[0].get_status_field("key_mgmt") @@ -291,7 +291,7 @@ def test_ibss_wpa_none_ccmp(dev): # mac80211 currently.. try: hwsim_utils.test_connectivity(dev[0], dev[1]) - except Exception, e: + except Exception as e: logger.info("Ignoring known connectivity failure: " + str(e)) def test_ibss_open(dev): diff --git a/tests/hwsim/test_macsec.py b/tests/hwsim/test_macsec.py index 1b36e9fae..8de4bf051 100644 --- a/tests/hwsim/test_macsec.py +++ b/tests/hwsim/test_macsec.py @@ -164,7 +164,7 @@ def add_wpas_interfaces(count=2): wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') wpas.interface_add("veth%d" % i, driver="macsec_linux") wpa.append(wpas) - except Exception, e: + except Exception as e: if "Failed to add a dynamic wpa_supplicant interface" in str(e): raise HwsimSkip("macsec supported (wpa_supplicant CONFIG_MACSEC, CONFIG_MACSEC_LINUX; kernel CONFIG_MACSEC)") raise diff --git a/tests/hwsim/test_mbo.py b/tests/hwsim/test_mbo.py index 3eb0f511c..a36aee2ba 100644 --- a/tests/hwsim/test_mbo.py +++ b/tests/hwsim/test_mbo.py @@ -528,7 +528,7 @@ def test_mbo_without_pmf(dev, apdev): # "MBO: PMF needs to be enabled whenever using WPA2 with MBO" hostapd.add_ap(apdev[0], params) raise Exception("AP setup succeeded unexpectedly") - except Exception, e: + except Exception as e: if "Failed to enable hostapd" in str(e): pass else: diff --git a/tests/hwsim/test_ocv.py b/tests/hwsim/test_ocv.py index b76b6cfd5..49fb8f0b5 100644 --- a/tests/hwsim/test_ocv.py +++ b/tests/hwsim/test_ocv.py @@ -35,7 +35,7 @@ def ocv_setup_ap(apdev, params): params.update(hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)) try: hapd = hostapd.add_ap(apdev, params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -371,7 +371,7 @@ class APConnection: params["ocv"] = ap_ocv try: self.hapd = hostapd.add_ap(apdev, params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -598,7 +598,7 @@ def test_wpa2_ocv_ap_retransmit_msg3(dev, apdev): params['wpa_disable_eapol_key_retries'] = "1" try: hapd = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -731,7 +731,7 @@ class STAConnection: try: self.hapd = hostapd.add_ap(apdev, params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index bab3cc521..3683735d1 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -551,7 +551,7 @@ def test_go_neg_peers_force_diff_freq(dev, apdev): try: [i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=14, i_freq=5180, r_dev=dev[1], r_intent=0, r_freq=5200) - except Exception, e: + except Exception as e: return raise Exception("Unexpected group formation success") diff --git a/tests/hwsim/test_rfkill.py b/tests/hwsim/test_rfkill.py index d13753107..8a2a5e2fa 100644 --- a/tests/hwsim/test_rfkill.py +++ b/tests/hwsim/test_rfkill.py @@ -22,7 +22,7 @@ def get_rfkill(dev): for r, s, h in RFKill.list(): if r.name == phy: return r - except Exception, e: + except Exception as e: raise HwsimSkip("No rfkill available: " + str(e)) raise HwsimSkip("No rfkill match found for the interface") diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py index 343a4e3fc..e498672c3 100644 --- a/tests/hwsim/test_rrm.py +++ b/tests/hwsim/test_rrm.py @@ -1247,7 +1247,7 @@ def test_rrm_beacon_req_table_vht(dev, apdev): elif report.bssid_str == apdev[1]['bssid']: if report.opclass != 117 or report.channel != 48: raise Exception("Incorrect opclass/channel for AP1") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -1662,7 +1662,7 @@ def test_rrm_beacon_req_passive_scan_vht(dev, apdev): logger.info("Received beacon report: " + str(report)) if report.opclass != 128 or report.channel != 36: raise Exception("Incorrect opclass/channel for AP") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": if not vht_supported(): raise HwsimSkip("80 MHz channel not supported in regulatory information") @@ -1712,7 +1712,7 @@ def test_rrm_beacon_req_passive_scan_vht160(dev, apdev): logger.info("Received beacon report: " + str(report)) if report.opclass != 129 or report.channel != 104: raise Exception("Incorrect opclass/channel for AP") - except Exception, e: + except Exception as e: if isinstance(e, Exception) and str(e) == "AP startup failed": raise HwsimSkip("ZA regulatory rule likely did not have DFS requirement removed") raise diff --git a/tests/hwsim/test_wext.py b/tests/hwsim/test_wext.py index 9c1c0c883..2bf3451ef 100644 --- a/tests/hwsim/test_wext.py +++ b/tests/hwsim/test_wext.py @@ -21,7 +21,7 @@ def get_wext_interface(): wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') try: wpas.interface_add("wlan5", driver="wext") - except Exception, e: + except Exception as e: wpas.close_ctrl() raise HwsimSkip("WEXT driver support not included in wpa_supplicant") return wpas diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index d07d5aca2..26a7521e7 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -70,7 +70,7 @@ def get_wmediumd_version(): try: verstr = subprocess.check_output(['wmediumd', '-V']) - except OSError, e: + except OSError as e: if e.errno == errno.ENOENT: raise HwsimSkip('wmediumd not available') raise @@ -101,7 +101,7 @@ def start_wmediumd(fn, params): p = subprocess.Popen(['wmediumd', '-c', fn], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except OSError, e: + except OSError as e: if e.errno == errno.ENOENT: raise HwsimSkip('wmediumd not available') raise diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index 2f8a25034..192761633 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -310,7 +310,7 @@ def test_wnm_sleep_mode_rsn_ocv(dev, apdev): params["bss_transition"] = "1" try: hapd = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise @@ -343,7 +343,7 @@ def test_wnm_sleep_mode_rsn_badocv(dev, apdev): params['wnm_sleep_mode'] = '1' try: hapd = hostapd.add_ap(apdev[0], params) - except Exception, e: + except Exception as e: if "Failed to set hostapd parameter ocv" in str(e): raise HwsimSkip("OCV not supported") raise diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index f8b501a1f..d1b97634b 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -94,7 +94,7 @@ def test_wpas_ctrl_network(dev): res = dev[0].get_network(id, "key_mgmt") if res != value: raise Exception("Unexpected response for key_mgmt") - except Exception, e: + except Exception as e: if str(e).startswith("Unexpected"): raise else: @@ -1827,7 +1827,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): logger.debug("Command %d" % i) try: s.send("MIB") - except Exception, e: + except Exception as e: logger.info("Could not send command %d: %s" % (i, str(e))) break # Close without receiving response @@ -1846,7 +1846,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): logger.debug("Command %d [2]" % i) try: s2.send("MIB") - except Exception, e: + except Exception as e: logger.info("Could not send command %d [2]: %s" % (i, str(e))) break # Close without receiving response @@ -1859,7 +1859,7 @@ def test_wpas_ctrl_socket_full(dev, apdev, test_params): logger.debug("Command %d [3]" % i) try: s2.send("MIB") - except Exception, e: + except Exception as e: logger.info("Could not send command %d [3]: %s" % (i, str(e))) break # Close without receiving response diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index c20d5da6c..45317d0d3 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -303,7 +303,7 @@ def add_mesh_secure_net(dev, psk=True, pmf=False, pairwise=None, group=None, if ocv: try: dev.set_network(id, "ocv", "1") - except Exception, e: + except Exception as e: if "SET_NETWORK failed" in str(e): raise HwsimSkip("OCV not supported") raise @@ -1264,7 +1264,7 @@ def test_wpas_mesh_password_mismatch(dev, apdev): try: hwsim_utils.test_connectivity(dev[i], dev[2], timeout=1) raise Exception("Data connectivity test passed unexpectedly") - except Exception, e: + except Exception as e: if "data delivery failed" not in str(e): raise @@ -1713,7 +1713,7 @@ def test_mesh_oom(dev, apdev): "MESH-GROUP-STARTED"]) if ev is None: raise Exception("Init failure not reported") - except Exception, e: + except Exception as e: if i < 15: raise logger.info("Ignore no-oom for i=%d" % i) diff --git a/tests/hwsim/test_wpas_wmm_ac.py b/tests/hwsim/test_wpas_wmm_ac.py index 149dd7233..f81588a18 100644 --- a/tests/hwsim/test_wpas_wmm_ac.py +++ b/tests/hwsim/test_wpas_wmm_ac.py @@ -60,7 +60,7 @@ def test_tspec(dev, apdev): try: dev[0].add_ts(tsid, 3) raise Exception("ADDTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("ADDTS failed"): raise status = dev[0].request("WMM_AC_STATUS") @@ -77,7 +77,7 @@ def test_tspec(dev, apdev): try: dev[0].add_ts(tsid, 5) raise Exception("ADDTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("ADDTS failed"): raise @@ -93,13 +93,13 @@ def test_tspec(dev, apdev): try: dev[0].add_ts(tsid, 7, direction="uplink") raise Exception("ADDTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("ADDTS failed"): raise try: dev[0].add_ts(tsid, 7, direction="bidi") raise Exception("ADDTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("ADDTS failed"): raise @@ -107,7 +107,7 @@ def test_tspec(dev, apdev): try: dev[0].del_ts(tsid) raise Exception("DELTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("DELTS failed"): raise @@ -231,7 +231,7 @@ def test_tspec_not_enabled(dev, apdev): try: dev[0].add_ts(5, 6) raise Exception("ADDTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("ADDTS failed"): raise @@ -239,7 +239,7 @@ def test_tspec_not_enabled(dev, apdev): try: dev[0].del_ts(5) raise Exception("DELTS succeeded although it should have failed") - except Exception, e: + except Exception as e: if not str(e).startswith("DELTS failed"): raise diff --git a/tests/hwsim/tshark.py b/tests/hwsim/tshark.py index b90f66258..81aee6c4b 100644 --- a/tests/hwsim/tshark.py +++ b/tests/hwsim/tshark.py @@ -39,7 +39,7 @@ def _run_tshark(filename, filter, display=None, wait=True): arg.append('-V') cmd = subprocess.Popen(arg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception, e: + except Exception as e: logger.info("Could run run tshark check: " + str(e)) cmd = None return None @@ -88,7 +88,7 @@ def run_tshark(filename, filter, display=None, wait=True): if display is None: display = [] try: return _run_tshark(filename, filter, display, wait) - except UnknownFieldsException, e: + except UnknownFieldsException as e: all_wlan_mgt = True for f in e.fields: if not f.startswith('wlan_mgt.'): @@ -108,7 +108,7 @@ def run_tshark_json(filename, filter): try: cmd = subprocess.Popen(arg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception, e: + except Exception as e: logger.info("Could run run tshark: " + str(e)) return None output = cmd.communicate() diff --git a/tests/hwsim/wlantest.py b/tests/hwsim/wlantest.py index 10bb45fea..75dcdb568 100644 --- a/tests/hwsim/wlantest.py +++ b/tests/hwsim/wlantest.py @@ -142,7 +142,7 @@ class Wlantest: def get_bss_counter(self, field, bssid): try: res = self.cli_cmd(["get_bss_counter", field, bssid]) - except Exception, e: + except Exception as e: return 0 if "FAIL" in res: return 0 diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 1698fca7a..5b57b76c3 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -438,7 +438,7 @@ class WpaSupplicant: try: [name,value] = l.split('=', 1) vals[name] = value - except ValueError, e: + except ValueError as e: logger.info(self.ifname + ": Ignore unexpected STATUS line: " + l) return vals @@ -507,7 +507,7 @@ class WpaSupplicant: try: [name,value] = l.split('=', 1) vals[name] = value - except ValueError, e: + except ValueError as e: logger.info(self.ifname + ": Ignore unexpected MIB line: " + l) return vals diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index b43881542..5ea2bd1e2 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -265,7 +265,7 @@ def main(): # lock devices try: get_devices(devices, duts, refs, monitors) - except Exception, e: + except Exception as e: logger.warning("get devices failed: " + str(e)) logger.info(traceback.format_exc()) put_devices(devices, duts, refs, monitors) @@ -288,7 +288,7 @@ def main(): logger.warning("RUN check_devices") try: check_devices(devices, setup_params, refs, duts, monitors) - except Exception, e: + except Exception as e: logger.warning("FAILED: " + str(e)) logger.info(traceback.format_exc()) put_devices(devices, duts, refs, monitors) @@ -317,10 +317,10 @@ def main(): except KeyboardInterrupt: put_devices(devices, duts, refs, monitors) raise - except TestSkip, e: + except TestSkip as e: end = datetime.now() logger.warning("SKIP (" + str(e) + ") - " + str((end - start).total_seconds()) + "s") - except Exception, e: + except Exception as e: end = datetime.now() logger.warning("FAILED (" + str(e) + ") - " + str((end - start).total_seconds()) + "s") logger.info(traceback.format_exc()) @@ -344,11 +344,11 @@ def main(): except KeyboardInterrupt: put_devices(devices, duts, refs, monitors) raise - except HwsimSkip,e: + except HwsimSkip as e: end = datetime.now() logger.warning("SKIP (" + str(e) + ") - " + str((end - start).total_seconds()) + "s") failed.append(hwsim_test.__name__.replace('test_', '', 1)) - except Exception, e: + except Exception as e: end = datetime.now() logger.warning("FAILED (" + str(e) + ") - " + str((end - start).total_seconds()) + "s") logger.info(traceback.format_exc()) diff --git a/wpa_supplicant/examples/dpp-qrcode.py b/wpa_supplicant/examples/dpp-qrcode.py index e2a00c910..f40f96198 100755 --- a/wpa_supplicant/examples/dpp-qrcode.py +++ b/wpa_supplicant/examples/dpp-qrcode.py @@ -24,7 +24,7 @@ def wpas_connect(): if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] - except OSError, error: + except OSError as error: print "Could not find wpa_supplicant: ", error return None @@ -36,7 +36,7 @@ def wpas_connect(): try: wpas = wpaspy.Ctrl(ctrl) return wpas - except Exception, e: + except Exception as e: pass return None diff --git a/wpa_supplicant/examples/p2p-nfc.py b/wpa_supplicant/examples/p2p-nfc.py index 91eba2890..646f452ea 100755 --- a/wpa_supplicant/examples/p2p-nfc.py +++ b/wpa_supplicant/examples/p2p-nfc.py @@ -53,7 +53,7 @@ def wpas_connect(): if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] - except OSError, error: + except OSError as error: print "Could not find wpa_supplicant: ", error return None @@ -69,7 +69,7 @@ def wpas_connect(): print "Trying to use control interface " + ctrl wpas = wpaspy.Ctrl(ctrl) return wpas - except Exception, e: + except Exception as e: pass return None @@ -169,7 +169,7 @@ def p2p_handover_client(llc): print "Handover request (pre-WPS):" try: print message.pretty() - except Exception, e: + except Exception as e: print e data = wpas_get_handover_req_wps() @@ -181,7 +181,7 @@ def p2p_handover_client(llc): print "Handover request:" try: print message.pretty() - except Exception, e: + except Exception as e: print e print str(message).encode("hex") @@ -194,7 +194,7 @@ def p2p_handover_client(llc): summary("Handover connection refused") client.close() return - except Exception, e: + except Exception as e: summary("Other exception: " + str(e)) client.close() return @@ -220,14 +220,14 @@ def p2p_handover_client(llc): print "Received message" try: print message.pretty() - except Exception, e: + except Exception as e: print e print str(message).encode("hex") message = nfc.ndef.HandoverSelectMessage(message) summary("Handover select received") try: print message.pretty() - except Exception, e: + except Exception as e: print e for carrier in message.carriers: @@ -286,7 +286,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "HandoverServer - request received" try: print "Parsed handover request: " + request.pretty() - except Exception, e: + except Exception as e: print e sel = nfc.ndef.HandoverSelectMessage(version="1.2") @@ -302,7 +302,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "Carrier record:" try: print carrier.record.pretty() - except Exception, e: + except Exception as e: print e data = wpas_get_handover_sel() if data is None: @@ -332,7 +332,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "Carrier record:" try: print carrier.record.pretty() - except Exception, e: + except Exception as e: print e data = wpas_get_handover_sel_wps() if data is None: @@ -355,7 +355,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "Handover select:" try: print sel.pretty() - except Exception, e: + except Exception as e: print e print str(sel).encode("hex") @@ -443,7 +443,7 @@ def wps_write_p2p_handover_sel(clf, wait_remove=True): print "Handover select:" try: print p2p_sel_data.pretty() - except Exception, e: + except Exception as e: print e print str(p2p_sel_data).encode("hex") @@ -459,7 +459,7 @@ def rdwr_connected(tag): print "NDEF tag: " + tag.type try: print tag.ndef.message.pretty() - except Exception, e: + except Exception as e: print e success = p2p_tag_read(tag) if only_one and success: @@ -636,7 +636,7 @@ def main(): 'on-connect': llcp_connected}, terminate=terminate_loop): break - except Exception, e: + except Exception as e: print "clf.connect failed" global srv diff --git a/wpa_supplicant/examples/p2p/p2p_connect.py b/wpa_supplicant/examples/p2p/p2p_connect.py index 59b0a9d36..cb1208117 100644 --- a/wpa_supplicant/examples/p2p/p2p_connect.py +++ b/wpa_supplicant/examples/p2p/p2p_connect.py @@ -118,7 +118,7 @@ class P2P_Connect(): {'Ifname': ifname, 'Driver': 'test'}) time.sleep(1) - except dbus.DBusException, exc: + except dbus.DBusException as exc: if not str(exc).startswith( self.wpas_dbus_interface + \ ".InterfaceExists:"): @@ -209,7 +209,7 @@ class P2P_Connect(): result_pin = self.p2p_interface.Connect( self.p2p_connect_arguements) - except dbus.DBusException, exc: + except dbus.DBusException as exc: raise exc if (self.wps_method == 'pin' and \ diff --git a/wpa_supplicant/examples/p2p/p2p_disconnect.py b/wpa_supplicant/examples/p2p/p2p_disconnect.py index c3e39b3de..9ea2c5c38 100644 --- a/wpa_supplicant/examples/p2p/p2p_disconnect.py +++ b/wpa_supplicant/examples/p2p/p2p_disconnect.py @@ -81,7 +81,7 @@ class P2P_Disconnect (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_find.py b/wpa_supplicant/examples/p2p/p2p_find.py index 973d46ab0..9c860d1e1 100644 --- a/wpa_supplicant/examples/p2p/p2p_find.py +++ b/wpa_supplicant/examples/p2p/p2p_find.py @@ -85,7 +85,7 @@ class P2P_Find (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_flush.py b/wpa_supplicant/examples/p2p/p2p_flush.py index ff8509d60..5dfe642c9 100644 --- a/wpa_supplicant/examples/p2p/p2p_flush.py +++ b/wpa_supplicant/examples/p2p/p2p_flush.py @@ -81,7 +81,7 @@ class P2P_Flush (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_group_add.py b/wpa_supplicant/examples/p2p/p2p_group_add.py index 5c8fdafdf..4e64892cd 100644 --- a/wpa_supplicant/examples/p2p/p2p_group_add.py +++ b/wpa_supplicant/examples/p2p/p2p_group_add.py @@ -99,7 +99,7 @@ class P2P_Group_Add (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_invite.py b/wpa_supplicant/examples/p2p/p2p_invite.py index 6deb397ec..9413f0227 100644 --- a/wpa_supplicant/examples/p2p/p2p_invite.py +++ b/wpa_supplicant/examples/p2p/p2p_invite.py @@ -96,7 +96,7 @@ class P2P_Invite (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_listen.py b/wpa_supplicant/examples/p2p/p2p_listen.py index bb3c1e49d..1dd61f69c 100644 --- a/wpa_supplicant/examples/p2p/p2p_listen.py +++ b/wpa_supplicant/examples/p2p/p2p_listen.py @@ -82,7 +82,7 @@ class P2P_Listen(threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/p2p/p2p_stop_find.py b/wpa_supplicant/examples/p2p/p2p_stop_find.py index f6c03b027..31b54dde0 100644 --- a/wpa_supplicant/examples/p2p/p2p_stop_find.py +++ b/wpa_supplicant/examples/p2p/p2p_stop_find.py @@ -83,7 +83,7 @@ class P2P_Stop_Find (threading.Thread): try: self.path = self.wpas.GetInterface( self.interface_name) - except dbus.DBusException, exc: + except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' print error diff --git a/wpa_supplicant/examples/wpas-dbus-new.py b/wpa_supplicant/examples/wpas-dbus-new.py index 25072ce9a..885262c7f 100755 --- a/wpa_supplicant/examples/wpas-dbus-new.py +++ b/wpa_supplicant/examples/wpas-dbus-new.py @@ -123,14 +123,14 @@ def main(): path = None try: path = wpas.GetInterface(ifname) - except dbus.DBusException, exc: + except dbus.DBusException as exc: if not str(exc).startswith("fi.w1.wpa_supplicant1.InterfaceUnknown:"): raise exc try: path = wpas.CreateInterface({'Ifname': ifname, 'Driver': 'test'}) time.sleep(1) - except dbus.DBusException, exc: + except dbus.DBusException as exc: if not str(exc).startswith("fi.w1.wpa_supplicant1.InterfaceExists:"): raise exc diff --git a/wpa_supplicant/examples/wpas-test.py b/wpa_supplicant/examples/wpas-test.py index fd7f73d42..31713ca62 100755 --- a/wpa_supplicant/examples/wpas-test.py +++ b/wpa_supplicant/examples/wpas-test.py @@ -37,12 +37,12 @@ def main(): path = None try: path = wpas.getInterface(ifname) - except dbus.dbus_bindings.DBusException, exc: + except dbus.dbus_bindings.DBusException as exc: if str(exc) != "wpa_supplicant knows nothing about this interface.": raise exc try: path = wpas.addInterface(ifname, {'driver': dbus.Variant('wext')}) - except dbus.dbus_bindings.DBusException, exc: + except dbus.dbus_bindings.DBusException as exc: if str(exc) != "wpa_supplicant already controls this interface.": raise exc diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py index 7459eb9ae..2e6869311 100755 --- a/wpa_supplicant/examples/wps-nfc.py +++ b/wpa_supplicant/examples/wps-nfc.py @@ -46,7 +46,7 @@ def wpas_connect(): if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] - except OSError, error: + except OSError as error: print "Could not find wpa_supplicant: ", error return None @@ -58,7 +58,7 @@ def wpas_connect(): try: wpas = wpaspy.Ctrl(ctrl) return wpas - except Exception, e: + except Exception as e: pass return None @@ -164,7 +164,7 @@ class HandoverServer(nfc.handover.HandoverServer): summary("HandoverServer - request received") try: print "Parsed handover request: " + request.pretty() - except Exception, e: + except Exception as e: print e sel = nfc.ndef.HandoverSelectMessage(version="1.2") @@ -191,7 +191,7 @@ class HandoverServer(nfc.handover.HandoverServer): print "Handover select:" try: print sel.pretty() - except Exception, e: + except Exception as e: print e print str(sel).encode("hex") @@ -217,7 +217,7 @@ def wps_handover_init(llc): print "Handover request:" try: print message.pretty() - except Exception, e: + except Exception as e: print e print str(message).encode("hex") @@ -230,7 +230,7 @@ def wps_handover_init(llc): summary("Handover connection refused") client.close() return - except Exception, e: + except Exception as e: summary("Other exception: " + str(e)) client.close() return @@ -256,14 +256,14 @@ def wps_handover_init(llc): print "Received message" try: print message.pretty() - except Exception, e: + except Exception as e: print e print str(message).encode("hex") message = nfc.ndef.HandoverSelectMessage(message) summary("Handover select received") try: print message.pretty() - except Exception, e: + except Exception as e: print e for carrier in message.carriers: @@ -376,7 +376,7 @@ def rdwr_connected(tag): print "NDEF tag: " + tag.type try: print tag.ndef.message.pretty() - except Exception, e: + except Exception as e: print e success = wps_tag_read(tag, not only_one) if only_one and success: @@ -507,7 +507,7 @@ def main(): 'on-connect': llcp_connected}, terminate=terminate_loop): break - except Exception, e: + except Exception as e: print "clf.connect failed" global srv diff --git a/wpaspy/test.py b/wpaspy/test.py index 9141a8d40..cdfa71b00 100755 --- a/wpaspy/test.py +++ b/wpaspy/test.py @@ -27,7 +27,7 @@ def wpas_connect(host=None, port=9877): if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] - except OSError, error: + except OSError as error: print "Could not find wpa_supplicant: ", error return None @@ -39,7 +39,7 @@ def wpas_connect(host=None, port=9877): try: wpas = wpaspy.Ctrl(ctrl) return wpas - except Exception, e: + except Exception as e: pass return None From patchwork Thu Jan 24 07:45:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hkhr4drM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hxoF1rN7"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lctX50Cwz9s9G for ; Thu, 24 Jan 2019 20:53:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CWJcf9zRf2Qh4O3I3VYfBKWHeiSGSkRQGMi1xzPDFVc=; b=hkhr4drM4GTHIgw/wf3fdMOFYQ wHOnTOwhh3cqL9GEBUbfnbVZ36staff5hrtGpp2ih5EZwK46xWQeufLYu1Hv5m6hjGumhGv4e8MMr LdrNoU9wH7Sdi+vKErygmlHlLjbZZiA7O9f8sqy/Ym0VBePOFo1iCxB3jhUqlRSYz6kDY11Xh9NVK hD0iXHf25Fz3nEJdOq4xgWBWqFg2Vhu58S8Ywpy2cQcE1NVYIH1K8q9+GiKA8L0uc47AU08n66L2J VykIfBN45Wr5zr0Y7ZOeBLh588g3RfVhKTXpj3Y0FN8KSNNXtjujX71LgQM+WNVPPD+xrCT9hMa3m JZqM0D7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmbhh-00023K-FG; Thu, 24 Jan 2019 09:53:45 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZit-0005fP-HA for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:20 +0000 Received: by mail-pf1-x42c.google.com with SMTP id b7so2580055pfi.8 for ; Wed, 23 Jan 2019 23:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=guJ8L41AWozbtYKQcvdo9luKYbHaqMWkoAChHZwKwy8=; b=hxoF1rN7QG7RiC7iQm7NpaQ1dxqT9U/tL+WgK9Gi5LEMZzkArLdAc8IXIazxLG0KBC S6oIUn6rC32DMw534AQjghmvUpM02D8kc5nCxKSDUOHFyLHDfjqJZ2YeklY9hvdR1R3S NJ6tENX2vI52+fAKPr2HoG6IaRDPWyA7/QOQLq/Kyvk7YKqq53fdI+4isBbY0X6o79fK 0nCfLlBByHQiZArSLmYTczMaH57fumT2xan5QafrEyqzynnQ9F5hrzDFrmnNMYJD6ug+ PwShYb4XBnNKEsbV90H4h9rF7cxBxwhaTOZ6LnREO+R44vagCBL09JZNg2PQglTxcnys V5TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=guJ8L41AWozbtYKQcvdo9luKYbHaqMWkoAChHZwKwy8=; b=TBiy1WjoIKSd2K1kH4VXBAMlIQBWsIrnlpX/72WJ9yT5pgkmoV9cYsOH0FpDAABkiC JXvEViXoaXhFdfqtQGDzg9b3jXg6Ty7sK5yHl7vbNCvv8eD+6H84TvNRbjrerCVJHEZQ 8Rj65ac1JIV+kt7wuM+jxMz5b5u3B3dXO7bgc1A+oE98iiuNlwlLk9VmWnv5VOVqun2A fwmuUkL4AT7GiqU/teTNL7yN4yugHcXrmPUc9upa0R1j8p38mC555bVaLeFFAjFHPZNk g8KmUGWeNlsBYUuSaSYmu2eT4TPVsal6bN0lSrIctic4rcN910zNm7GL1g3/mDgcrvPL u0hg== X-Gm-Message-State: AJcUukdBSnbOTQH5o79fEl1QSEgE0EZYIIkRb6tlWkHL2PMpP9Wk33YA E1Yc3V+QjoL9EuwJL37x4g12r2i/ X-Google-Smtp-Source: ALg8bN5hz0aQUFHJMTXOV8usOsHq4fDFl94Tpt+zqVf5TzbJg0rD8xGowy4bdH8+iR3L0ddZkYLWMg== X-Received: by 2002:a62:39cb:: with SMTP id u72mr5406738pfj.223.1548316007446; Wed, 23 Jan 2019 23:46:47 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:46 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 02/50] tests: Use python3 compatible print statement Date: Thu, 24 Jan 2019 16:45:42 +0900 Message-Id: <20190124074630.4192-3-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234651_909019_F4BDA47B X-CRM114-Status: GOOD ( 14.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Mailman-Approved-At: Thu, 24 Jan 2019 01:53:44 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f print -w -n Signed-off-by: Masashi Honma --- hostapd/wps-ap-nfc.py | 50 +++---- tests/hwsim/hwsim.py | 6 +- tests/hwsim/rfkill.py | 8 +- tests/hwsim/run-tests.py | 60 ++++---- tests/hwsim/test_ap_hs20.py | 2 +- tests/hwsim/test_ap_wps.py | 2 +- tests/hwsim/test_gas.py | 2 +- tests/hwsim/test_p2p_messages.py | 2 +- tests/hwsim/test_wpas_ctrl.py | 2 +- tests/hwsim/vm/parallel-vm.py | 38 ++--- tests/hwsim/wpasupplicant.py | 2 +- tests/remote/run-tests.py | 20 +-- tests/remote/test_devices.py | 30 ++-- wpa_supplicant/eapol_test.py | 2 +- wpa_supplicant/examples/dbus-listen-preq.py | 16 +- wpa_supplicant/examples/dpp-qrcode.py | 32 ++-- wpa_supplicant/examples/p2p-nfc.py | 140 +++++++++--------- wpa_supplicant/examples/p2p/p2p_connect.py | 66 ++++----- wpa_supplicant/examples/p2p/p2p_disconnect.py | 28 ++-- wpa_supplicant/examples/p2p/p2p_find.py | 32 ++-- wpa_supplicant/examples/p2p/p2p_flush.py | 28 ++-- wpa_supplicant/examples/p2p/p2p_group_add.py | 48 +++--- wpa_supplicant/examples/p2p/p2p_invite.py | 42 +++--- wpa_supplicant/examples/p2p/p2p_listen.py | 30 ++-- wpa_supplicant/examples/p2p/p2p_stop_find.py | 30 ++-- .../examples/wpas-dbus-new-getall.py | 28 ++-- .../examples/wpas-dbus-new-signals.py | 34 ++--- wpa_supplicant/examples/wpas-dbus-new-wps.py | 16 +- wpa_supplicant/examples/wpas-dbus-new.py | 16 +- wpa_supplicant/examples/wpas-test.py | 6 +- wpa_supplicant/examples/wps-nfc.py | 104 ++++++------- wpa_supplicant/utils/log2pcap.py | 2 +- wpaspy/test.py | 24 +-- 33 files changed, 474 insertions(+), 474 deletions(-) diff --git a/hostapd/wps-ap-nfc.py b/hostapd/wps-ap-nfc.py index 9e24d6088..258d84148 100755 --- a/hostapd/wps-ap-nfc.py +++ b/hostapd/wps-ap-nfc.py @@ -26,7 +26,7 @@ summary_file = None success_file = None def summary(txt): - print txt + print(txt) if summary_file: with open(summary_file, 'a') as f: f.write(txt + "\n") @@ -43,11 +43,11 @@ def wpas_connect(): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] except OSError as error: - print "Could not find hostapd: ", error + print("Could not find hostapd: ", error) return None if len(ifaces) < 1: - print "No hostapd control interface found" + print("No hostapd control interface found") return None for ctrl in ifaces: @@ -133,23 +133,23 @@ class HandoverServer(nfc.handover.HandoverServer): def process_request(self, request): summary("HandoverServer - request received") try: - print "Parsed handover request: " + request.pretty() + print("Parsed handover request: " + request.pretty()) except Exception as e: - print e - print str(request).encode("hex") + print(e) + print(str(request).encode("hex")) sel = nfc.ndef.HandoverSelectMessage(version="1.2") for carrier in request.carriers: - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.wsc": summary("WPS carrier type match - add WPS carrier record") data = wpas_get_handover_sel() if data is None: summary("Could not get handover select carrier record from hostapd") continue - print "Handover select carrier record from hostapd:" - print data.encode("hex") + print("Handover select carrier record from hostapd:") + print(data.encode("hex")) if "OK" in wpas_report_handover(carrier.record, data): success_report("Handover reported successfully") else: @@ -158,12 +158,12 @@ class HandoverServer(nfc.handover.HandoverServer): message = nfc.ndef.Message(data); sel.add_carrier(message[0], "active", message[1:]) - print "Handover select:" + print("Handover select:") try: - print sel.pretty() + print(sel.pretty()) except Exception as e: - print e - print str(sel).encode("hex") + print(e) + print(str(sel).encode("hex")) summary("Sending handover select") self.success = True @@ -174,7 +174,7 @@ def wps_tag_read(tag): success = False if len(tag.ndef.message): for record in tag.ndef.message: - print "record type " + record.type + print("record type " + record.type) if record.type == "application/vnd.wfa.wsc": summary("WPS tag - send to hostapd") success = wpas_tag_read(tag.ndef.message) @@ -193,7 +193,7 @@ def rdwr_connected_write(tag): global write_data tag.ndef.message = str(write_data) success_report("Tag write succeeded") - print "Done - remove tag" + print("Done - remove tag") global only_one if only_one: global continue_loop @@ -211,7 +211,7 @@ def wps_write_config_tag(clf, wait_remove=True): summary("Could not get WPS config token from hostapd") return - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_write}) @@ -224,7 +224,7 @@ def wps_write_password_tag(clf, wait_remove=True): summary("Could not get WPS password token from hostapd") return - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_write}) @@ -233,11 +233,11 @@ def rdwr_connected(tag): summary("Tag connected: " + str(tag)) if tag.ndef: - print "NDEF tag: " + tag.type + print("NDEF tag: " + tag.type) try: - print tag.ndef.message.pretty() + print(tag.ndef.message.pretty()) except Exception as e: - print e + print(e) success = wps_tag_read(tag) if only_one and success: global continue_loop @@ -250,13 +250,13 @@ def rdwr_connected(tag): def llcp_startup(clf, llc): - print "Start LLCP server" + print("Start LLCP server") global srv srv = HandoverServer(llc) return llc def llcp_connected(llc): - print "P2P LLCP connected" + print("P2P LLCP connected") global wait_connection wait_connection = False global srv @@ -304,7 +304,7 @@ def main(): try: if not clf.open("usb"): - print "Could not open connection with an NFC device" + print("Could not open connection with an NFC device") raise SystemExit if args.command == "write-config": @@ -317,7 +317,7 @@ def main(): global continue_loop while continue_loop: - print "Waiting for a tag or peer to be touched" + print("Waiting for a tag or peer to be touched") wait_connection = True try: if not clf.connect(rdwr={'on-connect': rdwr_connected}, @@ -325,7 +325,7 @@ def main(): 'on-connect': llcp_connected}): break except Exception as e: - print "clf.connect failed" + print("clf.connect failed") global srv if only_one and srv and srv.success: diff --git a/tests/hwsim/hwsim.py b/tests/hwsim/hwsim.py index 23bfe32e9..9300922a8 100644 --- a/tests/hwsim/hwsim.py +++ b/tests/hwsim/hwsim.py @@ -75,11 +75,11 @@ class HWSimRadio(object): def create(args): - print 'Created radio %d' % c.create_radio(n_channels=args.channels, - use_chanctx=args.chanctx) + print('Created radio %d' % c.create_radio(n_channels=args.channels, + use_chanctx=args.chanctx)) def destroy(args): - print c.destroy_radio(args.radio) + print(c.destroy_radio(args.radio)) if __name__ == '__main__': import argparse diff --git a/tests/hwsim/rfkill.py b/tests/hwsim/rfkill.py index d85d68e1a..fa724ae50 100755 --- a/tests/hwsim/rfkill.py +++ b/tests/hwsim/rfkill.py @@ -111,7 +111,7 @@ class RFKill(object): @classmethod def block_all(cls, t=TYPE_ALL): rfk = open('/dev/rfkill', 'w') - print rfk + print(rfk) s = struct.pack(_event_struct, 0, t, _OP_CHANGE_ALL, 1, 0) rfk.write(s) rfk.close() @@ -145,6 +145,6 @@ class RFKill(object): if __name__ == "__main__": for r, s, h in RFKill.list(): - print "%d: %s: %s" % (r.idx, r.name, r.type_name) - print "\tSoft blocked: %s" % ("yes" if s else "no") - print "\tHard blocked: %s" % ("yes" if h else "no") + print("%d: %s: %s" % (r.idx, r.name, r.type_name)) + print("\tSoft blocked: %s" % ("yes" if s else "no")) + print("\tHard blocked: %s" % ("yes" if h else "no")) diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 1649f3fdb..efcdc130a 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -49,7 +49,7 @@ def reset_devs(dev, apdev): d.reset() except Exception as e: logger.info("Failed to reset device " + d.ifname) - print str(e) + print(str(e)) ok = False wpas = None @@ -76,7 +76,7 @@ def reset_devs(dev, apdev): hapd.remove(ap['ifname']) except Exception as e: logger.info("Failed to remove hostapd interface") - print str(e) + print(str(e)) ok = False return ok @@ -94,8 +94,8 @@ def add_log_file(conn, test, run, type, path): conn.execute(sql, params) conn.commit() except Exception as e: - print "sqlite: " + str(e) - print "sql: %r" % (params, ) + print("sqlite: " + str(e)) + print("sql: %r" % (params, )) def report(conn, prefill, build, commit, run, test, result, duration, logdir, sql_commit=True): @@ -113,8 +113,8 @@ def report(conn, prefill, build, commit, run, test, result, duration, logdir, if sql_commit: conn.commit() except Exception as e: - print "sqlite: " + str(e) - print "sql: %r" % (params, ) + print("sqlite: " + str(e)) + print("sql: %r" % (params, )) if result == "FAIL": for log in [ "log", "log0", "log1", "log2", "log3", "log5", @@ -142,7 +142,7 @@ class DataCollector(object): l += self._trace_cmd.stdout.read(1) res = self._trace_cmd.returncode if res: - print "Failed calling trace-cmd: returned exit status %d" % res + print("Failed calling trace-cmd: returned exit status %d" % res) sys.exit(1) if self._dbus: output = os.path.abspath(os.path.join(self._logdir, '%s.dbus' % (self._testname, ))) @@ -152,7 +152,7 @@ class DataCollector(object): cwd=self._logdir) res = self._dbus_cmd.returncode if res: - print "Failed calling dbus-monitor: returned exit status %d" % res + print("Failed calling dbus-monitor: returned exit status %d" % res) sys.exit(1) def __exit__(self, type, value, traceback): if self._tracing: @@ -249,12 +249,12 @@ def main(): args = parser.parse_args() if (args.tests and args.testmodules) or (args.tests and args.mfile) or (args.testmodules and args.mfile): - print 'Invalid arguments - only one of (test, test modules, modules file) can be given.' + print('Invalid arguments - only one of (test, test modules, modules file) can be given.') sys.exit(2) if args.database: if not sqlite3_imported: - print "No sqlite3 module found" + print("No sqlite3 module found") sys.exit(2) conn = sqlite3.connect(args.database) conn.execute('CREATE TABLE IF NOT EXISTS results (test,result,run,time,duration,build,commitid)') @@ -295,17 +295,17 @@ def main(): for t in tests_to_run: name = t.__name__.replace('test_', '', 1) if t.__doc__ is None: - print name + " - MISSING DESCRIPTION" + print(name + " - MISSING DESCRIPTION") else: - print name + " - " + t.__doc__ + print(name + " - " + t.__doc__) if conn: sql = 'INSERT OR REPLACE INTO tests(test,description) VALUES (?, ?)' params = (name, t.__doc__) try: conn.execute(sql, params) except Exception as e: - print "sqlite: " + str(e) - print "sql: %r" % (params,) + print("sqlite: " + str(e)) + print("sql: %r" % (params,)) if conn: conn.commit() conn.close() @@ -385,7 +385,7 @@ def main(): count = 0 if args.stdin_ctrl: - print "READY" + print("READY") sys.stdout.flush() num_tests = 0 else: @@ -413,7 +413,7 @@ def main(): t = tt break if not t: - print "NOT-FOUND" + print("NOT-FOUND") sys.stdout.flush() continue else: @@ -463,7 +463,7 @@ def main(): msg = "START {} {}/{}".format(name, count, num_tests) logger.info(msg) if args.loglevel == logging.WARNING: - print msg + print(msg) sys.stdout.flush() if t.__doc__: logger.info("Test: " + t.__doc__) @@ -480,7 +480,7 @@ def main(): except Exception as e: logger.info("Failed to issue TEST-START before " + name + " for " + d.ifname) logger.info(e) - print "FAIL " + name + " - could not start test" + print("FAIL " + name + " - could not start test") if conn: conn.close() conn = None @@ -504,7 +504,7 @@ def main(): if country != "00": d.dump_monitor() logger.info("Country code not reset back to 00: is " + country) - print "Country code not reset back to 00: is " + country + print("Country code not reset back to 00: is " + country) result = "FAIL" # Try to wait for cfg80211 regulatory state to @@ -516,10 +516,10 @@ def main(): if country == "00": break if country == "00": - print "Country code cleared back to 00" + print("Country code cleared back to 00") logger.info("Country code cleared back to 00") else: - print "Country code remains set - expect following test cases to fail" + print("Country code remains set - expect following test cases to fail") logger.info("Country code remains set - expect following test cases to fail") break except HwsimSkip as e: @@ -535,7 +535,7 @@ def main(): logger.info(e) traceback.print_exc() if args.loglevel == logging.WARNING: - print "Exception: " + str(e) + print("Exception: " + str(e)) result = "FAIL" open('/dev/kmsg', 'w').write('TEST-STOP %s @%.6f\n' % (name, time.time())) for d in dev: @@ -547,7 +547,7 @@ def main(): logger.info(e) result = "FAIL" if args.no_reset: - print "Leaving devices in current state" + print("Leaving devices in current state") else: reset_ok = reset_devs(dev, apdev) wpas = None @@ -566,8 +566,8 @@ def main(): try: hapd = HostapdGlobal() except Exception as e: - print "Failed to connect to hostapd interface" - print str(e) + print("Failed to connect to hostapd interface") + print(str(e)) reset_ok = False result = "FAIL" hapd = None @@ -609,11 +609,11 @@ def main(): result = "{} {} {} {}".format(result, name, diff.total_seconds(), end) logger.info(result) if args.loglevel == logging.WARNING: - print result + print(result) sys.stdout.flush() if not reset_ok: - print "Terminating early due to device reset failure" + print("Terminating early due to device reset failure") break if args.stdin_ctrl: set_term_echo(sys.stdin.fileno(), True) @@ -635,15 +635,15 @@ def main(): logger.info("skipped {} test case(s)".format(len(skipped))) logger.info("failed tests: " + ' '.join(failed)) if args.loglevel == logging.WARNING: - print "failed tests: " + ' '.join(failed) + print("failed tests: " + ' '.join(failed)) sys.exit(1) logger.info("passed all {} test case(s)".format(len(passed))) if len(skipped): logger.info("skipped {} test case(s)".format(len(skipped))) if args.loglevel == logging.WARNING: - print "passed all {} test case(s)".format(len(passed)) + print("passed all {} test case(s)".format(len(passed))) if len(skipped): - print "skipped {} test case(s)".format(len(skipped)) + print("skipped {} test case(s)".format(len(skipped))) if __name__ == "__main__": main() diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index ec5ac026b..97d9dd6d2 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -3365,7 +3365,7 @@ def test_ap_hs20_req_operator_icon(dev, apdev): if "hs20_operator_icon_metadata" not in bss: raise Exception("hs20_operator_icon_metadata missing from BSS entry") if bss["hs20_operator_icon_metadata"] != binascii.hexlify(value): - print binascii.hexlify(value) + print(binascii.hexlify(value)) raise Exception("Unexpected hs20_operator_icon_metadata value: " + bss["hs20_operator_icon_metadata"]) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index ad72faf7f..101690a1c 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -9292,7 +9292,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): conn.request("GET", "/unknown") try: resp = conn.getresponse() - print resp.status + print(resp.status) except: pass diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 71b1fafd7..a6f0a7fd6 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -1695,7 +1695,7 @@ def test_gas_anqp_venue_url2(dev, apdev): if 'anqp[277]' not in bss: raise Exception("Venue URL ANQP-element not seen") if bss['anqp[277]'] != venue_url: - print venue_url + print(venue_url) raise Exception("Unexpected Venue URL ANQP-element value: " + bss['anqp[277]']) if 'anqp_capability_list' not in bss: diff --git a/tests/hwsim/test_p2p_messages.py b/tests/hwsim/test_p2p_messages.py index 5ecdb2604..7befbdce1 100644 --- a/tests/hwsim/test_p2p_messages.py +++ b/tests/hwsim/test_p2p_messages.py @@ -1316,7 +1316,7 @@ def test_p2p_msg_go_neg_req(dev, apdev): hapd.mgmt_tx(msg) frame = hapd.mgmt_rx(timeout=0.1) if frame is not None: - print frame + print(frame) raise Exception("Unexpected GO Neg Response") # missing atributes diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index d1b97634b..fece8f170 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -1485,7 +1485,7 @@ def test_wpas_ctrl_dump(dev, apdev): if res == 'FAIL\n': res = "null" if res != vals[field]: - print "'{}' != '{}'".format(res, vals[field]) + print("'{}' != '{}'".format(res, vals[field])) raise Exception("Mismatch in config field " + field) if "beacon_int" not in vals: raise Exception("Missing config field") diff --git a/tests/hwsim/vm/parallel-vm.py b/tests/hwsim/vm/parallel-vm.py index 7e6d81b2b..23d76f145 100755 --- a/tests/hwsim/vm/parallel-vm.py +++ b/tests/hwsim/vm/parallel-vm.py @@ -374,7 +374,7 @@ def main(): if args.long: extra_args += [ '--long' ] if args.codecov: - print "Code coverage - build separate binaries" + print("Code coverage - build separate binaries") logdir = os.path.join(dir, str(timestamp)) os.makedirs(logdir) subprocess.check_call([os.path.join(scriptsdir, 'build-codecov.sh'), @@ -427,7 +427,7 @@ def main(): vm = {} for i in range(0, num_servers): - print("\rStarting virtual machine {}/{}".format(i + 1, num_servers)), + print(("\rStarting virtual machine {}/{}".format(i + 1, num_servers)), end=' ') logger.info("Starting virtual machine {}/{}".format(i + 1, num_servers)) cmd = [os.path.join(scriptsdir, 'vm-run.sh'), '--delay', str(i), '--timestamp', str(timestamp), @@ -448,7 +448,7 @@ def main(): fd = stream.fileno() fl = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) - print + print() curses.wrapper(show_progress) @@ -459,26 +459,26 @@ def main(): failed = get_failed(vm) if first_run_failures: - print "To re-run same failure sequence(s):" + print("To re-run same failure sequence(s):") for i in range(0, num_servers): if len(vm[i]['failed']) == 0: continue - print "./vm-run.sh", + print("./vm-run.sh", end=' ') if args.long: - print "--long", + print("--long", end=' ') skip = len(vm[i]['fail_seq']) skip -= min(skip, 30) for t in vm[i]['fail_seq']: if skip > 0: skip -= 1 continue - print t, - print - print "Failed test cases:" + print(t, end=' ') + print() + print("Failed test cases:") for f in first_run_failures: - print f, + print(f, end=' ') logger.info("Failed: " + f) - print + print() double_failed = [] for name in failed: double_failed.append(name) @@ -487,21 +487,21 @@ def main(): if not rerun_failures: pass elif failed and not double_failed: - print "All failed cases passed on retry" + print("All failed cases passed on retry") logger.info("All failed cases passed on retry") elif double_failed: - print "Failed even on retry:" + print("Failed even on retry:") for f in double_failed: - print f, + print(f, end=' ') logger.info("Failed on retry: " + f) - print + print() res = "TOTAL={} PASS={} FAIL={} SKIP={}".format(total_started, total_passed, total_failed, total_skipped) print(res) logger.info(res) - print "Logs: " + dir + '/' + str(timestamp) + print("Logs: " + dir + '/' + str(timestamp)) logger.info("Logs: " + dir + '/' + str(timestamp)) for i in range(0, num_servers): @@ -511,11 +511,11 @@ def main(): log = '{}/{}.srv.{}/console'.format(dir, timestamp, i + 1) with open(log, 'r') as f: if "Kernel panic" in f.read(): - print "Kernel panic in " + log + print("Kernel panic in " + log) logger.info("Kernel panic in " + log) if codecov: - print "Code coverage - preparing report" + print("Code coverage - preparing report") for i in range(num_servers): subprocess.check_call([os.path.join(scriptsdir, 'process-codecov.sh'), @@ -523,7 +523,7 @@ def main(): str(i)]) subprocess.check_call([os.path.join(scriptsdir, 'combine-codecov.sh'), logdir]) - print "file://%s/index.html" % logdir + print("file://%s/index.html" % logdir) logger.info("Code coverage report: file://%s/index.html" % logdir) if double_failed or (failed and not rerun_failures): diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 5b57b76c3..a7d54b84e 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -240,7 +240,7 @@ class WpaSupplicant: iter = iter + 1 if iter == 60: logger.error(self.ifname + ": Driver scan state did not clear") - print "Trying to clear cfg80211/mac80211 scan state" + print("Trying to clear cfg80211/mac80211 scan state") status, buf = self.host.execute(["ifconfig", self.ifname, "down"]) if status != 0: logger.info("ifconfig failed: " + buf) diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index 5ea2bd1e2..3b8bd5867 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -30,10 +30,10 @@ from utils import HwsimSkip from hwsim_wrapper import run_hwsim_test def usage(): - print "USAGE: " + sys.argv[0] + " -t devices" - print "USAGE: " + sys.argv[0] + " -t check_devices" - print "USAGE: " + sys.argv[0] + " -d -t [-r ] [-c ] [-m ] [-h hwsim_tests][-R][-T][-P][-v]" - print "USAGE: " + sys.argv[0] + print("USAGE: " + sys.argv[0] + " -t devices") + print("USAGE: " + sys.argv[0] + " -t check_devices") + print("USAGE: " + sys.argv[0] + " -d -t [-r ] [-c ] [-m ] [-h hwsim_tests][-R][-T][-P][-v]") + print("USAGE: " + sys.argv[0]) def get_devices(devices, duts, refs, monitors): for dut in duts: @@ -215,15 +215,15 @@ def main(): # print help if requested_tests[0] == "help" and len(requested_hwsim_tests) == 0: usage() - print "\nAvailable Devices:" + print("\nAvailable Devices:") for device in devices: - print "\t", device['name'] - print "\nAvailable tests:" + print("\t", device['name']) + print("\nAvailable tests:") for test in test_names: - print "\t", test - print "\nAvailable hwsim tests:" + print("\t", test) + print("\nAvailable hwsim tests:") for hwsim_test in hwsim_tests: - print "\t", hwsim_test.__name__.replace('test_', '', 1) + print("\t", hwsim_test.__name__.replace('test_', '', 1)) return # show/check devices diff --git a/tests/remote/test_devices.py b/tests/remote/test_devices.py index 6d84d11cb..ccd9984a2 100644 --- a/tests/remote/test_devices.py +++ b/tests/remote/test_devices.py @@ -24,57 +24,57 @@ import hostapd def show_devices(devices, setup_params): """Show/check available devices""" - print "Devices:" + print("Devices:") for device in devices: host = rutils.get_host(devices, device['name']) # simple check if authorized_keys works correctly status, buf = host.execute(["id"]) if status != 0: - print "[" + host.name + "] - ssh communication: FAILED" + print("[" + host.name + "] - ssh communication: FAILED") continue else: - print "[" + host.name + "] - ssh communication: OK" + print("[" + host.name + "] - ssh communication: OK") # check setup_hw works correctly rutils.setup_hw_host(host, setup_params) # show uname status, buf = host.execute(["uname", "-s", "-n", "-r", "-m", "-o"]) - print "\t" + buf + print("\t" + buf) # show ifconfig ifaces = re.split('; | |, ', host.ifname) for iface in ifaces: status, buf = host.execute(["ifconfig", iface]) if status != 0: - print "\t" + iface + " failed\n" + print("\t" + iface + " failed\n") continue lines = buf.splitlines() for line in lines: - print "\t" + line + print("\t" + line) # check hostapd, wpa_supplicant, iperf exist status, buf = host.execute([setup_params['wpa_supplicant'], "-v"]) if status != 0: - print "\t" + setup_params['wpa_supplicant'] + " not find\n" + print("\t" + setup_params['wpa_supplicant'] + " not find\n") continue lines = buf.splitlines() for line in lines: - print "\t" + line - print "" + print("\t" + line) + print("") status, buf = host.execute([setup_params['hostapd'], "-v"]) if status != 1: - print "\t" + setup_params['hostapd'] + " not find\n" + print("\t" + setup_params['hostapd'] + " not find\n") continue lines = buf.splitlines() for line in lines: - print "\t" + line - print "" + print("\t" + line) + print("") status, buf = host.execute([setup_params['iperf'], "-v"]) if status != 0 and status != 1: - print "\t" + setup_params['iperf'] + " not find\n" + print("\t" + setup_params['iperf'] + " not find\n") continue lines = buf.splitlines() for line in lines: - print "\t" + line - print "" + print("\t" + line) + print("") def check_device(devices, setup_params, dev_name, monitor=False): host = rutils.get_host(devices, dev_name) diff --git a/wpa_supplicant/eapol_test.py b/wpa_supplicant/eapol_test.py index 80e7dfcf5..734428d29 100755 --- a/wpa_supplicant/eapol_test.py +++ b/wpa_supplicant/eapol_test.py @@ -136,7 +136,7 @@ def main(): results = res[i].get(False) except: results = "N/A" - print "%d: %s" % (i, results) + print("%d: %s" % (i, results)) if __name__ == "__main__": main() diff --git a/wpa_supplicant/examples/dbus-listen-preq.py b/wpa_supplicant/examples/dbus-listen-preq.py index 5ac9859f7..8f76713c7 100755 --- a/wpa_supplicant/examples/dbus-listen-preq.py +++ b/wpa_supplicant/examples/dbus-listen-preq.py @@ -12,21 +12,21 @@ WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface" def usage(): - print "Usage: %s " % sys.argv[0] - print "Press Ctrl-C to stop" + print("Usage: %s " % sys.argv[0]) + print("Press Ctrl-C to stop") def ProbeRequest(args): if 'addr' in args: - print '%.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(args['addr']), + print('%.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(args['addr']), end=' ') if 'dst' in args: - print '-> %.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(args['dst']), + print('-> %.2x:%.2x:%.2x:%.2x:%.2x:%.2x' % tuple(args['dst']), end=' ') if 'bssid' in args: - print '(bssid %.2x:%.2x:%.2x:%.2x:%.2x:%.2x)' % tuple(args['dst']), + print('(bssid %.2x:%.2x:%.2x:%.2x:%.2x:%.2x)' % tuple(args['dst']), end=' ') if 'signal' in args: - print 'signal:%d' % args['signal'], + print('signal:%d' % args['signal'], end=' ') if 'ies' in args: - print 'have IEs (%d bytes)' % len(args['ies']), - print '' + print('have IEs (%d bytes)' % len(args['ies']), end=' ') + print('') if __name__ == "__main__": global bus diff --git a/wpa_supplicant/examples/dpp-qrcode.py b/wpa_supplicant/examples/dpp-qrcode.py index f40f96198..fdceef58e 100755 --- a/wpa_supplicant/examples/dpp-qrcode.py +++ b/wpa_supplicant/examples/dpp-qrcode.py @@ -25,11 +25,11 @@ def wpas_connect(): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] except OSError as error: - print "Could not find wpa_supplicant: ", error + print("Could not find wpa_supplicant: ", error) return None if len(ifaces) < 1: - print "No wpa_supplicant control interface found" + print("No wpa_supplicant control interface found") return None for ctrl in ifaces: @@ -55,27 +55,27 @@ def dpp_logcat(): continue if not uri.startswith('DPP:'): continue - print "Found DPP bootstrap info URI:" - print uri + print("Found DPP bootstrap info URI:") + print(uri) wpas = wpas_connect() if not wpas: - print "Could not connect to wpa_supplicant" - print + print("Could not connect to wpa_supplicant") + print() continue res = wpas.request("DPP_QR_CODE " + uri); try: id = int(res) except ValueError: - print "QR Code URI rejected" + print("QR Code URI rejected") continue - print "QR Code URI accepted - ID=%d" % id - print wpas.request("DPP_BOOTSTRAP_INFO %d" % id) + print("QR Code URI accepted - ID=%d" % id) + print(wpas.request("DPP_BOOTSTRAP_INFO %d" % id)) del wpas def dpp_display(curve): wpas = wpas_connect() if not wpas: - print "Could not connect to wpa_supplicant" + print("Could not connect to wpa_supplicant") return res = wpas.request("STATUS") addr = None @@ -93,18 +93,18 @@ def dpp_display(curve): try: id = int(res) except ValueError: - print "Failed to generate bootstrap info URI" + print("Failed to generate bootstrap info URI") return - print "Bootstrap information - ID=%d" % id - print wpas.request("DPP_BOOTSTRAP_INFO %d" % id) + print("Bootstrap information - ID=%d" % id) + print(wpas.request("DPP_BOOTSTRAP_INFO %d" % id)) uri = wpas.request("DPP_BOOTSTRAP_GET_URI %d" % id) - print uri - print "ID=%d" % id + print(uri) + print("ID=%d" % id) qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_M, border=3) qr.add_data(uri, optimize=5) qr.print_ascii(tty=True) - print "ID=%d" % id + print("ID=%d" % id) del wpas def main(): diff --git a/wpa_supplicant/examples/p2p-nfc.py b/wpa_supplicant/examples/p2p-nfc.py index 646f452ea..889ac8bff 100755 --- a/wpa_supplicant/examples/p2p-nfc.py +++ b/wpa_supplicant/examples/p2p-nfc.py @@ -37,7 +37,7 @@ summary_file = None success_file = None def summary(txt): - print txt + print(txt) if summary_file: with open(summary_file, 'a') as f: f.write(txt + "\n") @@ -54,11 +54,11 @@ def wpas_connect(): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] except OSError as error: - print "Could not find wpa_supplicant: ", error + print("Could not find wpa_supplicant: ", error) return None if len(ifaces) < 1: - print "No wpa_supplicant control interface found" + print("No wpa_supplicant control interface found") return None for ctrl in ifaces: @@ -66,7 +66,7 @@ def wpas_connect(): if ifname not in ctrl: continue try: - print "Trying to use control interface " + ctrl + print("Trying to use control interface " + ctrl) wpas = wpaspy.Ctrl(ctrl) return wpas except Exception as e: @@ -160,30 +160,30 @@ def p2p_handover_client(llc): if (data == None): summary("Could not get handover request carrier record from wpa_supplicant") return - print "Handover request carrier record from wpa_supplicant: " + data.encode("hex") + print("Handover request carrier record from wpa_supplicant: " + data.encode("hex")) datamsg = nfc.ndef.Message(data) message.add_carrier(datamsg[0], "active", datamsg[1:]) global include_wps_req if include_wps_req: - print "Handover request (pre-WPS):" + print("Handover request (pre-WPS):") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e + print(e) data = wpas_get_handover_req_wps() if data: - print "Add WPS request in addition to P2P" + print("Add WPS request in addition to P2P") datamsg = nfc.ndef.Message(data) message.add_carrier(datamsg[0], "active", datamsg[1:]) - print "Handover request:" + print("Handover request:") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e - print str(message).encode("hex") + print(e) + print(str(message).encode("hex")) client = nfc.handover.HandoverClient(llc) try: @@ -217,41 +217,41 @@ def p2p_handover_client(llc): client.close() return - print "Received message" + print("Received message") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e - print str(message).encode("hex") + print(e) + print(str(message).encode("hex")) message = nfc.ndef.HandoverSelectMessage(message) summary("Handover select received") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e + print(e) for carrier in message.carriers: - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.p2p": - print "P2P carrier type match - send to wpa_supplicant" + print("P2P carrier type match - send to wpa_supplicant") if "OK" in wpas_report_handover(data, carrier.record, "INIT"): success_report("P2P handover reported successfully (initiator)") else: summary("P2P handover report rejected") break - print "Remove peer" + print("Remove peer") client.close() - print "Done with handover" + print("Done with handover") global only_one if only_one: - print "only_one -> stop loop" + print("only_one -> stop loop") global continue_loop continue_loop = False global no_wait if no_wait: - print "Trying to exit.." + print("Trying to exit..") global terminate_now terminate_now = True @@ -283,33 +283,33 @@ class HandoverServer(nfc.handover.HandoverServer): def process_request(self, request): self.ho_server_processing = True clear_raw_mode() - print "HandoverServer - request received" + print("HandoverServer - request received") try: - print "Parsed handover request: " + request.pretty() + print("Parsed handover request: " + request.pretty()) except Exception as e: - print e + print(e) sel = nfc.ndef.HandoverSelectMessage(version="1.2") found = False for carrier in request.carriers: - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.p2p": - print "P2P carrier type match - add P2P carrier record" + print("P2P carrier type match - add P2P carrier record") found = True self.received_carrier = carrier.record - print "Carrier record:" + print("Carrier record:") try: - print carrier.record.pretty() + print(carrier.record.pretty()) except Exception as e: - print e + print(e) data = wpas_get_handover_sel() if data is None: - print "Could not get handover select carrier record from wpa_supplicant" + print("Could not get handover select carrier record from wpa_supplicant") continue - print "Handover select carrier record from wpa_supplicant:" - print data.encode("hex") + print("Handover select carrier record from wpa_supplicant:") + print(data.encode("hex")) self.sent_carrier = data if "OK" in wpas_report_handover(self.received_carrier, self.sent_carrier, "RESP"): success_report("P2P handover reported successfully (responder)") @@ -324,22 +324,22 @@ class HandoverServer(nfc.handover.HandoverServer): for carrier in request.carriers: if found: break - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.wsc": - print "WSC carrier type match - add WSC carrier record" + print("WSC carrier type match - add WSC carrier record") found = True self.received_carrier = carrier.record - print "Carrier record:" + print("Carrier record:") try: - print carrier.record.pretty() + print(carrier.record.pretty()) except Exception as e: - print e + print(e) data = wpas_get_handover_sel_wps() if data is None: - print "Could not get handover select carrier record from wpa_supplicant" + print("Could not get handover select carrier record from wpa_supplicant") continue - print "Handover select carrier record from wpa_supplicant:" - print data.encode("hex") + print("Handover select carrier record from wpa_supplicant:") + print(data.encode("hex")) self.sent_carrier = data if "OK" in wpas_report_handover_wsc(self.received_carrier, self.sent_carrier, "RESP"): success_report("WSC handover reported successfully") @@ -352,12 +352,12 @@ class HandoverServer(nfc.handover.HandoverServer): found = True break - print "Handover select:" + print("Handover select:") try: - print sel.pretty() + print(sel.pretty()) except Exception as e: - print e - print str(sel).encode("hex") + print(e) + print(str(sel).encode("hex")) summary("Sending handover select") self.success = True @@ -396,7 +396,7 @@ def p2p_tag_read(tag): success = False if len(tag.ndef.message): for record in tag.ndef.message: - print "record type " + record.type + print("record type " + record.type) if record.type == "application/vnd.wfa.wsc": summary("WPS tag - send to wpa_supplicant") success = wpas_tag_read(tag.ndef.message) @@ -419,7 +419,7 @@ def rdwr_connected_p2p_write(tag): global p2p_sel_data tag.ndef.message = str(p2p_sel_data) success_report("Tag write succeeded") - print "Done - remove tag" + print("Done - remove tag") global only_one if only_one: global continue_loop @@ -428,7 +428,7 @@ def rdwr_connected_p2p_write(tag): return p2p_sel_wait_remove def wps_write_p2p_handover_sel(clf, wait_remove=True): - print "Write P2P handover select" + print("Write P2P handover select") data = wpas_get_handover_sel(tag=True) if (data == None): summary("Could not get P2P handover select from wpa_supplicant") @@ -440,14 +440,14 @@ def wps_write_p2p_handover_sel(clf, wait_remove=True): p2p_sel_data = nfc.ndef.HandoverSelectMessage(version="1.2") message = nfc.ndef.Message(data); p2p_sel_data.add_carrier(message[0], "active", message[1:]) - print "Handover select:" + print("Handover select:") try: - print p2p_sel_data.pretty() + print(p2p_sel_data.pretty()) except Exception as e: - print e - print str(p2p_sel_data).encode("hex") + print(e) + print(str(p2p_sel_data).encode("hex")) - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_p2p_write}) @@ -456,11 +456,11 @@ def rdwr_connected(tag): summary("Tag connected: " + str(tag)) if tag.ndef: - print "NDEF tag: " + tag.type + print("NDEF tag: " + tag.type) try: - print tag.ndef.message.pretty() + print(tag.ndef.message.pretty()) except Exception as e: - print e + print(e) success = p2p_tag_read(tag) if only_one and success: global continue_loop @@ -475,15 +475,15 @@ def rdwr_connected(tag): def llcp_worker(llc): global init_on_touch if init_on_touch: - print "Starting handover client" + print("Starting handover client") p2p_handover_client(llc) return global no_input if no_input: - print "Wait for handover to complete" + print("Wait for handover to complete") else: - print "Wait for handover to complete - press 'i' to initiate ('w' for WPS only, 'p' for P2P only)" + print("Wait for handover to complete - press 'i' to initiate ('w' for WPS only, 'p' for P2P only)") global srv global wait_connection while not wait_connection and srv.sent_carrier is None: @@ -506,21 +506,21 @@ def llcp_worker(llc): else: continue clear_raw_mode() - print "Starting handover client" + print("Starting handover client") p2p_handover_client(llc) return clear_raw_mode() - print "Exiting llcp_worker thread" + print("Exiting llcp_worker thread") def llcp_startup(clf, llc): - print "Start LLCP server" + print("Start LLCP server") global srv srv = HandoverServer(llc) return llc def llcp_connected(llc): - print "P2P LLCP connected" + print("P2P LLCP connected") global wait_connection wait_connection = False global init_on_touch @@ -587,7 +587,7 @@ def main(): if args.ifname: global ifname ifname = args.ifname - print "Selected ifname " + ifname + print("Selected ifname " + ifname) if args.no_wps_req: global include_wps_req @@ -610,7 +610,7 @@ def main(): try: if not clf.open("usb"): - print "Could not open connection with an NFC device" + print("Could not open connection with an NFC device") raise SystemExit if args.command == "write-p2p-sel": @@ -619,7 +619,7 @@ def main(): global continue_loop while continue_loop: - print "Waiting for a tag or peer to be touched" + print("Waiting for a tag or peer to be touched") wait_connection = True try: if args.tag_read_only: @@ -637,7 +637,7 @@ def main(): terminate=terminate_loop): break except Exception as e: - print "clf.connect failed" + print("clf.connect failed") global srv if only_one and srv and srv.success: diff --git a/wpa_supplicant/examples/p2p/p2p_connect.py b/wpa_supplicant/examples/p2p/p2p_connect.py index cb1208117..6e3d94e20 100644 --- a/wpa_supplicant/examples/p2p/p2p_connect.py +++ b/wpa_supplicant/examples/p2p/p2p_connect.py @@ -13,40 +13,40 @@ from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i -m \ " \ - % sys.argv[0] - print " -a [-p ] [-g ] \ " - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -m = wps method" - print " -a = peer address" - print " -p = pin number (8 digits)" - print " -g = group owner intent" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0 -a 0015008352c0 -m display -p 12345670" % sys.argv[0] + print("Usage:") + print(" %s -i -m \ " \ + % sys.argv[0]) + print(" -a [-p ] [-g ] \ ") + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -m = wps method") + print(" -a = peer address") + print(" -p = pin number (8 digits)") + print(" -g = group owner intent") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0 -a 0015008352c0 -m display -p 12345670" % sys.argv[0]) # Required Signals def GONegotiationSuccess(status): - print "Go Negotiation Success" + print("Go Negotiation Success") def GONegotiationFailure(status): - print 'Go Negotiation Failed. Status:' - print format(status) + print('Go Negotiation Failed. Status:') + print(format(status)) os._exit(0) def GroupStarted(properties): if properties.has_key("group_object"): - print 'Group Formation Complete %s' \ - % properties["group_object"] + print('Group Formation Complete %s' \ + % properties["group_object"]) os._exit(0) def WpsFailure(status, etc): - print "WPS Authentication Failure".format(status) - print etc + print("WPS Authentication Failure".format(status)) + print(etc) os._exit(0) class P2P_Connect(): @@ -157,12 +157,12 @@ class P2P_Connect(): if (self.pin != None): self.p2p_connect_arguements.update({'pin':self.pin}) else: - print "Error:\n Pin required for wps_method=display" + print("Error:\n Pin required for wps_method=display") usage() quit() if (self.go_intent != None and int(self.go_intent) != 15): - print "go_intent overwritten to 15" + print("go_intent overwritten to 15") self.go_intent = '15' @@ -171,14 +171,14 @@ class P2P_Connect(): if (self.pin != None): self.p2p_connect_arguements.update({'pin':self.pin}) else: - print "Error:\n Pin required for wps_method=keypad" + print("Error:\n Pin required for wps_method=keypad") usage() quit() if (self.go_intent != None and int(self.go_intent) == 15): error = "Error :\n Group Owner intent cannot be" + \ " 15 for wps_method=keypad" - print error + print(error) usage() quit() @@ -186,15 +186,15 @@ class P2P_Connect(): # for ./wpa_cli, p2p_connect [mac] [pin#], wps_method=keypad elif (self.wps_method == 'pin'): if (self.pin != None): - print "pin ignored" + print("pin ignored") # No pin is required for pbc so it is ignored elif (self.wps_method == 'pbc'): if (self.pin != None): - print "pin ignored" + print("pin ignored") else: - print "Error:\n wps_method not supported or does not exist" + print("Error:\n wps_method not supported or does not exist") usage() quit() @@ -214,7 +214,7 @@ class P2P_Connect(): if (self.wps_method == 'pin' and \ not self.p2p_connect_arguements.has_key('pin') ): - print "Connect return with pin value of %d " % int(result_pin) + print("Connect return with pin value of %d " % int(result_pin)) gobject.MainLoop().run() if __name__ == "__main__": @@ -268,19 +268,19 @@ if __name__ == "__main__": # Required Arguements check if (interface_name == None or wps_method == None or addr == None): - print "Error:\n Required arguements not specified" + print("Error:\n Required arguements not specified") usage() quit() # Group Owner Intent Check if (go_intent != None and (int(go_intent) > 15 or int(go_intent) < 0) ): - print "Error:\n Group Owner Intent must be between 0 and 15 inclusive" + print("Error:\n Group Owner Intent must be between 0 and 15 inclusive") usage() quit() # Pin Check if (pin != None and len(pin) != 8): - print "Error:\n Pin is not 8 digits" + print("Error:\n Pin is not 8 digits") usage() quit() @@ -289,7 +289,7 @@ if __name__ == "__main__": addr,pin,wps_method,go_intent) except: - print "Error:\n Invalid Arguements" + print("Error:\n Invalid Arguements") usage() quit() diff --git a/wpa_supplicant/examples/p2p/p2p_disconnect.py b/wpa_supplicant/examples/p2p/p2p_disconnect.py index 9ea2c5c38..85b5a8b39 100644 --- a/wpa_supplicant/examples/p2p/p2p_disconnect.py +++ b/wpa_supplicant/examples/p2p/p2p_disconnect.py @@ -12,19 +12,19 @@ import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i \ " \ - % sys.argv[0] - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i p2p-wlan0-0" % sys.argv[0] + print("Usage:") + print(" %s -i \ " \ + % sys.argv[0]) + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i p2p-wlan0-0" % sys.argv[0]) # Required Signals def GroupFinished(status, etc): - print "Disconnected" + print("Disconnected") os._exit(0) class P2P_Disconnect (threading.Thread): @@ -84,7 +84,7 @@ class P2P_Disconnect (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -142,7 +142,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -152,7 +152,7 @@ if __name__ == "__main__": wpas_dbus_interface,timeout) except: - print "Error:\n Invalid wpas_dbus_interface" + print("Error:\n Invalid wpas_dbus_interface") usage() quit() @@ -165,5 +165,5 @@ if __name__ == "__main__": except: pass - print "Disconnect timed out" + print("Disconnect timed out") quit() diff --git a/wpa_supplicant/examples/p2p/p2p_find.py b/wpa_supplicant/examples/p2p/p2p_find.py index 9c860d1e1..e2df52896 100644 --- a/wpa_supplicant/examples/p2p/p2p_find.py +++ b/wpa_supplicant/examples/p2p/p2p_find.py @@ -13,23 +13,23 @@ import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i [-t ] \ " \ - % sys.argv[0] - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -t = timeout = 0s (infinite)" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0 -t 10" % sys.argv[0] + print("Usage:") + print(" %s -i [-t ] \ " \ + % sys.argv[0]) + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -t = timeout = 0s (infinite)") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0 -t 10" % sys.argv[0]) # Required Signals def deviceFound(devicepath): - print "Device found: %s" % (devicepath) + print("Device found: %s" % (devicepath)) def deviceLost(devicepath): - print "Device lost: %s" % (devicepath) + print("Device lost: %s" % (devicepath)) class P2P_Find (threading.Thread): # Needed Variables @@ -88,7 +88,7 @@ class P2P_Find (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -150,7 +150,7 @@ if __name__ == "__main__": if ( int(value) >= 0): timeout = value else: - print "Error:\n Timeout cannot be negative" + print("Error:\n Timeout cannot be negative") usage() quit() # Dbus interface @@ -161,7 +161,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -170,7 +170,7 @@ if __name__ == "__main__": p2p_find_test = P2P_Find(interface_name, wpas_dbus_interface, timeout) except: - print "Error:\n Invalid wpas_dbus_interface" + print("Error:\n Invalid wpas_dbus_interface") usage() quit() diff --git a/wpa_supplicant/examples/p2p/p2p_flush.py b/wpa_supplicant/examples/p2p/p2p_flush.py index 5dfe642c9..42fc7a3e9 100644 --- a/wpa_supplicant/examples/p2p/p2p_flush.py +++ b/wpa_supplicant/examples/p2p/p2p_flush.py @@ -13,19 +13,19 @@ import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i \ " \ - % sys.argv[0] - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0" % sys.argv[0] + print("Usage:") + print(" %s -i \ " \ + % sys.argv[0]) + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0" % sys.argv[0]) # Required Signals\ def deviceLost(devicepath): - print "Device lost: %s" % (devicepath) + print("Device lost: %s" % (devicepath)) class P2P_Flush (threading.Thread): # Needed Variables @@ -84,7 +84,7 @@ class P2P_Flush (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -142,7 +142,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -151,7 +151,7 @@ if __name__ == "__main__": p2p_flush_test = P2P_Flush(interface_name, wpas_dbus_interface,timeout) except: - print "Error:\n Invalid wpas_dbus_interface" + print("Error:\n Invalid wpas_dbus_interface") usage() quit() @@ -164,5 +164,5 @@ if __name__ == "__main__": except: pass - print "p2p_flush complete" + print("p2p_flush complete") quit() diff --git a/wpa_supplicant/examples/p2p/p2p_group_add.py b/wpa_supplicant/examples/p2p/p2p_group_add.py index 4e64892cd..6d408218a 100644 --- a/wpa_supplicant/examples/p2p/p2p_group_add.py +++ b/wpa_supplicant/examples/p2p/p2p_group_add.py @@ -11,30 +11,30 @@ import threading from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i [-p ] \ " \ - % sys.argv[0] - print " [-f ] [-o ] \ " - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -p = persistant group = 0 (0=false, 1=true)" - print " -f = frequency" - print " -o = persistent group object path" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0" % sys.argv[0] + print("Usage:") + print(" %s -i [-p ] \ " \ + % sys.argv[0]) + print(" [-f ] [-o ] \ ") + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -p = persistant group = 0 (0=false, 1=true)") + print(" -f = frequency") + print(" -o = persistent group object path") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0" % sys.argv[0]) # Required Signals def GroupStarted(properties): if properties.has_key("group_object"): - print 'Group Formation Complete %s' \ - % properties["group_object"] + print('Group Formation Complete %s' \ + % properties["group_object"]) os._exit(0) def WpsFailure(status, etc): - print "WPS Authentication Failure".format(status) - print etc + print("WPS Authentication Failure".format(status)) + print(etc) os._exit(0) class P2P_Group_Add (threading.Thread): @@ -102,7 +102,7 @@ class P2P_Group_Add (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -127,7 +127,7 @@ class P2P_Group_Add (threading.Thread): if (int(self.frequency) > 0): self.P2PDictionary.update({'frequency':int(self.frequency)}) else: - print "Error:\n Frequency must be greater than 0" + print("Error:\n Frequency must be greater than 0") usage() os._exit(0) @@ -141,7 +141,7 @@ class P2P_Group_Add (threading.Thread): self.p2p_interface.GroupAdd(self.P2PDictionary) except: - print "Error:\n Could not preform group add" + print("Error:\n Could not preform group add") usage() os._exit(0) @@ -188,7 +188,7 @@ if __name__ == "__main__": elif (value == '1'): persistent = True else: - print "Error:\n Persistent can only be 1 or 0" + print("Error:\n Persistent can only be 1 or 0") usage() os._exit(0) # Frequency @@ -205,7 +205,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -213,10 +213,10 @@ if __name__ == "__main__": p2p_group_add_test = P2P_Group_Add(interface_name,wpas_dbus_interface, persistent,frequency,persistent_group_object) except: - print "Error:\n Invalid Arguements" + print("Error:\n Invalid Arguements") p2p_group_add_test.constructArguements() p2p_group_add_test.start() time.sleep(5) - print "Error:\n Group formation timed out" + print("Error:\n Group formation timed out") os._exit(0) diff --git a/wpa_supplicant/examples/p2p/p2p_invite.py b/wpa_supplicant/examples/p2p/p2p_invite.py index 9413f0227..341dcd0a9 100644 --- a/wpa_supplicant/examples/p2p/p2p_invite.py +++ b/wpa_supplicant/examples/p2p/p2p_invite.py @@ -11,29 +11,29 @@ import threading from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i -a \ " \ - % sys.argv[0] - print " [-o ] [-w ]" - print "Options:" - print " -i = interface name" - print " -a = address of peer" - print " -o = persistent group object path" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i p2p-wlan0-0 -a 00150083523c" % sys.argv[0] + print("Usage:") + print(" %s -i -a \ " \ + % sys.argv[0]) + print(" [-o ] [-w ]") + print("Options:") + print(" -i = interface name") + print(" -a = address of peer") + print(" -o = persistent group object path") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i p2p-wlan0-0 -a 00150083523c" % sys.argv[0]) # Required Signals def InvitationResult(invite_result): - print "Inviation Result signal :" + print("Inviation Result signal :") status = invite_result['status'] - print "status = ", status + print("status = ", status) if invite_result.has_key('BSSID'): bssid = invite_result['BSSID'] - print "BSSID = ", hex(bssid[0]) , ":" , \ + print("BSSID = ", hex(bssid[0]) , ":" , \ hex(bssid[1]) , ":" , hex(bssid[2]) , ":", \ hex(bssid[3]) , ":" , hex(bssid[4]) , ":" , \ - hex(bssid[5]) + hex(bssid[5])) os._exit(0) class P2P_Invite (threading.Thread): @@ -99,7 +99,7 @@ class P2P_Invite (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -127,7 +127,7 @@ class P2P_Invite (threading.Thread): self.p2p_interface.Invite(self.P2PDictionary) except: - print "Error:\n Invalid Arguements" + print("Error:\n Invalid Arguements") usage() os._exit(0) @@ -176,12 +176,12 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() if (addr == None): - print "Error:\n peer address is required" + print("Error:\n peer address is required") usage() quit() @@ -190,12 +190,12 @@ if __name__ == "__main__": P2P_Invite(interface_name,wpas_dbus_interface, addr,persistent_group_object) except: - print "Error:\n Invalid Arguements" + print("Error:\n Invalid Arguements") usage() os._exit(1) p2p_invite_test.constructArguements() p2p_invite_test.start() time.sleep(10) - print "Error:\n p2p_invite timed out" + print("Error:\n p2p_invite timed out") os._exit(0) diff --git a/wpa_supplicant/examples/p2p/p2p_listen.py b/wpa_supplicant/examples/p2p/p2p_listen.py index 1dd61f69c..b0837d9df 100644 --- a/wpa_supplicant/examples/p2p/p2p_listen.py +++ b/wpa_supplicant/examples/p2p/p2p_listen.py @@ -13,20 +13,20 @@ import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i [-t ] \ " \ - % sys.argv[0] - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -t = timeout = 0s (infinite)" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0 -t 5" % sys.argv[0] + print("Usage:") + print(" %s -i [-t ] \ " \ + % sys.argv[0]) + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -t = timeout = 0s (infinite)") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0 -t 5" % sys.argv[0]) # Required Signals def p2pStateChange(status): - print status + print(status) class P2P_Listen(threading.Thread): # Needed Variables @@ -85,7 +85,7 @@ class P2P_Listen(threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -140,7 +140,7 @@ if __name__ == "__main__": if ( int(value) >= 0): timeout = value else: - print "Error:\n Timeout cannot be negative" + print("Error:\n Timeout cannot be negative") usage() quit() # Dbus interface @@ -151,7 +151,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -160,7 +160,7 @@ if __name__ == "__main__": p2p_listen_test = P2P_Listen(interface_name, wpas_dbus_interface, timeout) except: - print "Error:\n Invalid wpas_dbus_interface" + print("Error:\n Invalid wpas_dbus_interface") usage() quit() diff --git a/wpa_supplicant/examples/p2p/p2p_stop_find.py b/wpa_supplicant/examples/p2p/p2p_stop_find.py index 31b54dde0..bdb4c0e32 100644 --- a/wpa_supplicant/examples/p2p/p2p_stop_find.py +++ b/wpa_supplicant/examples/p2p/p2p_stop_find.py @@ -11,22 +11,22 @@ import getopt from dbus.mainloop.glib import DBusGMainLoop def usage(): - print "Usage:" - print " %s -i \ " \ - % sys.argv[0] - print " [-w ]" - print "Options:" - print " -i = interface name" - print " -w = wpas dbus interface = fi.w1.wpa_supplicant1" - print "Example:" - print " %s -i wlan0" % sys.argv[0] + print("Usage:") + print(" %s -i \ " \ + % sys.argv[0]) + print(" [-w ]") + print("Options:") + print(" -i = interface name") + print(" -w = wpas dbus interface = fi.w1.wpa_supplicant1") + print("Example:") + print(" %s -i wlan0" % sys.argv[0]) # Required Signals def deviceLost(devicepath): - print "Device lost: %s" % (devicepath) + print("Device lost: %s" % (devicepath)) def p2pStateChange(status): - print status + print(status) os._exit(0) class P2P_Stop_Find (threading.Thread): @@ -86,7 +86,7 @@ class P2P_Stop_Find (threading.Thread): except dbus.DBusException as exc: error = 'Error:\n Interface ' + self.interface_name \ + ' was not found' - print error + print(error) usage() os._exit(0) @@ -147,7 +147,7 @@ if __name__ == "__main__": # Interface name is required and was not given if (interface_name == None): - print "Error:\n interface_name is required" + print("Error:\n interface_name is required") usage() quit() @@ -157,7 +157,7 @@ if __name__ == "__main__": wpas_dbus_interface,timeout) except: - print "Error:\n Invalid wpas_dbus_interface" + print("Error:\n Invalid wpas_dbus_interface") usage() quit() @@ -170,5 +170,5 @@ if __name__ == "__main__": except: pass - print "p2p find stopped" + print("p2p find stopped") quit() diff --git a/wpa_supplicant/examples/wpas-dbus-new-getall.py b/wpa_supplicant/examples/wpas-dbus-new-getall.py index 03da187c8..469274b45 100755 --- a/wpa_supplicant/examples/wpas-dbus-new-getall.py +++ b/wpa_supplicant/examples/wpas-dbus-new-getall.py @@ -11,8 +11,8 @@ def main(): "/fi/w1/wpa_supplicant1") props = wpas_obj.GetAll("fi.w1.wpa_supplicant1", dbus_interface=dbus.PROPERTIES_IFACE) - print "GetAll(fi.w1.wpa_supplicant1, /fi/w1/wpa_supplicant1):" - print props + print("GetAll(fi.w1.wpa_supplicant1, /fi/w1/wpa_supplicant1):") + print(props) if len(sys.argv) != 2: os._exit(1) @@ -24,15 +24,15 @@ def main(): if_obj = bus.get_object("fi.w1.wpa_supplicant1", path) props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface", dbus_interface=dbus.PROPERTIES_IFACE) - print - print "GetAll(fi.w1.wpa_supplicant1.Interface, %s):" % (path) - print props + print() + print("GetAll(fi.w1.wpa_supplicant1.Interface, %s):" % (path)) + print(props) props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface.WPS", dbus_interface=dbus.PROPERTIES_IFACE) - print - print "GetAll(fi.w1.wpa_supplicant1.Interface.WPS, %s):" % (path) - print props + print() + print("GetAll(fi.w1.wpa_supplicant1.Interface.WPS, %s):" % (path)) + print(props) res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'BSSs', dbus_interface=dbus.PROPERTIES_IFACE) @@ -40,9 +40,9 @@ def main(): bss_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0]) props = bss_obj.GetAll("fi.w1.wpa_supplicant1.BSS", dbus_interface=dbus.PROPERTIES_IFACE) - print - print "GetAll(fi.w1.wpa_supplicant1.BSS, %s):" % (res[0]) - print props + print() + print("GetAll(fi.w1.wpa_supplicant1.BSS, %s):" % (res[0])) + print(props) res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'Networks', dbus_interface=dbus.PROPERTIES_IFACE) @@ -50,9 +50,9 @@ def main(): net_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0]) props = net_obj.GetAll("fi.w1.wpa_supplicant1.Network", dbus_interface=dbus.PROPERTIES_IFACE) - print - print "GetAll(fi.w1.wpa_supplicant1.Network, %s):" % (res[0]) - print props + print() + print("GetAll(fi.w1.wpa_supplicant1.Network, %s):" % (res[0])) + print(props) if __name__ == "__main__": main() diff --git a/wpa_supplicant/examples/wpas-dbus-new-signals.py b/wpa_supplicant/examples/wpas-dbus-new-signals.py index d90ef1878..366a65546 100755 --- a/wpa_supplicant/examples/wpas-dbus-new-signals.py +++ b/wpa_supplicant/examples/wpas-dbus-new-signals.py @@ -32,17 +32,17 @@ def list_interfaces(wpas_obj): if_obj = bus.get_object(WPAS_DBUS_SERVICE, path) ifname = if_obj.Get(WPAS_DBUS_INTERFACES_INTERFACE, 'Ifname', dbus_interface=dbus.PROPERTIES_IFACE) - print ifname + print(ifname) def interfaceAdded(interface, properties): - print "InterfaceAdded(%s): Ifname=%s" % (interface, properties['Ifname']) + print("InterfaceAdded(%s): Ifname=%s" % (interface, properties['Ifname'])) def interfaceRemoved(interface): - print "InterfaceRemoved(%s)" % (interface) + print("InterfaceRemoved(%s)" % (interface)) def propertiesChanged(properties): for i in properties: - print "PropertiesChanged: %s=%s" % (i, properties[i]) + print("PropertiesChanged: %s=%s" % (i, properties[i])) def showBss(bss): net_obj = bus.get_object(WPAS_DBUS_SERVICE, bss) @@ -80,48 +80,48 @@ def showBss(bss): else: maxrate = 0 - print " %s :: ssid='%s' wpa=%s wpa2=%s signal=%d rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, signal, maxrate, freq) + print(" %s :: ssid='%s' wpa=%s wpa2=%s signal=%d rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, signal, maxrate, freq)) def scanDone(success): gobject.MainLoop().quit() - print "Scan done: success=%s" % success + print("Scan done: success=%s" % success) def scanDone2(success, path=None): - print "Scan done: success=%s [path=%s]" % (success, path) + print("Scan done: success=%s [path=%s]" % (success, path)) def bssAdded(bss, properties): - print "BSS added: %s" % (bss) + print("BSS added: %s" % (bss)) showBss(bss) def bssRemoved(bss): - print "BSS removed: %s" % (bss) + print("BSS removed: %s" % (bss)) def blobAdded(blob): - print "BlobAdded(%s)" % (blob) + print("BlobAdded(%s)" % (blob)) def blobRemoved(blob): - print "BlobRemoved(%s)" % (blob) + print("BlobRemoved(%s)" % (blob)) def networkAdded(network, properties): - print "NetworkAdded(%s)" % (network) + print("NetworkAdded(%s)" % (network)) def networkRemoved(network): - print "NetworkRemoved(%s)" % (network) + print("NetworkRemoved(%s)" % (network)) def networkSelected(network): - print "NetworkSelected(%s)" % (network) + print("NetworkSelected(%s)" % (network)) def propertiesChangedInterface(properties): for i in properties: - print "PropertiesChanged(interface): %s=%s" % (i, properties[i]) + print("PropertiesChanged(interface): %s=%s" % (i, properties[i])) def propertiesChangedBss(properties): for i in properties: - print "PropertiesChanged(BSS): %s=%s" % (i, properties[i]) + print("PropertiesChanged(BSS): %s=%s" % (i, properties[i])) def propertiesChangedNetwork(properties): for i in properties: - print "PropertiesChanged(Network): %s=%s" % (i, properties[i]) + print("PropertiesChanged(Network): %s=%s" % (i, properties[i])) def main(): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) diff --git a/wpa_supplicant/examples/wpas-dbus-new-wps.py b/wpa_supplicant/examples/wpas-dbus-new-wps.py index b8863858f..7d87b1efd 100755 --- a/wpa_supplicant/examples/wpas-dbus-new-wps.py +++ b/wpa_supplicant/examples/wpas-dbus-new-wps.py @@ -15,23 +15,23 @@ WPAS_DBUS_WPS_INTERFACE = "fi.w1.wpa_supplicant1.Interface.WPS" def propertiesChanged(properties): if properties.has_key("State"): - print "PropertiesChanged: State: %s" % (properties["State"]) + print("PropertiesChanged: State: %s" % (properties["State"])) def scanDone(success): - print "Scan done: success=%s" % success + print("Scan done: success=%s" % success) def bssAdded(bss, properties): - print "BSS added: %s" % (bss) + print("BSS added: %s" % (bss)) def bssRemoved(bss): - print "BSS removed: %s" % (bss) + print("BSS removed: %s" % (bss)) def wpsEvent(name, args): - print "WPS event: %s" % (name) - print args + print("WPS event: %s" % (name)) + print(args) def credentials(cred): - print "WPS credentials: %s" % (cred) + print("WPS credentials: %s" % (cred)) def main(): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -40,7 +40,7 @@ def main(): wpas_obj = bus.get_object(WPAS_DBUS_SERVICE, WPAS_DBUS_OPATH) if len(sys.argv) != 2: - print "Missing ifname argument" + print("Missing ifname argument") os._exit(1) wpas = dbus.Interface(wpas_obj, WPAS_DBUS_INTERFACE) diff --git a/wpa_supplicant/examples/wpas-dbus-new.py b/wpa_supplicant/examples/wpas-dbus-new.py index 885262c7f..6bf74ae44 100755 --- a/wpa_supplicant/examples/wpas-dbus-new.py +++ b/wpa_supplicant/examples/wpas-dbus-new.py @@ -31,11 +31,11 @@ def list_interfaces(wpas_obj): if_obj = bus.get_object(WPAS_DBUS_SERVICE, path) ifname = if_obj.Get(WPAS_DBUS_INTERFACES_INTERFACE, 'Ifname', dbus_interface=dbus.PROPERTIES_IFACE) - print ifname + print(ifname) def propertiesChanged(properties): if properties.has_key("State"): - print "PropertiesChanged: State: %s" % (properties["State"]) + print("PropertiesChanged: State: %s" % (properties["State"])) def showBss(bss): net_obj = bus.get_object(WPAS_DBUS_SERVICE, bss) @@ -73,25 +73,25 @@ def showBss(bss): else: maxrate = 0 - print " %s :: ssid='%s' wpa=%s wpa2=%s signal=%d rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, signal, maxrate, freq) + print(" %s :: ssid='%s' wpa=%s wpa2=%s signal=%d rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, signal, maxrate, freq)) def scanDone(success): - print "Scan done: success=%s" % success + print("Scan done: success=%s" % success) res = if_obj.Get(WPAS_DBUS_INTERFACES_INTERFACE, 'BSSs', dbus_interface=dbus.PROPERTIES_IFACE) - print "Scanned wireless networks:" + print("Scanned wireless networks:") for opath in res: - print opath + print(opath) showBss(opath) def bssAdded(bss, properties): - print "BSS added: %s" % (bss) + print("BSS added: %s" % (bss)) showBss(bss) def bssRemoved(bss): - print "BSS removed: %s" % (bss) + print("BSS removed: %s" % (bss)) def main(): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) diff --git a/wpa_supplicant/examples/wpas-test.py b/wpa_supplicant/examples/wpas-test.py index 31713ca62..bdd16a8a8 100755 --- a/wpa_supplicant/examples/wpas-test.py +++ b/wpa_supplicant/examples/wpas-test.py @@ -24,7 +24,7 @@ def byte_array_to_string(s): def main(): if len(sys.argv) != 2: - print "Usage: wpas-test.py " + print("Usage: wpas-test.py ") os._exit(1) ifname = sys.argv[1] @@ -53,7 +53,7 @@ def main(): time.sleep(5) res = iface.scanResults() - print "Scanned wireless networks:" + print("Scanned wireless networks:") for opath in res: net_obj = bus.get_object(WPAS_DBUS_SERVICE, opath) net = dbus.Interface(net_obj, WPAS_DBUS_BSSID_INTERFACE) @@ -80,7 +80,7 @@ def main(): noise = props["noise"] maxrate = props["maxrate"] / 1000000 - print " %s :: ssid='%s' wpa=%s wpa2=%s quality=%d%% rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, qual, maxrate, freq) + print(" %s :: ssid='%s' wpa=%s wpa2=%s quality=%d%% rate=%d freq=%d" % (bssid, ssid, wpa, wpa2, qual, maxrate, freq)) wpas.removeInterface(dbus.ObjectPath(path)) # Should fail here with unknown interface error diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py index 2e6869311..bb458fb37 100755 --- a/wpa_supplicant/examples/wps-nfc.py +++ b/wpa_supplicant/examples/wps-nfc.py @@ -30,7 +30,7 @@ summary_file = None success_file = None def summary(txt): - print txt + print(txt) if summary_file: with open(summary_file, 'a') as f: f.write(txt + "\n") @@ -47,11 +47,11 @@ def wpas_connect(): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] except OSError as error: - print "Could not find wpa_supplicant: ", error + print("Could not find wpa_supplicant: ", error) return None if len(ifaces) < 1: - print "No wpa_supplicant control interface found" + print("No wpa_supplicant control interface found") return None for ctrl in ifaces: @@ -163,22 +163,22 @@ class HandoverServer(nfc.handover.HandoverServer): self.ho_server_processing = True summary("HandoverServer - request received") try: - print "Parsed handover request: " + request.pretty() + print("Parsed handover request: " + request.pretty()) except Exception as e: - print e + print(e) sel = nfc.ndef.HandoverSelectMessage(version="1.2") for carrier in request.carriers: - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.wsc": summary("WPS carrier type match - add WPS carrier record") data = wpas_get_handover_sel(self.uuid) if data is None: summary("Could not get handover select carrier record from wpa_supplicant") continue - print "Handover select carrier record from wpa_supplicant:" - print data.encode("hex") + print("Handover select carrier record from wpa_supplicant:") + print(data.encode("hex")) self.sent_carrier = data if "OK" in wpas_report_handover(carrier.record, self.sent_carrier, "RESP"): success_report("Handover reported successfully (responder)") @@ -188,12 +188,12 @@ class HandoverServer(nfc.handover.HandoverServer): message = nfc.ndef.Message(data); sel.add_carrier(message[0], "active", message[1:]) - print "Handover select:" + print("Handover select:") try: - print sel.pretty() + print(sel.pretty()) except Exception as e: - print e - print str(sel).encode("hex") + print(e) + print(str(sel).encode("hex")) summary("Sending handover select") self.success = True @@ -207,19 +207,19 @@ def wps_handover_init(llc): if (data == None): summary("Could not get handover request carrier record from wpa_supplicant") return - print "Handover request carrier record from wpa_supplicant: " + data.encode("hex") + print("Handover request carrier record from wpa_supplicant: " + data.encode("hex")) message = nfc.ndef.HandoverRequestMessage(version="1.2") message.nonce = random.randint(0, 0xffff) datamsg = nfc.ndef.Message(data) message.add_carrier(datamsg[0], "active", datamsg[1:]) - print "Handover request:" + print("Handover request:") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e - print str(message).encode("hex") + print(e) + print(str(message).encode("hex")) client = nfc.handover.HandoverClient(llc) try: @@ -253,23 +253,23 @@ def wps_handover_init(llc): client.close() return - print "Received message" + print("Received message") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e - print str(message).encode("hex") + print(e) + print(str(message).encode("hex")) message = nfc.ndef.HandoverSelectMessage(message) summary("Handover select received") try: - print message.pretty() + print(message.pretty()) except Exception as e: - print e + print(e) for carrier in message.carriers: - print "Remote carrier type: " + carrier.type + print("Remote carrier type: " + carrier.type) if carrier.type == "application/vnd.wfa.wsc": - print "WPS carrier type match - send to wpa_supplicant" + print("WPS carrier type match - send to wpa_supplicant") if "OK" in wpas_report_handover(data, carrier.record, "INIT"): success_report("Handover reported successfully (initiator)") else: @@ -278,9 +278,9 @@ def wps_handover_init(llc): #wifi = nfc.ndef.WifiConfigRecord(carrier.record) #print wifi.pretty() - print "Remove peer" + print("Remove peer") client.close() - print "Done with handover" + print("Done with handover") global only_one if only_one: global continue_loop @@ -288,7 +288,7 @@ def wps_handover_init(llc): global no_wait if no_wait: - print "Trying to exit.." + print("Trying to exit..") global terminate_now terminate_now = True @@ -296,7 +296,7 @@ def wps_tag_read(tag, wait_remove=True): success = False if len(tag.ndef.message): for record in tag.ndef.message: - print "record type " + record.type + print("record type " + record.type) if record.type == "application/vnd.wfa.wsc": summary("WPS tag - send to wpa_supplicant") success = wpas_tag_read(tag.ndef.message) @@ -308,7 +308,7 @@ def wps_tag_read(tag, wait_remove=True): success_report("Tag read succeeded") if wait_remove: - print "Remove tag" + print("Remove tag") while tag.is_present: time.sleep(0.1) @@ -320,7 +320,7 @@ def rdwr_connected_write(tag): global write_data tag.ndef.message = str(write_data) success_report("Tag write succeeded") - print "Done - remove tag" + print("Done - remove tag") global only_one if only_one: global continue_loop @@ -330,41 +330,41 @@ def rdwr_connected_write(tag): time.sleep(0.1) def wps_write_config_tag(clf, id=None, wait_remove=True): - print "Write WPS config token" + print("Write WPS config token") global write_data, write_wait_remove write_wait_remove = wait_remove write_data = wpas_get_config_token(id) if write_data == None: - print "Could not get WPS config token from wpa_supplicant" + print("Could not get WPS config token from wpa_supplicant") sys.exit(1) return - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_write}) def wps_write_er_config_tag(clf, uuid, wait_remove=True): - print "Write WPS ER config token" + print("Write WPS ER config token") global write_data, write_wait_remove write_wait_remove = wait_remove write_data = wpas_get_er_config_token(uuid) if write_data == None: - print "Could not get WPS config token from wpa_supplicant" + print("Could not get WPS config token from wpa_supplicant") return - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_write}) def wps_write_password_tag(clf, wait_remove=True): - print "Write WPS password token" + print("Write WPS password token") global write_data, write_wait_remove write_wait_remove = wait_remove write_data = wpas_get_password_token() if write_data == None: - print "Could not get WPS password token from wpa_supplicant" + print("Could not get WPS password token from wpa_supplicant") return - print "Touch an NFC tag" + print("Touch an NFC tag") clf.connect(rdwr={'on-connect': rdwr_connected_write}) @@ -373,11 +373,11 @@ def rdwr_connected(tag): summary("Tag connected: " + str(tag)) if tag.ndef: - print "NDEF tag: " + tag.type + print("NDEF tag: " + tag.type) try: - print tag.ndef.message.pretty() + print(tag.ndef.message.pretty()) except Exception as e: - print e + print(e) success = wps_tag_read(tag, not only_one) if only_one and success: global continue_loop @@ -393,7 +393,7 @@ def llcp_worker(llc): global arg_uuid if arg_uuid is None: wps_handover_init(llc) - print "Exiting llcp_worker thread" + print("Exiting llcp_worker thread") return global srv @@ -405,19 +405,19 @@ def llcp_worker(llc): def llcp_startup(clf, llc): global arg_uuid if arg_uuid: - print "Start LLCP server" + print("Start LLCP server") global srv srv = HandoverServer(llc) if arg_uuid is "ap": - print "Trying to handle WPS handover" + print("Trying to handle WPS handover") srv.uuid = None else: - print "Trying to handle WPS handover with AP " + arg_uuid + print("Trying to handle WPS handover with AP " + arg_uuid) srv.uuid = arg_uuid return llc def llcp_connected(llc): - print "P2P LLCP connected" + print("P2P LLCP connected") global wait_connection wait_connection = False global arg_uuid @@ -426,7 +426,7 @@ def llcp_connected(llc): srv.start() else: threading.Thread(target=llcp_worker, args=(llc,)).start() - print "llcp_connected returning" + print("llcp_connected returning") return True @@ -482,7 +482,7 @@ def main(): try: if not clf.open("usb"): - print "Could not open connection with an NFC device" + print("Could not open connection with an NFC device") raise SystemExit if args.command == "write-config": @@ -499,7 +499,7 @@ def main(): global continue_loop while continue_loop: - print "Waiting for a tag or peer to be touched" + print("Waiting for a tag or peer to be touched") wait_connection = True try: if not clf.connect(rdwr={'on-connect': rdwr_connected}, @@ -508,7 +508,7 @@ def main(): terminate=terminate_loop): break except Exception as e: - print "clf.connect failed" + print("clf.connect failed") global srv if only_one and srv and srv.success: diff --git a/wpa_supplicant/utils/log2pcap.py b/wpa_supplicant/utils/log2pcap.py index 65e2fa109..141aecbe5 100755 --- a/wpa_supplicant/utils/log2pcap.py +++ b/wpa_supplicant/utils/log2pcap.py @@ -28,7 +28,7 @@ if __name__ == "__main__": input = sys.argv[1] pcap = sys.argv[2] except IndexError: - print "Usage: %s " % sys.argv[0] + print("Usage: %s " % sys.argv[0]) sys.exit(2) input_file = open(input, 'r') diff --git a/wpaspy/test.py b/wpaspy/test.py index cdfa71b00..5e18fb23f 100755 --- a/wpaspy/test.py +++ b/wpaspy/test.py @@ -21,18 +21,18 @@ def wpas_connect(host=None, port=9877): wpas = wpaspy.Ctrl(host, port) return wpas except: - print "Could not connect to host: ", host + print("Could not connect to host: ", host) return None if os.path.isdir(wpas_ctrl): try: ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] except OSError as error: - print "Could not find wpa_supplicant: ", error + print("Could not find wpa_supplicant: ", error) return None if len(ifaces) < 1: - print "No wpa_supplicant control interface found" + print("No wpa_supplicant control interface found") return None for ctrl in ifaces: @@ -45,21 +45,21 @@ def wpas_connect(host=None, port=9877): def main(host=None, port=9877): - print "Testing wpa_supplicant control interface connection" + print("Testing wpa_supplicant control interface connection") wpas = wpas_connect(host, port) if wpas is None: return - print "Connected to wpa_supplicant" - print wpas.request('PING') + print("Connected to wpa_supplicant") + print(wpas.request('PING')) mon = wpas_connect(host, port) if mon is None: - print "Could not open event monitor connection" + print("Could not open event monitor connection") return mon.attach() - print "Scan" - print wpas.request('SCAN') + print("Scan") + print(wpas.request('SCAN')) count = 0 while count < 10: @@ -67,10 +67,10 @@ def main(host=None, port=9877): time.sleep(1) while mon.pending(): ev = mon.recv() - print ev + print(ev) if 'CTRL-EVENT-SCAN-RESULTS' in ev: - print 'Scan completed' - print wpas.request('SCAN_RESULTS') + print('Scan completed') + print(wpas.request('SCAN_RESULTS')) count = 10 pass From patchwork Thu Jan 24 07:45:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W1X6q2Mr"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GfOP4i7C"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ4T25c2z9s9h for ; Thu, 24 Jan 2019 18:47:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ubhwweMmYlcFglKkrVkuhnImJGMty9mSCEDsiHhzhT8=; b=W1X6q2MraCon0hQOQGWnp0B2+3 EVZyaFVk0CicERECdNYw6u5pbKU5LeZYDXhofVYHF3ZOoDXyPZ+iUmhGrRhb1Jalv+BXcE7yBfjEC Zebbt2XVjDMOUgaRidJBC60XrBlHdYxLRsQPPPMFzyOSSO+aK5tgvdNk8/JyWD7ntZpKrgv1UYUlF DSaAytpI5G7Fo9JWe/MhHqaV4ms2Oc4whMEuJ8xJ5vgHJohXO3/jBhEHB57c+4ZU9JVGIoDfzYJvI omrJom38ZDfzpvPpRjkKNLmuR1ARVXpRorORXy+7I0M4Yc+FA5qwo7Ezaj0qlSZF4wxPxWyojQqM2 BMnqikhQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj8-0005tI-SJ; Thu, 24 Jan 2019 07:47:06 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZit-0005fQ-Jl for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:03 +0000 Received: by mail-pf1-x434.google.com with SMTP id g62so2569479pfd.12 for ; Wed, 23 Jan 2019 23:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ekXGhQbkfdudwrF+0rGD8lM7awBfl1dZhfGGk+tYkno=; b=GfOP4i7CvCaRVh6GmVjXDSghLJ5wRQTTLMUrKEnkFn2cAJ4xMH13PrWJVrxfLyqDIt CGqq6pdn0079jJUMOqfow2jxbW4A1rGo+wDpXndKOHkusQvrpZgaIo5lek+ZG0psIYbQ E6z+QSkMzsi/2B4soVEBFhbar7YqQEEf1//aaJRYGhMlMB2+al8sjhZ7H8N+xmuvSW8K oJf9UmjnlfDP8av0M56sjoSUAWI1b8yJoq34GDgOvjhIjDKPEkA1Wvoe693J2X1bhxRy 5HkG/izcYbmZITdIazjEWATiwZC6JfjBFZn5LdnXM9wL3oEadESmM8woH/pRDWc3Uttn Ndog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ekXGhQbkfdudwrF+0rGD8lM7awBfl1dZhfGGk+tYkno=; b=cve0NhrhCsy/cFDxKrMJc5HeKM45+Sh5rWC+BVlSg8TYV9KI9+wf0TStJsPq/U6jCu YBCSi5HB4Llb9/EWWQ0XQxxq63Bd3/7+EzpX6U8JR0lNdosv7y7xMv1318qaRGht1LW8 /il5YZPRtkBpKtoUSuVppi6yBnXQHiZb75GYig5l0Jh+zewntXuwNmOjw1KmhSBz/YoA rLXYia6BIZ+EsEqYj1AvxKLo5vtg+a8D0/vZPKItsOSwCo7EGdWbZ9aJzF62ltCQrHLt r4IA4oW4ab4phXQoIkm1VWrmN6yrXQSu939cNW/a3P9O/DUfpKydhCtUTPoM6itN03DQ ejWQ== X-Gm-Message-State: AJcUukca83FZyb75h4bhx3MgpuGt0af8n2B1FMfskmdgkE7uuuD+bT0x +CMYFApgy690n4fMfDuNvyQMnsDd X-Google-Smtp-Source: ALg8bN4mr7rzYv88LSZbVOtuTKR7sW3XqGA1nPCv9UeqNqL6m6+qD/we/pMshnTgKulLBpP/foKHLg== X-Received: by 2002:a63:a401:: with SMTP id c1mr5014373pgf.403.1548316009189; Wed, 23 Jan 2019 23:46:49 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:48 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 03/50] tests: Use python3 compatible dict operation Date: Thu, 24 Jan 2019 16:45:43 +0900 Message-Id: <20190124074630.4192-4-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234651_843538_E371B9A9 X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:434 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f dict -w -n Signed-off-by: Masashi Honma --- tests/hwsim/hostapd.py | 2 +- tests/hwsim/run-tests.py | 2 +- tests/hwsim/test_ap_ft.py | 44 ++++++++++++++++----------------- tests/hwsim/test_ap_hs20.py | 2 +- tests/hwsim/test_pmksa_cache.py | 4 +-- tests/hwsim/test_radius.py | 2 +- tests/hwsim/test_scan.py | 14 +++++------ tests/hwsim/wpasupplicant.py | 2 +- tests/remote/run-tests.py | 4 +-- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 773b0faa3..9deab15aa 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -413,7 +413,7 @@ def add_ap(apdev, params, wait_enabled=True, no_enable=False, timeout=30, for field in fields: if field in params: hapd.set(field, params[field]) - for f,v in params.items(): + for f,v in list(params.items()): if f in fields: continue if isinstance(v, list): diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index efcdc130a..7e5edc7ff 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -194,7 +194,7 @@ def main(): logger.debug("Import test cases from " + t) mod = __import__(m.group(1)) test_modules.append(mod.__name__.replace('test_', '', 1)) - for key,val in mod.__dict__.iteritems(): + for key,val in mod.__dict__.items(): if key.startswith("test_"): tests.append(val) test_names = list(set([t.__name__.replace('test_', '', 1) for t in tests])) diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 2de21d498..c1c46655e 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -924,7 +924,7 @@ def generic_ap_ft_eap(dev, apdev, vlan=False, cui=False, over_ds=False, params["ieee8021x"] = "1" if vlan: params["dynamic_vlan"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd = hostapd.add_ap(apdev[0], params) key_mgmt = hapd.get_config()['key_mgmt'] if key_mgmt.split(' ')[0] != "FT-EAP": @@ -934,7 +934,7 @@ def generic_ap_ft_eap(dev, apdev, vlan=False, cui=False, over_ds=False, params["ieee8021x"] = "1" if vlan: params["dynamic_vlan"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd, hapd1, ssid, passphrase, eap=True, @@ -1025,7 +1025,7 @@ def generic_ap_ft_eap_pull(dev, apdev, vlan=False): params["pmk_r1_push"] = "0" if vlan: params["dynamic_vlan"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd = hostapd.add_ap(apdev[0], params) key_mgmt = hapd.get_config()['key_mgmt'] if key_mgmt.split(' ')[0] != "FT-EAP": @@ -1036,7 +1036,7 @@ def generic_ap_ft_eap_pull(dev, apdev, vlan=False): params["pmk_r1_push"] = "0" if vlan: params["dynamic_vlan"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd, hapd1, ssid, passphrase, eap=True, @@ -1063,7 +1063,7 @@ def test_ap_ft_eap_pull_wildcard(dev, apdev): params["r1kh"] = "00:00:00:00:00:00 00:00:00:00:00:00 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff" params["ft_psk_generate_local"] = "1" params["eap_server"] = "0" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd = hostapd.add_ap(apdev[0], params) params = ft_params2(ssid=ssid, passphrase=passphrase, discovery=True) params['wpa_key_mgmt'] = "WPA-EAP FT-EAP" @@ -1073,7 +1073,7 @@ def test_ap_ft_eap_pull_wildcard(dev, apdev): params["r1kh"] = "00:00:00:00:00:00 00:00:00:00:00:00 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff" params["ft_psk_generate_local"] = "1" params["eap_server"] = "0" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd, hapd1, ssid, passphrase, eap=True) @@ -1172,13 +1172,13 @@ def test_ap_ft_mismatching_rrb_key_push_eap(dev, apdev): params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2_incorrect_rrb_key(ssid=ssid, passphrase=passphrase) params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -1194,13 +1194,13 @@ def test_ap_ft_mismatching_rrb_key_pull_eap(dev, apdev): params["pmk_r1_push"] = "0" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2_incorrect_rrb_key(ssid=ssid, passphrase=passphrase) params["pmk_r1_push"] = "0" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -1217,7 +1217,7 @@ def test_ap_ft_mismatching_r0kh_id_pull_eap(dev, apdev): params["nas_identifier"] = "nas0.w1.fi" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hostapd.add_ap(apdev[0], params) dev[0].connect(ssid, key_mgmt="FT-EAP", proto="WPA2", ieee80211w="1", eap="GPSK", identity="gpsk user", @@ -1228,7 +1228,7 @@ def test_ap_ft_mismatching_r0kh_id_pull_eap(dev, apdev): params["pmk_r1_push"] = "0" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hostapd.add_ap(apdev[1], params) dev[0].scan_for_bss(apdev[1]['bssid'], freq="2412") @@ -1244,13 +1244,13 @@ def test_ap_ft_mismatching_rrb_r0kh_push_eap(dev, apdev): params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2_r0kh_mismatch(ssid=ssid, passphrase=passphrase) params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -1266,13 +1266,13 @@ def test_ap_ft_mismatching_rrb_r0kh_pull_eap(dev, apdev): params["pmk_r1_push"] = "0" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params["pmk_r1_push"] = "0" params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -2269,7 +2269,7 @@ def test_ap_ft_internal_rrb_check(dev, apdev): params = ft_params1(ssid=ssid, passphrase=passphrase) params['wpa_key_mgmt'] = "FT-EAP" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd = hostapd.add_ap(apdev[0], params) key_mgmt = hapd.get_config()['key_mgmt'] if key_mgmt.split(' ')[0] != "FT-EAP": @@ -2586,7 +2586,7 @@ def test_ap_ft_eap_ap_config_change(dev, apdev): params["r0kh"] = "ff:ff:ff:ff:ff:ff * 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff" params["r1kh"] = "00:00:00:00:00:00 00:00:00:00:00:00 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff" params["eap_server"] = "0" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd = hostapd.add_ap(apdev[0], params) dev[0].connect(ssid, key_mgmt="FT-EAP WPA-EAP", proto="WPA2", @@ -2617,13 +2617,13 @@ def test_ap_ft_eap_sha384(dev, apdev): params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP-SHA384" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP-SHA384" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, eap=True, @@ -2639,13 +2639,13 @@ def test_ap_ft_eap_sha384_over_ds(dev, apdev): params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP-SHA384" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd0 = hostapd.add_ap(apdev[0], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params["ieee80211w"] = "2"; params['wpa_key_mgmt'] = "FT-EAP-SHA384" params["ieee8021x"] = "1" - params = dict(radius.items() + params.items()) + params = dict(list(radius.items()) + list(params.items())) hapd1 = hostapd.add_ap(apdev[1], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 97d9dd6d2..ef08f6533 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -6120,7 +6120,7 @@ def test_ap_hs20_terms_and_conditions_coa(dev, apdev): Vendor_Specific=vsa) reply = srv.SendPacket(req) logger.debug("RADIUS response from hostapd") - for i in reply.keys(): + for i in list(reply.keys()): logger.debug("%s: %s" % (i, reply[i])) if reply.code != pyrad.packet.CoAACK: raise Exception("CoA-Request failed") diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py index a1178264c..9353ae1dd 100644 --- a/tests/hwsim/test_pmksa_cache.py +++ b/tests/hwsim/test_pmksa_cache.py @@ -429,7 +429,7 @@ def generic_pmksa_cache_preauth(dev, apdev, extraparams, identity, databridge, try: params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") params['bridge'] = 'ap-br0' - for key, value in extraparams[0].iteritems(): + for key, value in extraparams[0].items(): params[key] = value hapd = hostapd.add_ap(apdev[0], params) @@ -445,7 +445,7 @@ def generic_pmksa_cache_preauth(dev, apdev, extraparams, identity, databridge, params['bridge'] = 'ap-br0' params['rsn_preauth'] = '1' params['rsn_preauth_interfaces'] = databridge - for key, value in extraparams[1].iteritems(): + for key, value in extraparams[1].items(): params[key] = value hostapd.add_ap(apdev[1], params) bssid1 = apdev[1]['bssid'] diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index 04d4e14e3..2f5bc95ed 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -362,7 +362,7 @@ def _test_radius_acct_ipaddr(dev, apdev): def send_and_check_reply(srv, req, code, error_cause=0): reply = srv.SendPacket(req) logger.debug("RADIUS response from hostapd") - for i in reply.keys(): + for i in list(reply.keys()): logger.debug("%s: %s" % (i, reply[i])) if reply.code != code: raise Exception("Unexpected response code") diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index fc5ebbe9a..adb36f980 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -1326,9 +1326,9 @@ def test_scan_ies(dev, apdev): if not bss or 'beacon_ie' not in bss: raise Exception("beacon_ie not present") ie = parse_ie(bss['ie']) - logger.info("ie: " + str(ie.keys())) + logger.info("ie: " + str(list(ie.keys()))) beacon_ie = parse_ie(bss['beacon_ie']) - logger.info("beacon_ie: " + str(ie.keys())) + logger.info("beacon_ie: " + str(list(ie.keys()))) if bss['ie'] == bss['beacon_ie']: raise Exception("Both ie and beacon_ie show same data") @@ -1684,7 +1684,7 @@ def test_scan_multi_bssid_check_ie(dev, apdev): raise Exception("beacon_ie not present in trans_bss") beacon_ie = parse_ie(trans_bss['beacon_ie']) - logger.info("trans_bss beacon_ie: " + str(beacon_ie.keys())) + logger.info("trans_bss beacon_ie: " + str(list(beacon_ie.keys()))) bssid = bssid[0:16] + '1' nontrans_bss1 = dev[0].get_bss(bssid) @@ -1695,12 +1695,12 @@ def test_scan_multi_bssid_check_ie(dev, apdev): raise Exception("beacon_ie not present in nontrans_bss1") nontx_beacon_ie = parse_ie(nontrans_bss1['beacon_ie']) - logger.info("nontrans_bss1 beacon_ie: " + str(nontx_beacon_ie.keys())) + logger.info("nontrans_bss1 beacon_ie: " + str(list(nontx_beacon_ie.keys()))) - if 71 in beacon_ie.keys(): - ie_list = beacon_ie.keys() + if 71 in list(beacon_ie.keys()): + ie_list = list(beacon_ie.keys()) ie_list.remove(71) - if ie_list != nontx_beacon_ie.keys(): + if ie_list != list(nontx_beacon_ie.keys()): raise Exception("check IE failed") def elem_fms1(): diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index a7d54b84e..fed9a5eff 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -958,7 +958,7 @@ class WpaSupplicant: "mean_data_rate": 1500, } cmd = "WMM_AC_ADDTS %s tsid=%d up=%d" % (direction, tsid, up) - for (key, value) in params.iteritems(): + for (key, value) in params.items(): cmd += " %s=%d" % (key, value) if extra: cmd += " " + extra diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index 3b8bd5867..284205018 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -161,7 +161,7 @@ def main(): if m: mod = __import__(m.group(1)) test_modules.append(mod.__name__.replace('test_', '', 1)) - for key,val in mod.__dict__.iteritems(): + for key,val in mod.__dict__.items(): if key.startswith("test_"): tests.append(val) test_names = list(set([t.__name__.replace('test_', '', 1) for t in tests])) @@ -173,7 +173,7 @@ def main(): if m: mod = __import__(m.group(1)) test_modules.append(mod.__name__.replace('test_', '', 1)) - for key,val in mod.__dict__.iteritems(): + for key,val in mod.__dict__.items(): if key.startswith("test_"): hwsim_tests.append(val) From patchwork Thu Jan 24 07:45:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T2PEnYgI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lLz4i/El"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ4m2L63z9s9h for ; Thu, 24 Jan 2019 18:47:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UYPEF0tCo0Z7Bz+8vr5Zdy0Ym5/gpuTDnWaGXXUaXKY=; b=T2PEnYgIFoRlqem41ROBmI7ZRF ztEAa7P+Je3vHuYzRSqwDr0yK0MkvvLpfOTK0hiCrXWY9Qr8jJSx3gUdJmhmwImX0pXps/YEejbNB 0tV/gIaUKiSCyzC6bO5MChe3NgyfP18uWTrQiRxl5Yw9j+L3kFvSIU0HsBx0jo2rB3pKKqyDYQlLF 4U942HJXRazg2bzxGcD5UTcY9ZO0ozzhHHitVb4vrUat2A3tU0uS+yjrUC7TgF+funbzdINZycT9r 3rbkPGtVz/wdVkF5bOk6oR2tLwFEiC22hBjekyI0poeI9YhlnzwkkxMMBPmC1KOzWbYNMfC0ihbuW ooRSoI1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjP-000671-1h; Thu, 24 Jan 2019 07:47:23 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZiu-0005go-7Q for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:04 +0000 Received: by mail-pl1-x62b.google.com with SMTP id a14so2493915plm.12 for ; Wed, 23 Jan 2019 23:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WJ/lPuB9Vzy+z1eN8TyyT+PcfUk3bsrrkGnmnTEwDxA=; b=lLz4i/EljMJuuaZ2agV0/NI/GTr2KHiVM17o2QxOIR+OW0DRml/tuKyGeBVxDX4z11 enyX3EaeYKXVnKp4erZh9QBmLplk9KvOLzS5JV34hgJKf0Ko/NXVpO5v1X2v0Z5Id1CG hBZs+BgHcq7kztQopyvd9bztFlC+NOC3/PFpx1ve/NPIkF65t9GkFVLpOQJIQKu3zz/v Q9dG5U81mVnzgBrC984S+6iIaL/a1YhVwnuMGyf4OCZ/y2Rvo8gHZIDRFA/hN8KGGJIG AUHd9jmaLug+1upiW4dk0k+arES3YzUymHzcVHgS8k/j3A1OA8FgUJ0Jc+XVAdDgeo+B MlfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WJ/lPuB9Vzy+z1eN8TyyT+PcfUk3bsrrkGnmnTEwDxA=; b=IqaU9jP/ptUaB2KNak6cHcc7VW22K88f9gW6MLSnjK4BkdnLv/5NZ19B/Rb2Sx5UlQ 4UzKdSkdKDvYSkEuRknEEzdW8lAyuHYkUPLX6iq1MliXgWb5+Wsv7HSRTRGVT1/DgK4j ukj54zP5yYVyf2aT+aW5M0+WJKLmhSd6W84PvU8yPuxQFeJIdRCEzltvDRXr0y6vX0Fc el+jjOnJNGRGNY1v07EqW1sgndlaX1pos/I+muSA9DGxvV2FDicZnpg5Mv9CIwHDGBvI IwEaNUuEcPZ25fbdNZL+B/xM+z/m1ZAsPUa70KfPAA36qWarjV26R6is7K/w7ncDTPSZ b4rA== X-Gm-Message-State: AJcUukfyStJph4li8iwJQkidaDKjdA9nDxIYHsaBi/r6Q8mCUMheChaB dGQiDuMQLFdajFz9mDUOcixIqroj X-Google-Smtp-Source: ALg8bN69DKnPJl2F9VV6qrxF1dQ0c/N7yye0k59CVdI+h6wLAygRxWQd4RSABYKev3a1Qzr7SCmDrQ== X-Received: by 2002:a17:902:1105:: with SMTP id d5mr5365858pla.47.1548316010994; Wed, 23 Jan 2019 23:46:50 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:50 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 04/50] tests: Use python3 compatible range operation Date: Thu, 24 Jan 2019 16:45:44 +0900 Message-Id: <20190124074630.4192-5-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234652_450140_72605B04 X-CRM114-Status: GOOD ( 11.01 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f xrange -w -n Signed-off-by: Masashi Honma --- tests/hwsim/hwsim_utils.py | 6 +++--- tests/hwsim/rfkill.py | 4 ++-- tests/hwsim/test_wmediumd.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py index 8ad08fcd5..cf49b13b1 100644 --- a/tests/hwsim/hwsim_utils.py +++ b/tests/hwsim/hwsim_utils.py @@ -83,7 +83,7 @@ def run_connectivity_test(dev1, dev2, tos, dev1group=False, dev2group=False, cmd = "DATA_TEST_TX ff:ff:ff:ff:ff:ff {} {}".format(addr1, tos) if send_len is not None: cmd += " len=" + str(send_len) - for i in xrange(broadcast_retry_c): + for i in range(broadcast_retry_c): try: if dev1group: dev1.group_request(cmd) @@ -135,7 +135,7 @@ def run_connectivity_test(dev1, dev2, tos, dev1group=False, dev2group=False, cmd = "DATA_TEST_TX ff:ff:ff:ff:ff:ff {} {}".format(addr2, tos) if send_len is not None: cmd += " len=" + str(send_len) - for i in xrange(broadcast_retry_c): + for i in range(broadcast_retry_c): try: if dev2group: dev2.group_request(cmd) @@ -221,7 +221,7 @@ def test_connectivity_p2p_sta(dev1, dev2, dscp=None, tos=None): def test_connectivity_sta(dev1, dev2, dscp=None, tos=None): test_connectivity(dev1, dev2, dscp, tos) -(PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL) = range(4) +(PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL) = list(range(4)) def set_powersave(dev, val): phy = dev.get_driver_status_field("phyname") diff --git a/tests/hwsim/rfkill.py b/tests/hwsim/rfkill.py index fa724ae50..a5e6f523a 100755 --- a/tests/hwsim/rfkill.py +++ b/tests/hwsim/rfkill.py @@ -21,12 +21,12 @@ import os TYPE_WWAN, TYPE_GPS, TYPE_FM, - TYPE_NFC) = range(9) + TYPE_NFC) = list(range(9)) (_OP_ADD, _OP_DEL, _OP_CHANGE, - _OP_CHANGE_ALL) = range(4) + _OP_CHANGE_ALL) = list(range(4)) _type_names = { TYPE_ALL: "all", diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index 26a7521e7..f17a02776 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -368,7 +368,7 @@ def test_wmediumd_path_rann(dev, apdev, params): raise Exception("No captured data found\n") lines = out.splitlines() prev = float(lines[len(lines) - 1]) - for i in reversed(range(1, len(lines) - 1)): + for i in reversed(list(range(1, len(lines) - 1))): now = float(lines[i]) if prev - now < 1.0 or 3.0 < prev - now: raise Exception("RANN interval " + str(prev - now) + From patchwork Thu Jan 24 07:45:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZHu2Sern"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GjjVokwE"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ5R37Jvz9s9h for ; Thu, 24 Jan 2019 18:48:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8yN9Ym88g8rlVc5/Q72Xf7x0a3kiuLxTE0v3eTsfqQU=; b=ZHu2SernfFvMQzJNUKUxkTvXlO XkppcA4kqv7ss6rLvM9/DvXsp0zQqw69zsZ5PsIsHQO3FWlNFRaJxKzanhdgWBS0XCNf9kwvhyhea RA82btoXw6whh0MJyYKsOsQu/bKxRmOjx1457E6YUu+8XKuqbJh/YRVfHZlA1B3nCzPeWPDNmQhmv FedeVFb9oS42kRBTx59L0wTuY6gwO5hwOf0PoMU/OGLbmNuNHiqExZTh3WWsdKqqe9jZD6QtSyE/M FvOHtaUknRTggCvE/lkdxq5p14A5OUeuExzoGaVa9ATBmniJZEtSvTEqvEbug6E1Y0sqnir9DNxFK ev4NMp5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZju-0006b6-No; Thu, 24 Jan 2019 07:47:54 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZiw-0005iC-0Y for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:12 +0000 Received: by mail-pl1-x631.google.com with SMTP id p8so2520907plo.2 for ; Wed, 23 Jan 2019 23:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X67ahYBnOx2eavkfhFZQHd07ApIEn5C0gD1koy6YbJI=; b=GjjVokwEQGKjjomUwJQLgbT5z6m0fgG2ClUlV89QyggSy1WHNgg2dcitY0mSce6VMv C5BTllorfNbwwOBZjN/hWfQpsPVXQvvjpp2Oq1/m8mVt3CDtIqFWWe9NWWWMDejYdPhk mMQ18E6vzcZX+y6eRIKHhn7eeTTOue2co2wRiWPHlGXsS3xcZx0OZodMtiwrg+o92l47 m8GOajA1Tr2aFxXCidPY7mzcfx6Cn6PbR9sAJ5nk8mw476s2AgiIjmT/qkLsALgdwYL4 OlFg53f9VWkC+KAB8bajcPOupgNZWlZYg1E9lnkUhXW7SPSzlSu8v+eoJwdAciern02O pWGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X67ahYBnOx2eavkfhFZQHd07ApIEn5C0gD1koy6YbJI=; b=g/6bBcYT20jRF3v0Bs7EZaGrtahgzJ6rHssgnM7516o8lM601drGzQCvdpqJrFqsom j2+nLX4uUOoKBgFH1Cky0AelYt8IJCGpMTib7MUiH7oYfC++FSI14hiMS/UaEUnD5iOV cuF17e8TQujwLxga9K30paL5ow5H9jkaES/LXbGWNhHpktIa/zM7zxaCvcvA9WBMNJY5 RtPGw1/O9QF16k8XnYkBj5DAq7158qlHRXU0eoT1rCWImRTTe6cqP+PgWT129BcCUT6Y +wuYzkWT4iLVWn5RkC9vz6Y26d7BKcyrhR5XgtV+5zvB0RSwLgRrFVZpyM76s3u/Pcnh zQ6Q== X-Gm-Message-State: AJcUukfqT+PB2Jk7Ju1xAbYb3XYI6DZocJD1ecyDVLelj/rLqLrMjzcR ln7goBbwlJ5T21k4wImQoDBvYYZM X-Google-Smtp-Source: ALg8bN7ghCjiOxxXv6zdnd3/UyPrNa8DjE0X+D59FuS/KH7LcV67TKavBpoOV2AKd/MmdvKJn3HbQQ== X-Received: by 2002:a17:902:5982:: with SMTP id p2mr5500885pli.39.1548316012725; Wed, 23 Jan 2019 23:46:52 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:52 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 05/50] tests: Use python3 compatible function attribute Date: Thu, 24 Jan 2019 16:45:45 +0900 Message-Id: <20190124074630.4192-6-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234654_225062_2367AC9B X-CRM114-Status: GOOD ( 11.37 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f funcattrs -w -n Signed-off-by: Masashi Honma --- tests/hwsim/run-tests.py | 4 ++-- tests/remote/hwsim_wrapper.py | 4 ++-- tests/remote/run-tests.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 7e5edc7ff..be0edcb7a 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -488,12 +488,12 @@ def main(): set_term_echo(sys.stdin.fileno(), True) sys.exit(1) try: - if t.func_code.co_argcount > 2: + if t.__code__.co_argcount > 2: params = {} params['logdir'] = args.logdir params['long'] = args.long t(dev, apdev, params) - elif t.func_code.co_argcount > 1: + elif t.__code__.co_argcount > 1: t(dev, apdev) else: t(dev) diff --git a/tests/remote/hwsim_wrapper.py b/tests/remote/hwsim_wrapper.py index d2598abb5..c1bbb27d7 100644 --- a/tests/remote/hwsim_wrapper.py +++ b/tests/remote/hwsim_wrapper.py @@ -68,9 +68,9 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test): apdev.append(dut_host.dev) # run hwsim test/currently only 2 params tests - if hwsim_test.func_code.co_argcount == 1: + if hwsim_test.__code__.co_argcount == 1: hwsim_test(dev) - elif hwsim_test.func_code.co_argcount == 2: + elif hwsim_test.__code__.co_argcount == 2: hwsim_test(dev, apdev) else: raise Exception("more than 2 arguments required") diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index 284205018..75497b4c9 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -200,7 +200,7 @@ def main(): t = None for tt in hwsim_tests: name = tt.__name__.replace('test_', '', 1) - if name == test and tt.func_code.co_argcount <= 2: + if name == test and tt.__code__.co_argcount <= 2: t = tt break if not t: From patchwork Thu Jan 24 07:45:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Kd3ONFHt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UUgVhnOG"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZBv1FD9z9s9h for ; Thu, 24 Jan 2019 18:52:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=i4ZDENER0hAgyP0Ysv/OUmj97ysrWMPLNDoP/X46KmA=; b=Kd3ONFHtmozU01/MH6hCzoky9r l8zqKxX+UgY1H97BX9oGdVEdR2npAXJo4WUahHTvo39z6zZCUncurfI0Xt5Ss1CtKkcb6gI5EOVti QSr/FlJQuBILT4+//3XovX3HSDlUBxqqAc5Nda97IFB5PadZXbM9shQRaERAr8E6DH5U0XV/IgCA4 utnF/k0FokO1D9TlORiYH0QtRH6F9vwdirrZf0Jn7NtsBCdiRHQyBJsuGzaQo8TpqO+Bj8YBCqyyx 2dkc6Ni7S5FDf+U+fpRbEwUk4s0ZDt5SNlf1RjF6DOp5JHn/UhSnP6kBsuEvtK7zHSMpO49nd6uvR Mrkb2FQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZob-0004HU-Ia; Thu, 24 Jan 2019 07:52:45 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZix-0005ja-N0 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:17 +0000 Received: by mail-pl1-x636.google.com with SMTP id w4so2525739plz.1 for ; Wed, 23 Jan 2019 23:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R22QndMJ0ZXtR1L3L40p6o/eul193E+z7SjfG4o84zg=; b=UUgVhnOGYKn7dqg7ljHMpDSYmBq5o2Wa+CVd9s4TCa0XWIQ0biRK8n9OkVBX3Wvc47 yUDk/wY7TC+BS/BpeIgG9K41Bwmzr109RmK51r6ib0ByBSI/y18GYTxTV3X6Os7lvc/T P62tcLzx//27a8WNale+rcbdYThGZS8/wO7fdSUF+ug38EcQlcmJqtAXL4EH+LK1lAAz JZcmeG2S1SQ6B9wGZ/viPdFssYTGWnCx01aJTGXoSby8Jfyp0mbyZnMyR0ai1aofP4Dg pj1wzS/yqfdvV/WQk15oVB9DoBPuuTWNd8dJHRfcK7i/uiNp058PykcXJ8CYafOEMVH/ YBVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R22QndMJ0ZXtR1L3L40p6o/eul193E+z7SjfG4o84zg=; b=TQ8B3sk9TuTL61SDSp2GRerl55HU7HN/PYvtIFT3VqNZUixGfK8Vdxjmi8KhTt26g2 Qdrv6j0iH/2Z/Jyd9vyBi0C6GG6qwx1L0KG0fHSMHZ/FpKIg8taj/rydtjOv/UZzoD9c iCvq2Bjc5+i6S6jYqFTQ9Rtcy4WJpQfAmx7u++/uMlsvmyOTW9Qr27VC3CiWEK2fcdMu 0BBosAxv+AsZANcfBHow4IKTyFoa0VLxmJEXO0Aj1ZC9LvPLr9zXJH/Exly7Tf5lgRw4 zo7wyquZtlY3wopNw3uVwPV4G5D88cicxem7jOouWpBBw5AF6OL3BgkiowQrbpGhokto TKYw== X-Gm-Message-State: AJcUukfJe6uOrITHtBXX5f8NN6j0hUNT8ru56NNgZuShbVRxp52ErNki ZlrM3tAFsIImrVLVrEuqlfyhSx2Z X-Google-Smtp-Source: ALg8bN6zydfTQXwWBPy4c/HbCgmQOaca4tjX1DhbxM70Fwtzw94N/deQm+MNF2ydkw4g37Pcc6Xg+g== X-Received: by 2002:a17:902:d70b:: with SMTP id w11mr5647285ply.294.1548316014412; Wed, 23 Jan 2019 23:46:54 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:53 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 06/50] tests: Use python3 compatible raise statement Date: Thu, 24 Jan 2019 16:45:46 +0900 Message-Id: <20190124074630.4192-7-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234656_152575_8F632E8B X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:636 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. find . -name *.py | xargs 2to3 -f raise -w -n Signed-off-by: Masashi Honma --- tests/hwsim/fst_module_aux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/fst_module_aux.py b/tests/hwsim/fst_module_aux.py index d929134e0..1468b8651 100644 --- a/tests/hwsim/fst_module_aux.py +++ b/tests/hwsim/fst_module_aux.py @@ -189,7 +189,7 @@ class FstDevice: def grequest(self, req): """Send request on the global control interface""" - raise Exception, "Virtual grequest() called!" + raise Exception("Virtual grequest() called!") def wait_gevent(self, events, timeout=None): """Wait for a list of events on the global interface""" From patchwork Thu Jan 24 07:45:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tRXuQEaM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iIlmZv/k"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZBz6bCgz9s9h for ; Thu, 24 Jan 2019 18:52:59 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FW6twRSyPq8Q2a3prc6BSB0tE71K0TRabkTl3I3kh4c=; b=tRXuQEaM7UDmH2fn5m4wmfMJBu t9MbJG/slKBS+aB4o21c63n3ZSQo0O9/4stUiVnrW/omk07trZMYuhkvYTI5Ov/fAxoFvmJjD/8Si jgZt+DJnvAnDZN61Q+Ml3xUcOt7ZdIw0a6bP5lzQopRjVa93Z20QzdFcdaDdhkkneLfhwDb9gstyY yGBH65JWqOXQ49H2FgL1f2PhNlGLB0Fvpd4bglZwHLT50NvIU+m0D/KAVpq57ReLvY5yWFHHySG3o PSs1nYfsq/5cJldW8mAkOixfgL7cnMexI7V5nyJyVz54PzYld25KCVj++Z9+3FR24HYsg2OvE9qZr EFmVg4qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZoj-0004OJ-Ti; Thu, 24 Jan 2019 07:52:53 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZiz-0005ki-Fa for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:19 +0000 Received: by mail-pg1-x529.google.com with SMTP id w6so2307520pgl.6 for ; Wed, 23 Jan 2019 23:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xH4F5cQGqr1DwptrYKa33S0PS9VKAmQ3Lx8/2TCmQ/4=; b=iIlmZv/kkCOKgN2s/Zc6U2vRQ5xIEyAXmylYeO74eX+uK1LT8/CzeWOO8IjgOGEy9l gDrl8mXT5eYPIX0Ebco8NfcfugO4ViW+J4FeXLorUkpL9aGt6Sdn3PprClhANheOneFn J2LSQrvsnVspMl1mj/5+tt5ZOB9p9k9K/F1wF4DZH83VfxP414mBfdVKffR/FOrJNLq3 VL6Gw99K9wDbrAAZkxgK2MKDdtBphVFcWuFMSmLuKiNoM5CFi9upKlLIhmXk+gl6ax5R sxRMDlhn+mPmp3cQHilDSRUkauAkCXjfj7V4pfIIf2pkPO5gfwjbu5DHh76SMBYcMLTQ 982Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xH4F5cQGqr1DwptrYKa33S0PS9VKAmQ3Lx8/2TCmQ/4=; b=gqC6IW05c4GJiJlBzloORa/na52nmHjgRf3x+0zKATj7o2g9+H46jrRHq+VGVCjZye AjkjNziLkv3NJUk6yHzHX/LsaWl4zeF+TZC8NLG5cRthvLPx3ig834qrPZgfn84jYxN0 WMKADpySEjqAIkyuyaCiMha6G8xXvdt/cLCoirpUVgXnzHAm0GgLuydzOPC0RJSu2Zg8 3ga89sysEx1VQHD4W39O1WoxayTt8hO9PGWHSsltuCPrdnNSUXcpXi88hJ+wuLjXyN6i wCZZbYXXs9ir+ff5G2zhZrkyKcnMU6sL+yFBLy2DMGqcDBjqgTz+IjM/fKrnraJ/Zdzg 9erQ== X-Gm-Message-State: AJcUukfwxImJTkPrgZx4voNGZkB9WHxW4sHtOCcykfo5T4ECRX8q9czj E21ElJ8DGGoz3h/jwnIalLdmpXzQ X-Google-Smtp-Source: ALg8bN4GZ042+WrxxcLHe2lWA5E1npYzhNuR6+W/QobwcUWQ8uhZ9juqYjSydZyfX1854u4e3u3UTg== X-Received: by 2002:a63:fc05:: with SMTP id j5mr5096349pgi.434.1548316016097; Wed, 23 Jan 2019 23:46:56 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:55 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 07/50] tests: Use int instead of long for python3 compatibility Date: Thu, 24 Jan 2019 16:45:47 +0900 Message-Id: <20190124074630.4192-8-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234657_859046_29E48262 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:529 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f long -w -n Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_wps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 101690a1c..fe069d396 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -6347,7 +6347,7 @@ def wsc_dh_init(): return own_private, pk def wsc_dh_kdf(peer_pk, own_private, mac_addr, e_nonce, r_nonce): - peer_public = long(binascii.hexlify(peer_pk), 16) + peer_public = int(binascii.hexlify(peer_pk), 16) if peer_public < 2 or peer_public >= group_5_prime: raise Exception("Invalid peer public key") if pow(peer_public, (group_5_prime - 1) / 2, group_5_prime) != 1: From patchwork Thu Jan 24 07:45:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bHW2Y/GZ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E3tU9naH"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ663BMJz9s9h for ; Thu, 24 Jan 2019 18:48:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kDL9e3z34Pw3yRhDXc0BARgxQODuSnLs5U9hIExahHk=; b=bHW2Y/GZBZWQHG+OOPqAU44xa3 6vBR8GMXVgkAMn5o9Tprhj8T490oING99iEH27K8jZsCr3KQe5g7wE7zqGmyPtAbES7bdE913vJZ5 umhL1BjPTge9ABuUyzpu32KgW98WNmfHTuBZEUN6l9f7nRaXWaM9OWcIa88pc4xet/LXI6p5ioWMY bcie90fI/x+a/SVIxMKV12IjOM9sVX2nsne7ssNwL2KkKLWE6h2DTHtEvd9BDDun4UYWwbSIrFp7K NTmvSRJ2k3PK5wOZBo6IhapCEz1tU3uLMmxEQWHuc3yxsptz4hmcF+kraSmtWDr0t08ZRzik5opn/ I01opd5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkV-0007BF-S0; Thu, 24 Jan 2019 07:48:31 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj0-0005mU-SN for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:22 +0000 Received: by mail-pf1-x443.google.com with SMTP id z9so2597256pfi.2 for ; Wed, 23 Jan 2019 23:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iMPa0jElXjMYZEzPtw6sgKyHKSa2YtSLc4cBiJfB9bc=; b=E3tU9naHtdRdPwMy++g+hvS2vnw9+/1aCSRvMNiMXIkeOSykXc1bCx8SniemQm+eoe QQqG0EZFZd3dBMs4GEcmOHdYAiOdTgfqGhh2YT2SXnCHpmD1vrLJJQG/F8V0iHrzWqg6 1hljMZOxFUznkG+ytJYy9LJ9fTXsd6opgb1rsMxOIchLfATSZgoi3D+XewqqmbMtO34F Oq7bO3lJAjH8Vuwkc/zFkc9XVnri7HU1n7OosLRRcOGRFMPDWb07Lb9KtrIqsbCoJi0U sqjujWqrptSZ63PKzzYd7W929/oArprt7Qe+KyYar003PHgq0Xi0WhPgqesNvJQTQ7Ah pvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iMPa0jElXjMYZEzPtw6sgKyHKSa2YtSLc4cBiJfB9bc=; b=dYJJBMOpSxzc+52oDTIwkFiherrynFUmmWhFeyxt7ctcdbjYf9oodUdPEQDHnPLvSR yDpLZfaOjOFeji9Rv6lpnYE+PIb8dO7EzGgvGMgd8xmcQimApoiaMePy4qOgOf3VQXzG o4+wPpdTZT7x6iOzX3o3Bm/zFis1WK6I+W3oj73qAhQmpHZcR3YL6FudZrJyekaxe02Q SX6QwWbZJ6aaBnqZL4V+ICzg3URSfGAPhxivafpEDZQO/VQ0Ow6n2i0fib4Z5+BFnu5T DWjNoGZbqb50mUFAHDkE3CtNVk3RcVGC49z6+LDvSE7Nsgw7O0qFYgFQRVxzMbjbHGLr knlQ== X-Gm-Message-State: AJcUukd1H17TD8k/Ca5qKwRaIyDEDq8LF2WkdkBEVABMKLF/u8UqFUpk a5A1MrCaXlhxLC/FP/HsBqR31P7x X-Google-Smtp-Source: ALg8bN4qI6SE+VRfaUKpDm7kvJ3QlMYGTETkWKA1IcfY7GTorxSBk2/+As3yXWVsh6VPQ96DZUX0GA== X-Received: by 2002:a62:31c1:: with SMTP id x184mr5600597pfx.204.1548316017769; Wed, 23 Jan 2019 23:46:57 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:57 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 08/50] tests: Remove deprecated statement for python3 compatibility Date: Thu, 24 Jan 2019 16:45:48 +0900 Message-Id: <20190124074630.4192-9-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234659_320604_DE38F661 X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command. find . -name *.py | xargs 2to3 -f future -w -n Signed-off-by: Masashi Honma --- wpaspy/wpaspy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py index 5f614c707..50ecf2374 100644 --- a/wpaspy/wpaspy.py +++ b/wpaspy/wpaspy.py @@ -6,7 +6,7 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. -from __future__ import print_function + import os import stat From patchwork Thu Jan 24 07:45:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vy8FcGqZ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ifM4SjEr"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ6b1YBPz9s9h for ; Thu, 24 Jan 2019 18:49:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8BSqokK6zBJnDO4j4Wm5t2qgJI7DYwKRMgYBsVaSmf0=; b=Vy8FcGqZPR3hyfY16v5J4bN0Vd TI554+a0vomRuuAXl6NKx7W82ZWxdYcJPqYiF8pTGSCZgiVcNL0wePgARH15rADj77V/q4BkEj74z bxoHUUjATdpqOjh7GhLZ6syUR7ZJW+a0cYf2yDap4scXP204xeHAtyfBtyCzWmGbeVvH8hta7LDVE 1hN9bftULn1BqRZRfHtpyhk9x4MaRhIi9oM55A5kNl0u/NKSEiTv5CPYfyTkuCw49GT/PlRNu8zwt E7im4bFYfnco4XAX3jmjIM5X76pHgCYhjN2j907m7ukg10ur0/tNXQ9RYdtewu7JwUhzWxWxR8vjX PaVem7cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZku-0007Wd-Lm; Thu, 24 Jan 2019 07:48:56 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj2-0005oG-Tl for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:27 +0000 Received: by mail-pl1-x629.google.com with SMTP id 101so2509410pld.6 for ; Wed, 23 Jan 2019 23:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gGxAeJeLrCAzD5mfa/FHbiunStLqF+yIasQSzzyn+08=; b=ifM4SjErF7EZ6h5ayIXFcqjZnRrXartPQZQvHKqDszcrvzYMsDoMUWdrHDrez23o6/ NNUkkKXzgLxhL65zRtIJJ5ni+EmkRb3eWqO4/lCUa+HIziMEu2Nn0H4viDxAy5fLJ/Z9 mW9Rh6wTyg78NO/H0wfbwfGXkVa2I5WOPlZLPJmFc6KE6N2E6IxBlTUpzKdzsVFyAqH/ ttn1S10XS4ljEkJYCxjNXl0VWtsNg2jbOTgdU1e+9zoUfCOsm+CD1vZpxxVdnoh3HoF1 HoOgI4a9lYb/+XuwnYCAynM2XYNGQ4jN6Oq4F2f90smwyYsGm/B3Yyu2o+mzjpeOSlTM 9e+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gGxAeJeLrCAzD5mfa/FHbiunStLqF+yIasQSzzyn+08=; b=KijNBmNoEppiLEu80qFu9shZg7KRgj9JTgXR0A2SndWtDTPyThCG9wb8Mjilp8qRFj 3dN4k/Bw4ev4zDNhwFu5FNiFOmZzXNBzVzFkWitBqWkmM3pY4bGT5hw6YUhDgqam3U17 +T6vQXGPA0qoVW0UBCAw2n432PQyGKDCXT+0aEGBktdeahq4v36YgfRw3ixELCCWdnYC 9XViZpvRv+/szWt6BEP55q03ilPMVSH2GVG7iq2ECWdsTNs8FqnrJUD2TQV0rBBNPVhH mPniHDB6xDoBFeLHl5p3S2oi3c30Jvf+4ZeRCLlZOrsJkZ7Enri5PY3JxNGyJFwlYHi6 c8YQ== X-Gm-Message-State: AJcUukdVmn2uwL73t4TbjsLUQuFKyWZWmvbFi1L5COl9l+0kiqsKaLNA O23pC7iGH8twrOdX4CwLCgjNQO2R X-Google-Smtp-Source: ALg8bN4UHiyPqv1zEvfFo293iMJx5vmZqXPbMapEZL3PPfULKDxcVf1BAQRqM0ry/LsjTltKSNaQWA== X-Received: by 2002:a17:902:6e0f:: with SMTP id u15mr5486618plk.175.1548316019528; Wed, 23 Jan 2019 23:46:59 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:46:58 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 09/50] tests: Python3 does not allow mixed indentation Date: Thu, 24 Jan 2019 16:45:49 +0900 Message-Id: <20190124074630.4192-10-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234701_675273_4DA28E3C X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:629 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_macsec.py | 10 +++++----- tests/hwsim/test_rrm.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_macsec.py b/tests/hwsim/test_macsec.py index 8de4bf051..871e465ac 100644 --- a/tests/hwsim/test_macsec.py +++ b/tests/hwsim/test_macsec.py @@ -509,13 +509,13 @@ def write_conf(conffile, mka_priority=None): f.write("ap_scan=0\n") f.write("fast_reauth=1\n") f.write("network={\n") - f.write(" key_mgmt=NONE\n") - f.write(" mka_cak=000102030405060708090a0b0c0d0e0f\n") - f.write(" mka_ckn=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\n") + f.write(" key_mgmt=NONE\n") + f.write(" mka_cak=000102030405060708090a0b0c0d0e0f\n") + f.write(" mka_ckn=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\n") if mka_priority is not None: f.write(" mka_priority=%d\n" % mka_priority) - f.write(" eapol_flags=0\n") - f.write(" macsec_policy=1\n") + f.write(" eapol_flags=0\n") + f.write(" macsec_policy=1\n") f.write("}\n") def run_macsec_psk_ns(dev, apdev, params): diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py index e498672c3..35de1850c 100644 --- a/tests/hwsim/test_rrm.py +++ b/tests/hwsim/test_rrm.py @@ -721,8 +721,8 @@ class BeaconReport: # 2 = all fixed fields and all elements # Fixed fields: Timestamp[8] BeaconInt[2] CapabInfo[2] self.frame_body = report[0:elen] - if eid == 2: - self.frame_body_fragment_id = report[0:elen] + if eid == 2: + self.frame_body_fragment_id = report[0:elen] if eid == 164: self.last_indication = report[0:elen] report = report[elen:] From patchwork Thu Jan 24 07:45:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lkjynxAE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="n3+iMWYX"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ6L3Q3Sz9s9h for ; Thu, 24 Jan 2019 18:48:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rfhCWl2M4Utb+DffKsiIU9k4OpGnFs3Lp8M4oOXDqGA=; b=lkjynxAEm1GoylzISNctHUmCyY mtI3Rkgt0G0BByG6UMmbA3qGO7t/QPoqhPj3R5gqyxt85Sgiv53cT1SNVNGgdnupE5C1oFwweYk0a /SXygnCEYO8o+OkCnMaPo5YOhrHM1rTU24pOKpapoMUPdIrim6sBYNqeGRptUEKsi0YhHppXR/YUf Ufm9RL3XaxQpe80ahXaRr/EJDpnZBJHVTXPgPuEjPu/3bBu2/kLntNljI5x27Yi6n/zGubg48MSpj dhfW6LKVxEn4dK4KRkVMyraIbhcd6SOM48t1KGBqe3OlBSwfHGzrkf3+4wt8f7QkjI+DnCbzDVoRL 4mrTN4rg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkh-0007LM-F0; Thu, 24 Jan 2019 07:48:43 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj4-0005qE-Ab for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:28 +0000 Received: by mail-pl1-x644.google.com with SMTP id y1so2502338plp.9 for ; Wed, 23 Jan 2019 23:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+GRcuR6Vy7wvXJhHqNUrVv8fjtKmHBlkTG+nS9abt2k=; b=n3+iMWYXb7G9tM7+2JZQ5CwbM1j0wq1rvDy0NI/3t22/zC+diLKhO+XQ6IDLmAgIP3 WXkBEQWdBb/BNHE08qbJg7Bv8O3jdB+gTmQnqJr5IWR/qCPtO4e/lAFJAyPyaV81zd9z JH2/pB0ojfYpmVTxGTDIyW6vH4Vbn839wA0liC5ihrvKDFwmmFW6vkbCnTSyZhSYFO+E kXHaIiDyJDOXe6RwAFd2GNLQO6as/FdwdZgGznEfv9qzWc2cxEfAvzEZb3VPAK0VtR/n XqCPIsRaE+dUg2hY/3nNGin3kXOKtrUoA001Bp4QYMz3i3qTrzU1aOla0GcLOvYpNAQu Ulww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+GRcuR6Vy7wvXJhHqNUrVv8fjtKmHBlkTG+nS9abt2k=; b=g5BA/4Iwe7JL2rxc4t3yJh9SmF14RhKHSQMxiODhjAOYJAE0tDsvFPM40ihKyeqq+O vQ+MYx4cuMbs4tubYgW/WnskdiordmlV90U+kapVh38JlCPsOa5TFysRhMyuFFgkqFI3 frgnZmZ4jDDYRbL0/rR5vmsb8TX/FI5+vNfZ4EQUFhsky0adG5llFE4+Uzn0U/dxBkPy x36KOUc4oCQI8AFf8y1j4AD4/Ovg8gX584cJ/Z8KL35agpbb0GO4H3AsM2zKUKO4pBh6 n423ZfSMSnNwd3GALRTkbKatahvuzsFMHVOQ9kbFdrEGJ/J1BuaVbKy3FMikaQZN29S8 GU5w== X-Gm-Message-State: AJcUukdlyXqdDXNlKMjacPSmkyXd7T86fVnZ4/VEakDnJN/1kdnPtsvu ueHL00ews9l18Ia4glajz84OGAKl X-Google-Smtp-Source: ALg8bN7q/IuwwATcIqW1nmUL//uOPdAbc/MlxHct4vYdgk6po9LAtSL0vlFZU0qg6n39rL2tWPQ3Yw== X-Received: by 2002:a17:902:b282:: with SMTP id u2mr5636796plr.89.1548316021196; Wed, 23 Jan 2019 23:47:01 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:00 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 10/50] tests: python3 require escaping Date: Thu, 24 Jan 2019 16:45:50 +0900 Message-Id: <20190124074630.4192-11-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234702_764435_187A2924 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_eap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 4d7fcb9b5..c190cf484 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -1875,7 +1875,7 @@ def test_ap_wpa2_eap_peap_eap_mschapv2_domain(dev, apdev): check_eap_capa(dev[0], "MSCHAPV2") params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hapd = hostapd.add_ap(apdev[0], params) - eap_connect(dev[0], hapd, "PEAP", "DOMAIN\user3", + eap_connect(dev[0], hapd, "PEAP", "DOMAIN\\user3", anonymous_identity="peap", password="password", ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2") hwsim_utils.test_connectivity(dev[0], hapd) From patchwork Thu Jan 24 07:45:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030307 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BYnIaNKN"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W8BNdopt"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ744RmRz9s9h for ; Thu, 24 Jan 2019 18:49:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AGJ0iY6KzX4VDOkwh3lAgE+R7q7lWPW6t2dYlNpr6bA=; b=BYnIaNKNGyCAbURiwcTHZYnsVP Qa/Pkv9qEvwn8OuOtNHyxYu1N5ZtzcYtqUyF8u1ikRAEoyZiyt/NeKhB0eJjuHBTGfVrrci959j3V CiicTJkJ5HQSTHQgiUaDadYE/hty4Df221wWJaSiWnPIXQ5rZdQcV6XzlHdqhKnZO4eSkH9h1/02C HL89bdXm0tG/GXYbhQo2qRchZeWE/nCacc/ZhTY1BQnf4rSk03/YQng2s5hwNnudNaFat0m095IbV OhdrlU7MPcWa2amLmL+U9bIstrvawFmCYSs1xcz92GwatfD7v9qi3OkR802WPaC1HqXz0s14aQVEj huM2HwnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZlK-0007y2-Co; Thu, 24 Jan 2019 07:49:22 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj6-0005rd-SL for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:43 +0000 Received: by mail-pl1-x632.google.com with SMTP id w4so2525911plz.1 for ; Wed, 23 Jan 2019 23:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b2ENV03x8un6IX+dTUgW8gWVLR4It3er03Gc48N2eiE=; b=W8BNdoptihfA02qbIL359HIcq+FWzCeNFZ4iQvK4qeoiOj0OoHq72kjG2boRqH63ZY X6wIU6nhqQ5TMYwyGMVnzHW+BITUblTsyk9syuJHmjuuxZTfsYeg8SfeW5mOUZ9tt8nz O/ssS+kewAnxzjgzf084zQbhWLrAvK9xyedr7WCGgXpITPrsxuXWrQH7eqbmquJ3DILN HQSv1RqONKiz6ly+47CTcOC8uQwWk3t6Q6q6IZh3K0CEpNbiB5Dfw8qTdFZjmK17I0Ke SO/464Oc/b0oCMs1fs/f4BatIT7RMz9EAdNNV53Eqs4gpTYCA1QJiXJLCdbpb70gzjpa nBgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b2ENV03x8un6IX+dTUgW8gWVLR4It3er03Gc48N2eiE=; b=QZzzGxrS/VpdqhrLZo5Y9xeRpTtQedj5SFoJz7L9oiaVjFs0uJ6waJw9MLOXzvPVnV aAowSJwU0D2qB3ri7Z5ncVjZS9VTc/O9a3QLQfryhhaS19iORBne3GKO/1c+U02CDucl xyDv+PLu/B6WmpJBw+lWlMYA1sAiOka8N60hsyRc7/vmkLxclkSx62hJxu1EwsVPGTNq Te1gCi87ST16LIDgG1FTvBF+9KDMTYOkcwgk14P27+BPHQhyH4T5HETD7oGQ8P9IGwFK T76xArCUyCd0G0W/YSZlBmMxEae9osMKOz1n15YjBhliyCeR30iffzUyErt1rf+ZlR9L Fqbw== X-Gm-Message-State: AJcUukcOEqn32QDEToLnrCiNUh/Pq3f+EjepTn4eM5zfHGN2lpy4DpQN 0ovYhow1AhF3KxFHw6ei3MSfQdGX X-Google-Smtp-Source: ALg8bN4qMVYQAAOJWwoMT5fnQQYOqQWAjkRvG/q4+seskgOTsGgkge92yZqx5yZKvXxDcX/x4VdrBg== X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr5524682plb.185.1548316022933; Wed, 23 Jan 2019 23:47:02 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:02 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 11/50] tests: Use python3 compatible liblaries Date: Thu, 24 Jan 2019 16:45:51 +0900 Message-Id: <20190124074630.4192-12-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234705_119505_A3584729 X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch is made by using 2to3 command with some modifications. $ find . -name *.py | xargs 2to3 -f imports -w -n Signed-off-by: Masashi Honma --- tests/hwsim/p2p_utils.py | 9 +- tests/hwsim/test_ap_eap.py | 5 +- tests/hwsim/test_ap_wps.py | 148 ++++++++++++++------------- tests/hwsim/test_p2p_wifi_display.py | 5 +- 4 files changed, 92 insertions(+), 75 deletions(-) diff --git a/tests/hwsim/p2p_utils.py b/tests/hwsim/p2p_utils.py index 1a4646dc7..6c8a3cc4b 100644 --- a/tests/hwsim/p2p_utils.py +++ b/tests/hwsim/p2p_utils.py @@ -8,7 +8,10 @@ import logging logger = logging.getLogger() import threading import time -import Queue +try: + from Queue import Queue +except ImportError: + from queue import Queue import hwsim_utils @@ -238,7 +241,7 @@ def go_neg_pin(i_dev, r_dev, i_intent=None, r_intent=None, i_method='enter', r_m pin = r_dev.wps_read_pin() logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname) r_dev.dump_monitor() - res = Queue.Queue() + res = queue.Queue() t = threading.Thread(target=go_neg_init, args=(i_dev, r_dev, pin, i_method, i_intent, res)) t.start() logger.debug("Wait for GO Negotiation Request on r_dev") @@ -318,7 +321,7 @@ def go_neg_pbc(i_dev, r_dev, i_intent=None, r_intent=None, i_freq=None, r_freq=N i_dev.p2p_find(social=True) logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname) r_dev.dump_monitor() - res = Queue.Queue() + res = queue.Queue() t = threading.Thread(target=go_neg_init_pbc, args=(i_dev, r_dev, i_intent, res, i_freq, provdisc)) t.start() logger.debug("Wait for GO Negotiation Request on r_dev") diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index c190cf484..f40be0c55 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -14,7 +14,10 @@ logger = logging.getLogger() import os import signal import socket -import SocketServer +try: + import SocketServer +except ImportError: + import socketserver as SocketServer import struct import tempfile diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index fe069d396..b41a53be9 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -19,12 +19,20 @@ logger = logging.getLogger() import re import socket import struct -import httplib -import urlparse +try: + from http.client import HTTPConnection + from urllib.parse import urlparse, urljoin + from urllib.error import HTTPError + from io import StringIO + from socketserver import StreamRequestHandler, TCPServer +except ImportError: + from httplib import HTTPConnection + from urlparse import urlparse, urljoin + from urllib2 import build_opener, ProxyHandler, HTTPError + from StringIO import StringIO + from SocketServer import StreamRequestHandler, TCPServer import urllib import xml.etree.ElementTree as ET -import StringIO -import SocketServer import hwsim_utils import hostapd @@ -2351,13 +2359,13 @@ def test_ap_wps_pbc_timeout(dev, apdev, params): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urlparse.urlparse(urls['event_sub_url']) - ctrlurl = urlparse.urlparse(urls['control_url']) + eventurl = urllib.parse.urlparse(urls['event_sub_url']) + ctrlurl = urllib.parse.urlparse(urls['control_url']) - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc) - class WPSERHTTPServer(SocketServer.StreamRequestHandler): + class WPSERHTTPServer(socketserver.StreamRequestHandler): def handle(self): data = self.rfile.readline().strip() logger.debug(data) @@ -2764,9 +2772,9 @@ def upnp_get_urls(location): urn = '{urn:schemas-upnp-org:device-1-0}' service = root.find("./" + urn + "device/" + urn + "serviceList/" + urn + "service") res = {} - res['scpd_url'] = urlparse.urljoin(location, service.find(urn + 'SCPDURL').text) - res['control_url'] = urlparse.urljoin(location, service.find(urn + 'controlURL').text) - res['event_sub_url'] = urlparse.urljoin(location, service.find(urn + 'eventSubURL').text) + res['scpd_url'] = urllib.parse.urljoin(location, service.find(urn + 'SCPDURL').text) + res['control_url'] = urllib.parse.urljoin(location, service.find(urn + 'controlURL').text) + res['event_sub_url'] = urllib.parse.urljoin(location, service.find(urn + 'eventSubURL').text) return res def upnp_soap_action(conn, path, action, include_soap_action=True, @@ -2791,7 +2799,7 @@ def upnp_soap_action(conn, path, action, include_soap_action=True, msg = ET.SubElement(act, "NewWLANEventMAC") msg.text = neweventmac tree = ET.ElementTree(root) - soap = StringIO.StringIO() + soap = io.StringIO() tree.write(soap, xml_declaration=True, encoding='utf-8') headers = { "Content-type": 'text/xml; charset="utf-8"' } @@ -2813,13 +2821,13 @@ def test_ap_wps_upnp(dev, apdev): conn = urllib.urlopen(urls['scpd_url'], proxies={}) scpd = conn.read() - conn = urllib.urlopen(urlparse.urljoin(location, "unknown.html"), + conn = urllib.urlopen(urllib.parse.urljoin(location, "unknown.html"), proxies={}) if conn.getcode() != 404: raise Exception("Unexpected HTTP response to GET unknown URL") - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "Content-type": 'text/xml; charset="utf-8"', "SOAPAction": '"urn:schemas-wifialliance-org:service:WFAWLANConfig:1#GetDeviceInfo"' } @@ -2835,7 +2843,7 @@ def test_ap_wps_upnp(dev, apdev): headers = { "Content-type": 'text/xml; charset="utf-8"', "SOAPAction": '"urn:some-unknown-action#GetDeviceInfo"' } - ctrlurl = urlparse.urlparse(urls['control_url']) + ctrlurl = urllib.parse.urlparse(urls['control_url']) conn.request("POST", ctrlurl.path, "\r\n\r\n", headers) resp = conn.getresponse() if resp.status != 401: @@ -2892,10 +2900,10 @@ def test_ap_wps_upnp_subscribe(dev, apdev): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urlparse.urlparse(urls['event_sub_url']) + eventurl = urllib.parse.urlparse(urls['event_sub_url']) - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "callback": '', "timeout": "Second-1234" } @@ -3241,9 +3249,9 @@ def test_ap_wps_upnp_subscribe_events(dev, apdev): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urlparse.urlparse(urls['event_sub_url']) + eventurl = urllib.parse.urlparse(urls['event_sub_url']) - class WPSERHTTPServer(SocketServer.StreamRequestHandler): + class WPSERHTTPServer(socketserver.StreamRequestHandler): def handle(self): data = self.rfile.readline().strip() logger.debug(data) @@ -3252,8 +3260,8 @@ def test_ap_wps_upnp_subscribe_events(dev, apdev): server = MyTCPServer(("127.0.0.1", 12345), WPSERHTTPServer) server.timeout = 1 - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", @@ -3308,8 +3316,8 @@ def test_ap_wps_upnp_http_proto(dev, apdev): location = ssdp_get_location(ap_uuid) - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc, timeout=0.2) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc, timeout=0.2) #conn.set_debuglevel(1) conn.request("HEAD", "hello") @@ -3407,8 +3415,8 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): location = ssdp_get_location(ap_uuid) - url = urlparse.urlparse(location) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(location) + conn = http.client.HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "Transfer-Encoding": 'chunked' } @@ -4079,7 +4087,7 @@ def gen_wps_event(sid='uuid:7eb3342a-8a5f-47fe-a585-0785bfec6d8a'): 'Date: Sat, 15 Aug 2015 18:55:08 GMT\r\n\r\n' return hdr + payload -class WPSAPHTTPServer(SocketServer.StreamRequestHandler): +class WPSAPHTTPServer(StreamRequestHandler): def handle(self): data = self.rfile.readline().strip() logger.info("HTTP server received: " + data) @@ -4113,10 +4121,10 @@ class WPSAPHTTPServer(SocketServer.StreamRequestHandler): def handle_others(self, data): logger.info("Ignore HTTP request: " + data) -class MyTCPServer(SocketServer.TCPServer): +class MyTCPServer(TCPServer): def __init__(self, addr, handler): self.allow_reuse_address = True - SocketServer.TCPServer.__init__(self, addr, handler) + socketserver.TCPServer.__init__(self, addr, handler) def wps_er_start(dev, http_server, max_age=1, wait_m_search=False, location_url=None): @@ -4184,7 +4192,7 @@ def run_wps_er_proto_test(dev, handler, no_event_url=False, location_url=None): dev.request("WPS_ER_STOP") def send_wlanevent(url, uuid, data, no_response=False): - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) payload = ''' 1 @@ -4239,8 +4247,8 @@ def _test_ap_wps_er_http_proto(dev, apdev): sock.close() logger.info("Valid Probe Request notification") - url = urlparse.urlparse(wps_event_url) - conn = httplib.HTTPConnection(url.netloc) + url = urllib.parse.urlparse(wps_event_url) + conn = http.client.HTTPConnection(url.netloc) payload = ''' 1 @@ -4270,32 +4278,32 @@ RGV2aWNlIEEQSQAGADcqAAEg raise Exception("No Enrollee UUID match") logger.info("Incorrect event URL AP id") - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("NOTIFY", url.path + '123', payload, headers) resp = conn.getresponse() if resp.status != 404: raise Exception("Unexpected HTTP response: %d" % resp.status) logger.info("Missing AP id") - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("NOTIFY", '/event/' + url.path.split('/')[2], payload, headers) time.sleep(0.1) logger.info("Incorrect event URL event id") - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("NOTIFY", '/event/123456789/123', payload, headers) time.sleep(0.1) logger.info("Incorrect event URL prefix") - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("NOTIFY", '/foobar/123456789/123', payload, headers) resp = conn.getresponse() if resp.status != 404: raise Exception("Unexpected HTTP response: %d" % resp.status) logger.info("Unsupported request") - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("FOOBAR", '/foobar/123456789/123', payload, headers) resp = conn.getresponse() if resp.status != 501: @@ -4303,7 +4311,7 @@ RGV2aWNlIEEQSQAGADcqAAEg logger.info("Unsupported request and OOM") with alloc_fail(dev[0], 1, "wps_er_http_req"): - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("FOOBAR", '/foobar/123456789/123', payload, headers) time.sleep(0.5) @@ -4543,7 +4551,7 @@ RGV2aWNlIEEQSQAGADcqAAEg pass sock.close() - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) payload = '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9381,7 +9389,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): pass with alloc_fail(hapd, 1, "dup_binstr;web_connection_parse_subscribe"): - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9391,7 +9399,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): raise Exception("Unexpected HTTP response: %d" % resp.status) with alloc_fail(hapd, 1, "wpabuf_alloc;web_connection_parse_unsubscribe"): - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9402,7 +9410,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): pass with alloc_fail(hapd, 1, "web_connection_unimplemented"): - conn = httplib.HTTPConnection(url.netloc) + conn = http.client.HTTPConnection(url.netloc) conn.request("HEAD", "/wps_device.xml") try: resp = conn.getresponse() diff --git a/tests/hwsim/test_p2p_wifi_display.py b/tests/hwsim/test_p2p_wifi_display.py index b032c4f42..d5179d8e7 100644 --- a/tests/hwsim/test_p2p_wifi_display.py +++ b/tests/hwsim/test_p2p_wifi_display.py @@ -9,7 +9,10 @@ import logging logger = logging.getLogger() import time import threading -import Queue +try: + from Queue import Queue +except ImportError: + from queue import Queue import hwsim_utils import utils From patchwork Thu Jan 24 07:45:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L+U9wdDr"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c4BiFUof"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ7H13y1z9sBn for ; Thu, 24 Jan 2019 18:49:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ejxNU6chF0Jaac5nQP32bQ7rIf7Sm0uoHQvhlKPoCug=; b=L+U9wdDrf07YijS1m6H2dvgdnT mWRi/a3ZYubBptlHMYjK5Mq7yQEa8TTWKG9jRu10Fk7skvn0C7ZwrV5Sv0jbERifrIR4bEmGGpSEb M9mnbt0+6wJne3sZ+8X55otGousdzgdIRkYF6hyQ9J6Q4JhkEWONU6AC8XG6Ck+EXBIyrfBsweXjA PQPhfVg8cTvWgoY+vO+2VhWv+tGOdBrmJSlHzlTYAt+0JoJTa8BH3GNWkaRSo1aFycgqZL5LK1618 0vpJLCpJ6zu19nR7T32ERMS8lhZMY84Ya5ZjvzFitDeEbRKI46hoc4Jg8bBIG8HPk077KWe+Agpv2 HdTCRLjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZlV-0008Ab-Qk; Thu, 24 Jan 2019 07:49:33 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj7-0005sZ-Vs for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:40 +0000 Received: by mail-pl1-x62e.google.com with SMTP id b5so2511774plr.4 for ; Wed, 23 Jan 2019 23:47:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WCaZ2aHmmxPyQSU3gUGTKvqz3szfMmmxg2Eof0T5c+I=; b=c4BiFUofFV+q2iMhs/T5n8YVtgOAzWAEoSJ9ZtHrTjdwEHFKK49ByLdWIMZ5j4EUFo rPdn+tEDqujPnbm2ynIF3TEY+gX9W6iDomdy5BtGXikHaURPDyX1VK0BXQou2QfPpzc5 e/lieBf54sjnQStn1esVpAI1qyd1ODK6Ho1wmZmW3W+WJNg87hjVQL4r0+MQ4oyBu56K Lkq4E8bZX5Jg+wLwpZEgihwEhroJAkhxAqBHRT0GNVtEgbhEzGoXHnHpoHRysJn8Hngu z9CdZEgThY0wZa5HRKWKdo5r9bUjuP9KANr6FrJJ3YQxCcN9KHzKUFoQttiF5pS5SSWE EylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WCaZ2aHmmxPyQSU3gUGTKvqz3szfMmmxg2Eof0T5c+I=; b=cZ7EzY2rtDkFoxEeVtZwqyun6wO511hP0a+zvc20lYwEmU3ffaytQExXUcD4vtA62q vAFZSawZJx0Xac0/kmoQf1iDjyws4rfKKjyb/h3Ts1/jNq8hqeCLKPH0k42lG5U5jCIE swDlYcSyd3TDUo/UH4cM8ZZNiuQwaUjokPFmbbHlSHuZxjInqaleEbkIdJpsoh3F91bq aqJrwzFL10BPTv4qAFF4PZwDePU/CC5jX0LePzxmEEeN7Pi2uCea5CiQd/+oH4x+icab hhdv4YVM+FN2qoWm8pJlr5agl5RAAKX3ll0MQ8tFMj5ulwKKF1jId5W9zmwCXrpt1OWv zYYQ== X-Gm-Message-State: AJcUukdvALU1NX/YWKXQ40eTMeVsfbwtkxD+/oYXibjr/YhHuEnOqlQ8 TBoMiWOXeAAShX4Esabmy3dqEZdt X-Google-Smtp-Source: ALg8bN58QVKUuzS0YrX+lOui4ZQJRQWiB5Hvx3dScctaFxFT+n0Yq/BVHeWnVrkK5TfKr4J9rbfhFg== X-Received: by 2002:a17:902:8c91:: with SMTP id t17mr5366641plo.119.1548316024622; Wed, 23 Jan 2019 23:47:04 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:03 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 12/50] tests: Decode subprocess.check_output return value for python3 Date: Thu, 24 Jan 2019 16:45:52 +0900 Message-Id: <20190124074630.4192-13-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234706_260291_58E47ACA X-CRM114-Status: GOOD ( 12.78 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/remotehost.py | 6 +++--- tests/hwsim/test_ap_eap.py | 18 +++++++++--------- tests/hwsim/test_ap_hs20.py | 2 +- tests/hwsim/test_hs20_filter.py | 6 +++--- tests/hwsim/test_hs20_pps_mo.py | 2 +- tests/hwsim/test_wmediumd.py | 6 +++--- tests/hwsim/wlantest.py | 2 +- wpaspy/wpaspy.py | 5 +++-- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index bf1ccd216..5df727b6e 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -19,7 +19,7 @@ def execute_thread(command, reply): logger.debug("thread run: " + cmd) try: status = 0 - buf = subprocess.check_output(command, stderr=subprocess.STDOUT) + buf = subprocess.check_output(command, stderr=subprocess.STDOUT).decode() except subprocess.CalledProcessError as e: status = e.returncode buf = e.output @@ -48,7 +48,7 @@ class Host(): logger.debug("execute: " + str(command)) try: status = 0 - buf = subprocess.check_output(command, stderr=subprocess.STDOUT) + buf = subprocess.check_output(command, stderr=subprocess.STDOUT).decode() except subprocess.CalledProcessError as e: status = e.returncode buf = e.output @@ -66,7 +66,7 @@ class Host(): logger.debug(_cmd) try: status = 0 - buf = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + buf = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() except subprocess.CalledProcessError as e: status = e.returncode buf = e.output diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index f40be0c55..428066ed4 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -529,7 +529,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -555,7 +555,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000009 " + rand]) + "GSM-AUTH-REQ 232010000000009 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -595,7 +595,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim2(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -622,7 +622,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim2(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000009 " + rand]) + "GSM-AUTH-REQ 232010000000009 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -665,7 +665,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim3(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -698,7 +698,7 @@ def _test_ap_wpa2_eap_sim_ext_replace_sim3(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000009 " + rand]) + "GSM-AUTH-REQ 232010000000009 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -764,7 +764,7 @@ def _test_ap_wpa2_eap_sim_change_bssid(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -805,7 +805,7 @@ def _test_ap_wpa2_eap_sim_no_change_set(dev, apdev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() @@ -1707,7 +1707,7 @@ def run_ext_sim_auth(dev): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index ef08f6533..6aef83a8a 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -129,7 +129,7 @@ def interworking_ext_sim_auth(dev, method): res = subprocess.check_output(["../../hostapd/hlr_auc_gw", "-m", "auth_serv/hlr_auc_gw.milenage_db", - "GSM-AUTH-REQ 232010000000000 " + rand]) + "GSM-AUTH-REQ 232010000000000 " + rand]).decode() if "GSM-AUTH-RESP" not in res: raise Exception("Unexpected hlr_auc_gw response") resp = res.split(' ')[2].rstrip() diff --git a/tests/hwsim/test_hs20_filter.py b/tests/hwsim/test_hs20_filter.py index a88f3ed83..0a7db628e 100644 --- a/tests/hwsim/test_hs20_filter.py +++ b/tests/hwsim/test_hs20_filter.py @@ -32,7 +32,7 @@ class IPAssign(object): if self._ipv6: # wait for DAD to finish while True: - o = subprocess.check_output(self._cmd + ['show', 'tentative', 'dev', self._iface]) + o = subprocess.check_output(self._cmd + ['show', 'tentative', 'dev', self._iface]).decode() if not self._addr in o: break time.sleep(0.1) @@ -167,7 +167,7 @@ def test_ip4_drop_gratuitous_arp(devs, apdevs, params): if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt): raise Exception("DATA_TEST_FRAME failed") - if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']): + if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode(): raise Exception("gratuitous ARP frame updated erroneously") finally: subprocess.call(['ip', 'neigh', 'del', '10.0.0.1', 'dev', dev.ifname]) @@ -193,7 +193,7 @@ def test_ip6_drop_unsolicited_na(devs, apdevs, params): if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt): raise Exception("DATA_TEST_FRAME failed") - if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']): + if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode(): raise Exception("unsolicited NA frame updated erroneously") finally: subprocess.call(['ip', '-6', 'neigh', 'del', 'fdaa::2', 'dev', dev.ifname]) diff --git a/tests/hwsim/test_hs20_pps_mo.py b/tests/hwsim/test_hs20_pps_mo.py index 5324cde1f..75c524ad6 100644 --- a/tests/hwsim/test_hs20_pps_mo.py +++ b/tests/hwsim/test_hs20_pps_mo.py @@ -20,7 +20,7 @@ def check_hs20_osu_client(): def set_pps(pps_mo): res = subprocess.check_output(["../../hs20/client/hs20-osu-client", - "set_pps", pps_mo]) + "set_pps", pps_mo]).decode() logger.info("set_pps result: " + res) def test_hs20_pps_mo_1(dev, apdev): diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index f17a02776..2d264cd59 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -66,10 +66,10 @@ model: def get_wmediumd_version(): if len(LocalVariables.revs) > 0: - return LocalVariables.revs; + return LocalVariables.revs try: - verstr = subprocess.check_output(['wmediumd', '-V']) + verstr = subprocess.check_output(['wmediumd', '-V']).decode() except OSError as e: if e.errno == errno.ENOENT: raise HwsimSkip('wmediumd not available') @@ -82,7 +82,7 @@ def get_wmediumd_version(): while len(LocalVariables.revs) < 3: LocalVariables.revs += [0] - return LocalVariables.revs; + return LocalVariables.revs def require_wmediumd_version(major, minor, patch): revs = get_wmediumd_version() diff --git a/tests/hwsim/wlantest.py b/tests/hwsim/wlantest.py index 75dcdb568..95c09bb99 100644 --- a/tests/hwsim/wlantest.py +++ b/tests/hwsim/wlantest.py @@ -111,7 +111,7 @@ class Wlantest: raise Exception("wlantest_cli failed") return ret[1] else: - return subprocess.check_output([self.wlantest_cli] + params) + return subprocess.check_output([self.wlantest_cli] + params).decode() def flush(self): res = self.cli_cmd(["flush"]) diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py index 50ecf2374..62c750d8d 100644 --- a/wpaspy/wpaspy.py +++ b/wpaspy/wpaspy.py @@ -86,10 +86,11 @@ class Ctrl: if self.udp: self.s.sendto(self.cookie + cmd, self.sockaddr) else: - self.s.send(cmd) + # we specify utf-8 for utf-8 SSID + self.s.send(cmd.encode('utf-8')) [r, w, e] = select.select([self.s], [], [], timeout) if r: - return self.s.recv(4096) + return self.s.recv(4096).decode() raise Exception("Timeout on waiting response") def attach(self): From patchwork Thu Jan 24 07:45:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030306 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mhas3JcJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UigEknYh"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ6q3w2zz9s9h for ; Thu, 24 Jan 2019 18:49:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XbDHemSpXFNXTng4MkU8tVSipRmnbADF7LoAre16FPM=; b=mhas3JcJcRJ4YgCS0uLDP1+xBt C45QHwJPBDY0Q4jujPPOBei5tvJFv+69OlJvi4RFSjNMun1F77JQ0i71l2iFlWLmc3qJzmZddubmw h/Ua44puRbtg7cmUagnTjJ3v5AeKcThhTSF2bT1Z2Zs28KjuFfqK4kH7M4knihf+rgA1GIRp9B3e7 qYqggB/eTDouGFcSl89Z7HgtWf2FiQynw8jUBr7bl3crt/RN3L/f7B/EoWrJb/1vOEBQWKL8v4LH/ MzXc/CXPvyAoviMu0/WA9rJOSEFG9mPBLfPYsIOFSaD61+EXAlX6wuGuSAh8CGvQkR2ON0L5hZu7Z VnhN3YAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZl5-0007fr-M7; Thu, 24 Jan 2019 07:49:07 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZj9-0005tm-Mn for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:40 +0000 Received: by mail-pl1-x62f.google.com with SMTP id b5so2511802plr.4 for ; Wed, 23 Jan 2019 23:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h6ajdUoxpMaa1NDd7pCkjmgjjf6m/Cf9sDSBsQvhe1s=; b=UigEknYhm0D79Goq/MSvMpai25q1UL8/1q8a5qIzoobdPPZ3hPjv+X6PiOddbra0/w Wq/u+UtX+Cb2fTd19hyt4I9tr4Uq/jqWtaDZpxJ8UcRcW4l+TW7W87PR4IkMSAX7yuzo 8Lh0jeEof1uXWz4rSMuZmY9uhLNzQib7Eg0Amkug5w+geCzge93HLMjkoj02wQMT18++ lHGBdd8dMeCkSLPyog5rkmSGBn6sBdpk5GJdh8K/lLUA3kIKY1q3mGc1OzU3ZansDgoR Ee3Q5TVrF1jb5DhEkdqLc6Ow7AJxxJHMRFpHSSyxMr1nUxz39rJyVfsmoDwXmPA2aHPn ZDYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h6ajdUoxpMaa1NDd7pCkjmgjjf6m/Cf9sDSBsQvhe1s=; b=fzKt3Oli0luNhA5RfsEUpGtHV6YsW9I66LMKNpNtwql2RjjT3wXhu246Ig1kNpOIeF lVDxXQz095giiU8BcOu4zz/Ri45yWjbii4blTc4AQKmYO/LDIJ7edaIDghYQAXcEGd6N dIJbdnPEs4UgWmvDFF4v11fujZF7bV8+BhAOy2pwReXbNWvc59ac6rEGQuGYAwogTIh6 QY2uCAgjxEPpBlkGjvrtD+MJ2lerOSAOGUPvSfgSEhbQ8KAy6S2FijMlPsH6fH1v1Zfo tb+x854lXHqnP8nnD7bPveUdbPgNLphdwHDuKXVj1XQAtu+L5LkiHlGZNfC6/I1VQzFf GMcA== X-Gm-Message-State: AJcUukdvlfn3HQAkqdgqy/nq6g9xNbt9tUTLDsh7tC72f7COGOlVMD9j CK2DEgHTb11Wd4uKymh69ozDlRtw X-Google-Smtp-Source: ALg8bN5HLWNqlWov9sPnZaGei0JEP+sYu0YktTE4n2qF8rl8kRP0Wg4sWVp8VTsVP4At93qUzPoQeg== X-Received: by 2002:a17:902:2a66:: with SMTP id i93mr5460550plb.113.1548316026346; Wed, 23 Jan 2019 23:47:06 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:05 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 13/50] tests: Modify core functions for python3 Date: Thu, 24 Jan 2019 16:45:53 +0900 Message-Id: <20190124074630.4192-14-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234708_307312_0510E142 X-CRM114-Status: GOOD ( 13.93 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/hostapd.py | 9 ++++++--- tests/hwsim/hwsim.py | 2 +- tests/hwsim/netlink.py | 11 +++++------ tests/hwsim/nl80211.py | 4 ++-- tests/hwsim/rfkill.py | 12 +++++++----- tests/hwsim/run-tests.py | 2 +- tests/hwsim/tshark.py | 12 ++++++++---- tests/hwsim/wpasupplicant.py | 11 +++++++---- wpaspy/wpaspy.py | 8 ++++---- 9 files changed, 41 insertions(+), 30 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 9deab15aa..3d6ca1d19 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -162,7 +162,7 @@ class Hostapd: stdout=subprocess.PIPE, shell=shell) out = proc.communicate()[0] ret = proc.returncode - return ret, out + return ret, out.decode() else: return self.host.execute(cmd_array) @@ -180,7 +180,10 @@ class Hostapd: return self.bssid def request(self, cmd): - logger.debug(self.dbg + ": CTRL: " + cmd) + try: + logger.debug(self.dbg + ": CTRL: " + cmd) + except UnicodeEncodeError: + pass return self.ctrl.request(cmd) def ping(self): @@ -329,7 +332,7 @@ class Hostapd: def mgmt_tx(self, msg): t = (msg['fc'], 0) + mac2tuple(msg['da']) + mac2tuple(msg['sa']) + mac2tuple(msg['bssid']) + (0,) hdr = struct.pack('' % (self._type, repr(self._data)) @@ -71,7 +71,7 @@ class U8Attr(Attr): class FlagAttr(Attr): def __init__(self, attr_type): - Attr.__init__(self, attr_type, "") + Attr.__init__(self, attr_type, bytes()) class Nested(Attr): def __init__(self, attr_type, attrs): @@ -113,10 +113,9 @@ class Message(object): self.pid = -1 payload = payload or [] if isinstance(payload, list): - contents = [] + self.payload = bytes() for attr in payload: - contents.append(attr._dump()) - self.payload = ''.join(contents) + self.payload = self.payload + attr._dump() else: self.payload = payload diff --git a/tests/hwsim/nl80211.py b/tests/hwsim/nl80211.py index 910381639..daba2371b 100644 --- a/tests/hwsim/nl80211.py +++ b/tests/hwsim/nl80211.py @@ -322,7 +322,7 @@ nl80211_attr = { def build_nl80211_attr(id, val): attr = struct.pack("@HH", 4 + len(val), nl80211_attr[id]) + val if len(attr) % 4 != 0: - attr += '\0' * (4 - (len(attr) % 4)) + attr += b'\x00' * (4 - (len(attr) % 4)) return attr def build_nl80211_attr_u32(id, val): @@ -335,7 +335,7 @@ def build_nl80211_attr_u8(id, val): return build_nl80211_attr(id, struct.pack("@B", val)) def build_nl80211_attr_flag(id): - return build_nl80211_attr(id, '') + return build_nl80211_attr(id, bytes()) def build_nl80211_attr_mac(id, val): addr = struct.unpack('6B', binascii.unhexlify(val.replace(':',''))) diff --git a/tests/hwsim/rfkill.py b/tests/hwsim/rfkill.py index a5e6f523a..f08cf50c5 100755 --- a/tests/hwsim/rfkill.py +++ b/tests/hwsim/rfkill.py @@ -97,20 +97,20 @@ class RFKill(object): return self.blocked[1] def block(self): - rfk = open('/dev/rfkill', 'w') + rfk = open('/dev/rfkill', 'wb') s = struct.pack(_event_struct, self.idx, TYPE_ALL, _OP_CHANGE, 1, 0) rfk.write(s) rfk.close() def unblock(self): - rfk = open('/dev/rfkill', 'w') + rfk = open('/dev/rfkill', 'wb') s = struct.pack(_event_struct, self.idx, TYPE_ALL, _OP_CHANGE, 0, 0) rfk.write(s) rfk.close() @classmethod def block_all(cls, t=TYPE_ALL): - rfk = open('/dev/rfkill', 'w') + rfk = open('/dev/rfkill', 'wb') print(rfk) s = struct.pack(_event_struct, 0, t, _OP_CHANGE_ALL, 1, 0) rfk.write(s) @@ -118,7 +118,7 @@ class RFKill(object): @classmethod def unblock_all(cls, t=TYPE_ALL): - rfk = open('/dev/rfkill', 'w') + rfk = open('/dev/rfkill', 'wb') s = struct.pack(_event_struct, 0, t, _OP_CHANGE_ALL, 0, 0) rfk.write(s) rfk.close() @@ -126,13 +126,15 @@ class RFKill(object): @classmethod def list(cls): res = [] - rfk = open('/dev/rfkill', 'r') + rfk = open('/dev/rfkill', 'rb') fd = rfk.fileno() flgs = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, flgs | os.O_NONBLOCK) while True: try: d = rfk.read(_event_sz) + if d == None: + break _idx, _t, _op, _s, _h = struct.unpack(_event_struct, d) if _op != _OP_ADD: continue diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index be0edcb7a..49e42cd78 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -84,7 +84,7 @@ def add_log_file(conn, test, run, type, path): if not os.path.exists(path): return contents = None - with open(path, 'r') as f: + with open(path, 'rb') as f: contents = f.read() if contents is None: return diff --git a/tests/hwsim/tshark.py b/tests/hwsim/tshark.py index 81aee6c4b..042c10575 100644 --- a/tests/hwsim/tshark.py +++ b/tests/hwsim/tshark.py @@ -7,6 +7,7 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. +import sys import time import subprocess import logging @@ -46,11 +47,14 @@ def _run_tshark(filename, filter, display=None, wait=True): output = cmd.communicate() out = output[0] + if sys.version_info[0] > 2: + out = out.decode() res = cmd.wait() + _output = output[1].decode() if res == 1: errmsg = "Some fields aren't valid" - if errmsg in output[1]: - errors = output[1].split('\n') + if errmsg in _output: + errors = _output.split('\n') fields = [] collect = False for f in errors: @@ -71,8 +75,8 @@ def _run_tshark(filename, filter, display=None, wait=True): out = cmd.communicate()[0] cmd.wait() if res == 2: - if "tshark: Neither" in output[1] and "are field or protocol names" in output[1]: - errors = output[1].split('\n') + if "tshark: Neither" in _output and "are field or protocol names" in _output: + errors = _output.split('\n') fields = [] for f in errors: if f.startswith("tshark: Neither "): diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index fed9a5eff..02cd0e93d 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -62,7 +62,7 @@ class WpaSupplicant: cmd = cmd_array proc = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=shell) - out = proc.communicate()[0] + out = proc.communicate()[0].decode() ret = proc.returncode return ret, out else: @@ -169,7 +169,10 @@ class WpaSupplicant: self.global_request("INTERFACE_REMOVE " + ifname) def request(self, cmd, timeout=10): - logger.debug(self.dbg + ": CTRL: " + cmd) + try: + logger.debug(self.dbg + ": CTRL: " + cmd) + except UnicodeEncodeError: + pass return self.ctrl.request(cmd, timeout=timeout) def global_request(self, cmd): @@ -1151,8 +1154,8 @@ class WpaSupplicant: self.dump_monitor() if new_ssid: self.request("WPS_REG " + bssid + " " + pin + " " + - new_ssid.encode("hex") + " " + key_mgmt + " " + - cipher + " " + new_passphrase.encode("hex")) + binascii.hexlify(new_ssid.encode()).decode() + " " + key_mgmt + " " + + cipher + " " + binascii.hexlify(new_passphrase.encode()).decode()) if no_wait: return ev = self.wait_event(["WPS-SUCCESS"], timeout=15) diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py index 62c750d8d..4fbbabc61 100644 --- a/wpaspy/wpaspy.py +++ b/wpaspy/wpaspy.py @@ -54,9 +54,9 @@ class Ctrl: break self.s = socket.socket(af, socktype) self.s.settimeout(5) - self.s.sendto("GET_COOKIE", sockaddr) + self.s.sendto("GET_COOKIE".encode(), sockaddr) reply, server = self.s.recvfrom(4096) - self.cookie = reply + self.cookie = reply.decode() self.port = port except: print("connect exception ", path, str(port)) @@ -84,7 +84,7 @@ class Ctrl: def request(self, cmd, timeout=10): if self.udp: - self.s.sendto(self.cookie + cmd, self.sockaddr) + self.s.sendto((self.cookie + cmd).encode(), self.sockaddr) else: # we specify utf-8 for utf-8 SSID self.s.send(cmd.encode('utf-8')) @@ -130,5 +130,5 @@ class Ctrl: return False def recv(self): - res = self.s.recv(4096) + res = self.s.recv(4096).decode() return res From patchwork Thu Jan 24 07:45:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Zma7zaye"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JNtrpw3j"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ7Q2Csvz9s9h for ; Thu, 24 Jan 2019 18:49:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5esE7lCk0l4TqnavCiMjHQ2u8CwCBThBD8GA/F65EMw=; b=Zma7zayeZ1exxV0Yg73BNNdAhM yTCusihUshrU6s/hK+U51Oazo6kLwN5BWJDkrpwW4o/qt54xoCY6m7L04qIvrd04MiDoA7lYJskhs mpEiY/Fy+3ymCE+r8c7nrp2pNqe5ylf4DHrIFGY7bMJ4eNynEmFz7JgJbKGzoKBFTumaejYu9LXBa ev5P7mC6XfPFVMDBHMoBEocsAsX0o++kqFpTsN1SIvwdpzHtieMMrsqoEEQpUUXtvjvFgAxEUw1q4 fEc60dsUTAYa/S686K1G4y0oKDZWV5shUToTuuJVPJ79f0lzJWJKI0j18iZ8SLIznF2f2toqGxEfS coNyzHlw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZle-0008Km-Gz; Thu, 24 Jan 2019 07:49:42 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjB-0005vC-6Q for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:41 +0000 Received: by mail-pg1-x542.google.com with SMTP id y4so2290854pgc.12 for ; Wed, 23 Jan 2019 23:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Shx1bbL/coJm1f9vqEO0TaOzrC9OgP1b0HchNiia+VM=; b=JNtrpw3jWy7uvhfjaCqUU+oaXc89pa4xE9VS6XUi+2+ZnuOyeKoXzWk7MK7TcRJrgZ /w/3mSV9WxwA+Cc457PS3in4stEVkM7pveyUM1pb7MUdhuheRxWVVJJV+Qob7v3maI7h K1/Nti59sX9J0mQvyiCWZ0I5kSAou+cysHV5Om36p4uAX6upCgYDb01RQjeIH3A+Lwhc 9VCk2rjA3+1ba1LtLdMQUNcfseFg4gelrnQsZWz9KFeVRurDyZVxwMU+oBglUuZBQhpx KOj+geCTl/pTIXNuS9BU9tY9eaFgUOFC7jLYo6haeNt+nuGgxyydrNXpXKWm0wefzxzI 77mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Shx1bbL/coJm1f9vqEO0TaOzrC9OgP1b0HchNiia+VM=; b=VMfCtzFbTkhvfbzNdnJlPdaziJE8CUSxpUU+dgFKOo6OeDoXbO+w7GF6rTuDu2R8Yr MnY9i/wOLp1dGxO/FT6mrg9CVXFf6kThNCelKL2bg9ngACmQKDYIf6pJssPR5mIw/4P+ tYOXMSoSLNGunKFGXKd/WAsfp5FvcC7ELpK5U3lhkKmE9c/z3zQUCICoUybUO4yAP6QD HSzlZVFYSqNTsu5QoK4BVW5nX2ZRnUKUggY6XnZJQ+NTfrlZbvR8YxF7kIIGMuoNQLqH fNKUxjRiLyze6kHcMYn+GlF7VjueIgObj2GYcPK7QkGsi62QtzJPdK+DPdz/fC7hDA0K vGsQ== X-Gm-Message-State: AJcUukeWpvlBr3N0uOg30GU1GMvuA6/UdIkDx/cpRSCzUrjOzx6f5zM3 +4txosP1Q9jk0rdO8EzwAqtZU3Uf X-Google-Smtp-Source: ALg8bN4ZuJepS4SnS7uyT4lvhvtEV9DpmiDtbYDOQsdgEWBJtiK8Xc/QX9KB8sYA09ZaEB7M4GJM0Q== X-Received: by 2002:a63:c00b:: with SMTP id h11mr5080296pgg.429.1548316028069; Wed, 23 Jan 2019 23:47:08 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:07 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 14/50] tests: ap_eap test requires more memory Date: Thu, 24 Jan 2019 16:45:54 +0900 Message-Id: <20190124074630.4192-15-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234709_701458_AAD27EC7 X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/vm/vm-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/vm/vm-run.sh b/tests/hwsim/vm/vm-run.sh index 9da1466a3..c000d429c 100755 --- a/tests/hwsim/vm/vm-run.sh +++ b/tests/hwsim/vm/vm-run.sh @@ -13,7 +13,7 @@ else fi # increase the memory size if you want to run with valgrind, 512 MB works -MEMORY=192 +MEMORY=256 # Some ubuntu systems (notably 12.04) have issues with this - since the guest # mounts as read-only it should be safe to not specify ,readonly. Override in From patchwork Thu Jan 24 07:45:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fdh4RraG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bbVr+3dM"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ7x0ggmz9s9h for ; Thu, 24 Jan 2019 18:50:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TVhyR0NUUnWDJVnMgmP53DhKzgscsjUyeOT7cm09tfY=; b=Fdh4RraGkGjgKJ Hn4V0rwQtBa6qSfPN3theo1zDkVsUpObUrfvz68tJyfFLnN2Bk3YqKeaCOwxWoBwvgAKG6jzTxG62 G2G14y9MNyaShajDnAKFvttxBeSnCb92xvW7tsmU+wfpfkVJlfGiO3dtS3wQ66OSvwKWBxQ09GT2u 0OW/hAtBH7/GLvSQ01bEBRb31io7F7I1P7t47il7Y9iHKX/2YIAftAjY9G9abbF4RmG6p46GFdvEe qzNjUfVUKE++2Ji/EASte1E9PocjrC2Ax8QvaMcnSBvZ1OeZeVTo0avPGWipNNDETgYRGC94HaESv /Oy8uqk8wji8OoEsjcBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZm3-0000Vi-M1; Thu, 24 Jan 2019 07:50:07 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjD-0005wn-97 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:52 +0000 Received: by mail-pl1-x62a.google.com with SMTP id u18so2511593plq.7 for ; Wed, 23 Jan 2019 23:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DSAvlqT9oK37GYdVWtJTx+O/oDUxneC0ZMggk3KGpzI=; b=bbVr+3dMD3xRHGHycJX4sHeTujYYMtBCiFZ9PHDM/bBL3VA5Cp5umuvqxuirRxU7+g vtWX7aAcaomhbdwykEjvGt10X4tMadBv+fx/xxAQiv8pswCrvippp0fPqmXNcbBaZcxm Z6uiOuL5QEwhsDZTwx3jHKBjpkLhgzScOWA3f71oiP1ejQJnFJdjygoKrr4iSL0eUPdW I3FUwoEbKc39vPwAy7qafwf7mbStRDTninriI0UyfolIbhnmUbdV8aOxCR82meBOAtbi Umbtw6rB+G0eo0M6xkDuu/7jz3iTycyxhsOUX+tNjomXSmM/prQ5MCU1tmLs0pdqp7y4 ppew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DSAvlqT9oK37GYdVWtJTx+O/oDUxneC0ZMggk3KGpzI=; b=tI6CfYzXWT3/s/yqrV0Ssco8CxqFFLrccVjq9odFq5u9opgY3UiOBbOtq1zK0oHqK1 vVldbTyoiWIF2mlLDHaaopDP3yP/+c2C/kERx2HBkxj5VvFQ3ZRYDRqqMXR2ElbtrECX 1o9xhKTC5dmcTd+6ZtBLNcZkr7rkGk/mdCdE0pa+PrlhOL6kGJ54AVl9hPPEy+j9KOse +lZ+M1hvEm9tuMSFsEGyR8cQr7OO8At7FZBZivtzqijIXC71NDhRCVJd/QSlNfnN6IBU UIo6CbSDOvqx7FZRHMQew7ceXJL3Xcp/mOxG9dk17n5IeUZY85oQ7IBDIVviKGK7aFlL C3EQ== X-Gm-Message-State: AJcUukdSC8lzIUSe+UyB7U4qp/wFZx+7FsgrRcmjhZdr53f3IekCVL6x 6IWOfKfYamJdpfYpx6F3ROgrp/tt X-Google-Smtp-Source: ALg8bN5SCVTS0xmK1DxG3aa1DiA6pCdoBSwkdlpYChzCXfibnByBVQCRyPQCfzCRWT0UG6vIiG/EOw== X-Received: by 2002:a17:902:981:: with SMTP id 1mr5424788pln.142.1548316029812; Wed, 23 Jan 2019 23:47:09 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:09 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 15/50] tests: Modify ap_eap test sets for python3 Date: Thu, 24 Jan 2019 16:45:55 +0900 Message-Id: <20190124074630.4192-16-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234711_720264_58351066 X-CRM114-Status: GOOD ( 10.37 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_eap.py | 48 +++++++++++++++++++------------------- tests/hwsim/test_ap_psk.py | 9 ++++--- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 428066ed4..2bdaff77d 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -1457,7 +1457,7 @@ def test_ap_wpa2_eap_ttls_mschapv2_utf8(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hapd = hostapd.add_ap(apdev[0], params) eap_connect(dev[0], hapd, "TTLS", "utf8-user-hash", - anonymous_identity="ttls", password="secret-åäö-€-password", + anonymous_identity="ttls", password=u"secret-åäö-€-password", ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2") eap_connect(dev[1], hapd, "TTLS", "utf8-user", anonymous_identity="ttls", @@ -2047,13 +2047,13 @@ def test_ap_wpa2_eap_tls_blob(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hapd = hostapd.add_ap(apdev[0], params) cert = read_pem("auth_serv/ca.pem") - if "OK" not in dev[0].request("SET blob cacert " + cert.encode("hex")): + if "OK" not in dev[0].request("SET blob cacert " + binascii.hexlify(cert).decode()): raise Exception("Could not set cacert blob") cert = read_pem("auth_serv/user.pem") - if "OK" not in dev[0].request("SET blob usercert " + cert.encode("hex")): + if "OK" not in dev[0].request("SET blob usercert " + binascii.hexlify(cert).decode()): raise Exception("Could not set usercert blob") key = read_pem("auth_serv/user.rsa-key") - if "OK" not in dev[0].request("SET blob userkey " + key.encode("hex")): + if "OK" not in dev[0].request("SET blob userkey " + binascii.hexlify(key).decode()): raise Exception("Could not set cacert blob") eap_connect(dev[0], hapd, "TLS", "tls user", ca_cert="blob://cacert", client_cert="blob://usercert", @@ -2128,10 +2128,10 @@ def test_ap_wpa2_eap_tls_pkcs12_blob(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hapd = hostapd.add_ap(apdev[0], params) cert = read_pem("auth_serv/ca.pem") - if "OK" not in dev[0].request("SET blob cacert " + cert.encode("hex")): + if "OK" not in dev[0].request("SET blob cacert " + binascii.hexlify(cert).decode()): raise Exception("Could not set cacert blob") with open("auth_serv/user.pkcs12", "rb") as f: - if "OK" not in dev[0].request("SET blob pkcs12 " + f.read().encode("hex")): + if "OK" not in dev[0].request("SET blob pkcs12 " + binascii.hexlify(f.read()).decode()): raise Exception("Could not set pkcs12 blob") eap_connect(dev[0], hapd, "TLS", "tls user", ca_cert="blob://cacert", private_key="blob://pkcs12", @@ -2143,7 +2143,7 @@ def test_ap_wpa2_eap_tls_neg_incorrect_trust_root(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hostapd.add_ap(apdev[0], params) cert = read_pem("auth_serv/ca-incorrect.pem") - if "OK" not in dev[0].request("SET blob cacert " + cert.encode("hex")): + if "OK" not in dev[0].request("SET blob cacert " + binascii.hexlify(cert).decode()): raise Exception("Could not set cacert blob") dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", identity="DOMAIN\mschapv2 user", anonymous_identity="ttls", @@ -3421,7 +3421,7 @@ def test_ap_wpa2_eap_fast_text_pac_errors(dev, apdev): pac += "START\n" pac += "PAC-Type\n" pac += "END\n" - if "OK" not in dev[0].request("SET blob fast_pac_text_errors " + pac.encode("hex")): + if "OK" not in dev[0].request("SET blob fast_pac_text_errors " + binascii.hexlify(pac.encode()).decode()): raise Exception("Could not set blob") dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="FAST", @@ -4224,7 +4224,7 @@ def ica_ocsp(cert, md="-sha256"): "-cert", cert, "-no_nonce", "-text" ] cmd = subprocess.Popen(arg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - res = cmd.stdout.read() + "\n" + cmd.stderr.read() + res = cmd.stdout.read().decode() + "\n" + cmd.stderr.read().decode() cmd.stdout.close() cmd.stderr.close() cmd.wait() @@ -4241,7 +4241,7 @@ def ica_ocsp(cert, md="-sha256"): "-text" ] cmd = subprocess.Popen(arg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - res = cmd.stdout.read() + "\n" + cmd.stderr.read() + res = cmd.stdout.read().decode() + "\n" + cmd.stderr.read().decode() cmd.stdout.close() cmd.stderr.close() cmd.wait() @@ -4760,7 +4760,7 @@ def test_ap_wpa2_eap_ttls_dh_params_blob(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hapd = hostapd.add_ap(apdev[0], params) dh = read_pem("auth_serv/dh2.conf") - if "OK" not in dev[0].request("SET blob dhparams " + dh.encode("hex")): + if "OK" not in dev[0].request("SET blob dhparams " + binascii.hexlify(dh).decode()): raise Exception("Could not set dhparams blob") eap_connect(dev[0], hapd, "TTLS", "pap user", anonymous_identity="ttls", password="password", @@ -4983,9 +4983,9 @@ def test_ap_wpa2_eap_non_ascii_identity(dev, apdev): params = int_eap_server_params() hostapd.add_ap(apdev[0], params) dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", - identity="\x80", password="password", wait_connect=False) + identity=u"\x80", password="password", wait_connect=False) dev[1].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", - identity="a\x80", password="password", wait_connect=False) + identity=u"a\x80", password="password", wait_connect=False) for i in range(0, 2): ev = dev[i].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=16) if ev is None: @@ -4999,9 +4999,9 @@ def test_ap_wpa2_eap_non_ascii_identity2(dev, apdev): params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hostapd.add_ap(apdev[0], params) dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", - identity="\x80", password="password", wait_connect=False) + identity=u"\x80", password="password", wait_connect=False) dev[1].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", - identity="a\x80", password="password", wait_connect=False) + identity=u"a\x80", password="password", wait_connect=False) for i in range(0, 2): ev = dev[i].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=16) if ev is None: @@ -5128,7 +5128,7 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params): get_key_locations(buf, pmk, "PMK") get_key_locations(buf, msk, "MSK") get_key_locations(buf, emsk, "EMSK") - if password not in buf: + if binascii.unhexlify(password) not in buf: raise HwsimSkip("Password not found while associated") if pmk not in buf: raise HwsimSkip("PMK not found while associated") @@ -5960,15 +5960,15 @@ def test_ap_wpa2_eap_sim_db(dev, apdev, params): class test_handler(SocketServer.DatagramRequestHandler): def handle(self): - data = self.request[0].strip() + data = self.request[0].decode().strip() socket = self.request[1] logger.debug("Received hlr_auc_gw request: " + data) # EAP-SIM DB: Failed to parse response string - socket.sendto("FOO", self.client_address) + socket.sendto("FOO".encode(), self.client_address) # EAP-SIM DB: Failed to parse response string - socket.sendto("FOO 1", self.client_address) + socket.sendto("FOO 1".encode(), self.client_address) # EAP-SIM DB: Unknown external response - socket.sendto("FOO 1 2", self.client_address) + socket.sendto("FOO 1 2".encode(), self.client_address) logger.info("No proper response - wait for pending eap_sim_db request timeout") server = SocketServer.UnixDatagramServer(sockpath, test_handler) @@ -5986,7 +5986,7 @@ def test_ap_wpa2_eap_sim_db(dev, apdev, params): class test_handler2(SocketServer.DatagramRequestHandler): def handle(self): - data = self.request[0].strip() + data = self.request[0].decode().strip() socket = self.request[1] logger.debug("Received hlr_auc_gw request: " + data) fname = os.path.join(params['logdir'], @@ -5994,10 +5994,10 @@ def test_ap_wpa2_eap_sim_db(dev, apdev, params): cmd = subprocess.Popen(['../../hostapd/hlr_auc_gw', '-m', fname, data], stdout=subprocess.PIPE) - res = cmd.stdout.read().strip() + res = cmd.stdout.read().decode().strip() cmd.stdout.close() logger.debug("hlr_auc_gw response: " + res) - socket.sendto(res, self.client_address) + socket.sendto(res.encode(), self.client_address) server.RequestHandlerClass = test_handler2 @@ -6431,7 +6431,7 @@ def test_ap_wpa2_eap_psk_mac_addr_change(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) cmd = subprocess.Popen(['ps', '-eo', 'pid,command'], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() pid = 0 for p in res.splitlines(): diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 0f860df8d..69519a767 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -2233,9 +2233,10 @@ def find_wpas_process(dev): def read_process_memory(pid, key=None): buf = bytes() logger.info("Reading process memory (pid=%d)" % pid) - with open('/proc/%d/maps' % pid, 'r') as maps, \ - open('/proc/%d/mem' % pid, 'r') as mem: + with open('/proc/%d/maps' % pid, 'rb') as maps, \ + open('/proc/%d/mem' % pid, 'rb') as mem: for l in maps.readlines(): + l = l.decode() m = re.match(r'([0-9a-f]+)-([0-9a-f]+) ([-r][-w][-x][-p])', l) if not m: continue @@ -2254,7 +2255,7 @@ def read_process_memory(pid, key=None): mem.seek(start) data = mem.read(end - start) buf += data - if key and key in data: + if key and key in binascii.hexlify(data).decode(): logger.info("Key found in " + l) logger.info("Total process memory read: %d bytes" % len(buf)) return buf @@ -2273,6 +2274,8 @@ def get_key_locations(buf, key, keyname): count = 0 pos = 0 while True: + if not type(key) == bytes: + key = key.encode() pos = buf.find(key, pos) if pos < 0: break From patchwork Thu Jan 24 07:45:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="laRtBiHB"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="I00fSQqU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qigprIwE"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ5n5DHKz9s9h for ; Thu, 24 Jan 2019 18:48:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MxP+RoDMpAFo9I79tLm1E+nhdrBRbr+a33rMDYi370A=; b=laRtBiHBGc01BkhxxvoCFdPo3l 2JaT+BktG9ZPdj9h9w/6JWIBlSCpWSzcY4nwa29jj0xBvVf4z8rT5ZgRNm+/lJ1J72BC2d+JpItVc TzBPQrn1wIhMmtnNmM05Cal0PRie3VWrkzhTZUBoY1JzJZsWns7OfGhvFw4s5A7mZXS05pDc3vzNW dtlNZBFzZ5tlXcAfKGxjLEL5tSCXEfrbc5hMCjRpq+EDKA/rkAVdf4aN3Op76LyEOijDWktojVNVY 8w+KX3S1vDpjT6llH7JAuhPNf5D0zkAEDUQ1Xx7Ij70BGMRsDaG9niVTeiJRkobLvFYZt3w4u/oac RwptfadQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkG-0006xw-QU; Thu, 24 Jan 2019 07:48:16 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjM-00064E-Qz for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 07:47:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yf/iFKZSnnt3s7zwzmqgy31hOn7+52KnCIV+f3X6gX8=; b=I00fSQqUyBWErouRgqoByW/Bg tjHpKVsZjYwHLlCwp4JmWtSvBLNt0+9QxBqIRtUJBnKu3lmNXzibqUoL7JcaItUlht2s4es9fx/jo n7w8tvIUxTHK0WOyt8TDQvrRLlguh91myp3ioLZ3veoGRjny3G71klqpZQMIx7MKD0px7EIRzkPJ9 ZdYFaHysh4an50R+P+UJbcuY/ZmlgUo+2kychJqfXYD5ZTvMgp9XIH/ark4L4WDCN01vV2e3wYAtW 4U3O+4ivxZ8iaJqlx2yoTgJUW7NM99ZIyh/UfHv2Dup5qgtgVgyX+2nnD/8Y0lMixWN3/Grwss3cf SVnktTrvA==; Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjJ-0006bM-KO for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:18 +0000 Received: by mail-pf1-x42f.google.com with SMTP id q1so2587556pfi.5 for ; Wed, 23 Jan 2019 23:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yf/iFKZSnnt3s7zwzmqgy31hOn7+52KnCIV+f3X6gX8=; b=qigprIwEKLQY2B2kNdxMBgBF8GTtZmonC6ZSNmdJ+2/MUmA0Uoh1vtDu99b/vSQQDX /BlHZzCSaI4UMhlt68nK0Zp+Q2z0DI3pqwX9ooF6kS8+peg/bjqOWh4tnrYmybb9F5oF l4Kbh/JNF7cS5JW/axiLFGuSdml6nSmt5msuQY6Dkb6QZsRDS/isBrZd7gw66e+HsLGS WsuvgfMLHqgl+NNYG2OSShTDc8uH9IkmX1K4dp650ML8cyqBV2NYjGi1kfQb+VVi0EbW 983lSaztt9OXjzmZEY3rO02manfRFpRfggQ3E6VSf63PBjrwN5Vm5SCVtwQ+gG+SIkFI 2/mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yf/iFKZSnnt3s7zwzmqgy31hOn7+52KnCIV+f3X6gX8=; b=Ps0USog42+xCsowGpNRuwxBSrjwS1LsvvBJrLj8jIRQfQcVQqgagWWBZUdmpigcTSR sXErNqiyXnmRCzQ3WgMzpXV+yb4mZkhrcJVoZbFIVAmTvzJfrdvzw6F7n9q0NiJz37E8 XhGC8kx9ALtT9EIYROLfibVt3FEljCSAPm28St9+ErrnS4WFgr7D2Pt6Y9CJF0tGi53O Vu8WfX8ng/FZ1ubC1DB79vUBL+xj40kiwO+8Sj46qR2NJcUIGrGmbe5fw75YQkVPMNu3 gTYHi4N3lxq3/5yeh4gBVH3kZYDECmxP+rbX/W3j5BqGJcVHOx00E406hNqOxjPQVBGF yfjg== X-Gm-Message-State: AJcUuket/6k1Lf/90Wn0BAIRi9/C66wxPZmWGOxAlnEWPbSoNa2ePFZ2 XirM4U7sfPavDqWjqc3RZBgOp6ER X-Google-Smtp-Source: ALg8bN5EvrbVoab8UzTzV7zXoCCHGBVaU3vnwPq3rBpzWur1hXTMEM7lT2WhXqnea5OKE5ID2jLbIA== X-Received: by 2002:a62:1a91:: with SMTP id a139mr5643922pfa.64.1548316031576; Wed, 23 Jan 2019 23:47:11 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:10 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 16/50] tests: Modify ap_ft test sets for python3 Date: Thu, 24 Jan 2019 16:45:56 +0900 Message-Id: <20190124074630.4192-17-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024717_779628_6C5BE2E0 X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42f listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_ft.py | 86 +++++++++++++++++++------------------- tests/hwsim/test_ap_psk.py | 7 +++- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index c1c46655e..e9bbff489 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -753,22 +753,22 @@ def test_ap_ft_over_ds_unexpected(dev, apdev): hapd1ap.mgmt_tx(msg) logger.info("No R0KH-ID subelem in FTIE") - snonce = binascii.hexlify(req['payload'][111:111+32]) + snonce = binascii.hexlify(req['payload'][111:111+32]).decode() msg['payload'] = binascii.unhexlify("0602" + addrs + "00003603a1b20137520000" + "00000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + snonce) hapd1ap.mgmt_tx(msg) logger.info("No R0KH-ID subelem mismatch in FTIE") - snonce = binascii.hexlify(req['payload'][111:111+32]) + snonce = binascii.hexlify(req['payload'][111:111+32]).decode() msg['payload'] = binascii.unhexlify("0602" + addrs + "00003603a1b201375e0000" + "00000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + snonce + "030a11223344556677889900") hapd1ap.mgmt_tx(msg) logger.info("No R1KH-ID subelem in FTIE") - r0khid = binascii.hexlify(req['payload'][145:145+10]) + r0khid = binascii.hexlify(req['payload'][145:145+10]).decode() msg['payload'] = binascii.unhexlify("0602" + addrs + "00003603a1b201375e0000" + "00000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + snonce + "030a" + r0khid) hapd1ap.mgmt_tx(msg) logger.info("No RSNE") - r0khid = binascii.hexlify(req['payload'][145:145+10]) + r0khid = binascii.hexlify(req['payload'][145:145+10]).decode() msg['payload'] = binascii.unhexlify("0602" + addrs + "00003603a1b20137660000" + "00000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + snonce + "030a" + r0khid + "0106000102030405") hapd1ap.mgmt_tx(msg) @@ -2061,82 +2061,82 @@ def test_ap_ft_rrb(dev, apdev): _dst_ll = binascii.unhexlify(apdev[0]['bssid'].replace(':','')) _src_ll = binascii.unhexlify(dev[0].own_addr().replace(':','')) - proto = '\x89\x0d' + proto = b'\x89\x0d' ehdr = _dst_ll + _src_ll + proto # Too short RRB frame - pkt = ehdr + '\x01' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # RRB discarded frame wikth unrecognized type - pkt = ehdr + '\x02' + '\x02' + '\x01\x00' + _src_ll - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x02' + b'\x02' + b'\x01\x00' + _src_ll + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # RRB frame too short for action frame - pkt = ehdr + '\x01' + '\x02' + '\x01\x00' + _src_ll - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x02' + b'\x01\x00' + _src_ll + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Too short RRB frame (not enough room for Action Frame body) - pkt = ehdr + '\x01' + '\x02' + '\x00\x00' + _src_ll - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x02' + b'\x00\x00' + _src_ll + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Unexpected Action frame category - pkt = ehdr + '\x01' + '\x02' + '\x0e\x00' + _src_ll + '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x02' + b'\x0e\x00' + _src_ll + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Unexpected Action in RRB Request - pkt = ehdr + '\x01' + '\x00' + '\x0e\x00' + _src_ll + '\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x00' + b'\x0e\x00' + _src_ll + b'\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Target AP address in RRB Request does not match with own address - pkt = ehdr + '\x01' + '\x00' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x00' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Not enough room for status code in RRB Response - pkt = ehdr + '\x01' + '\x01' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x01' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # RRB discarded frame with unknown packet_type - pkt = ehdr + '\x01' + '\x02' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x02' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # RRB Response with non-zero status code; no STA match - pkt = ehdr + '\x01' + '\x01' + '\x10\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + '\xff\xff' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x01' + b'\x10\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\xff\xff' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # RRB Response with zero status code and extra data; STA match - pkt = ehdr + '\x01' + '\x01' + '\x11\x00' + _src_ll + '\x06\x01' + _src_ll + '\x00\x00\x00\x00\x00\x00' + '\x00\x00' + '\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\x01' + b'\x11\x00' + _src_ll + b'\x06\x01' + _src_ll + b'\x00\x00\x00\x00\x00\x00' + b'\x00\x00' + b'\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Too short PMK-R1 pull - pkt = ehdr + '\x01' + '\xc8' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\xc8' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Too short PMK-R1 resp - pkt = ehdr + '\x01' + '\xc9' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\xc9' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Too short PMK-R1 push - pkt = ehdr + '\x01' + '\xca' + '\x0e\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\xca' + b'\x0e\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # No matching R0KH address found for PMK-R0 pull response - pkt = ehdr + '\x01' + '\xc9' + '\x5a\x00' + _src_ll + '\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + 76*'\00' - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + pkt = ehdr + b'\x01' + b'\xc9' + b'\x5a\x00' + _src_ll + b'\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + 76 * b'\00' + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") @remote_compatible @@ -2348,7 +2348,7 @@ def test_ap_ft_ric(dev, apdev): dev[0].dump_monitor() def ie_hex(ies, id): - return binascii.hexlify(struct.pack('BB', id, len(ies[id])) + ies[id]) + return binascii.hexlify(struct.pack('BB', id, len(ies[id])) + ies[id]).decode() def test_ap_ft_reassoc_proto(dev, apdev): """WPA2-PSK-FT AP Reassociation Request frame parsing""" @@ -2375,7 +2375,7 @@ def test_ap_ft_reassoc_proto(dev, apdev): while True: req = hapd2ap.mgmt_rx() - hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) if req['subtype'] == 11: break @@ -2383,10 +2383,10 @@ def test_ap_ft_reassoc_proto(dev, apdev): req = hapd2ap.mgmt_rx() if req['subtype'] == 2: break - hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) # IEEE 802.11 header + fixed fields before IEs - hdr = binascii.hexlify(req['frame'][0:34]) + hdr = binascii.hexlify(req['frame'][0:34]).decode() ies = parse_ie(binascii.hexlify(req['frame'][34:])) # First elements: SSID, Supported Rates, Extended Supported Rates ies1 = ie_hex(ies, 0) + ie_hex(ies, 1) + ie_hex(ies, 50) @@ -2417,9 +2417,9 @@ def test_ap_ft_reassoc_proto(dev, apdev): # FT: R0KH-ID in FTIE did not match with the current R0KH-ID tests += [ rsne + mde + "3755" + fte[4:168] + "0301ff" ] # FT: No R1KH-ID subelem in FTIE - tests += [ rsne + mde + "375e" + fte[4:168] + "030a" + "nas1.w1.fi".encode("hex") ] + tests += [ rsne + mde + "375e" + fte[4:168] + "030a" + binascii.hexlify("nas1.w1.fi".encode()).decode() ] # FT: Unknown R1KH-ID used in ReassocReq - tests += [ rsne + mde + "3766" + fte[4:168] + "030a" + "nas1.w1.fi".encode("hex") + "0106000000000000" ] + tests += [ rsne + mde + "3766" + fte[4:168] + "030a" + binascii.hexlify("nas1.w1.fi".encode()).decode() + "0106000000000000" ] # FT: PMKID in Reassoc Req did not match with the PMKR1Name derived from auth request tests += [ rsne[:-32] + 16*"00" + mde + fte ] # Invalid MIC in FTIE @@ -2487,7 +2487,7 @@ def test_ap_ft_reassoc_replay(dev, apdev, params): req = hapd2ap.mgmt_rx() count += 1 hapd2ap.dump_monitor() - hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) if req['subtype'] == 2: reassocreq = req ev = hapd2ap.wait_event(["MGMT-TX-STATUS"], timeout=5) @@ -2509,7 +2509,7 @@ def test_ap_ft_reassoc_replay(dev, apdev, params): logger.info("Replay the last Reassociation Request frame") hapd2ap.dump_monitor() hapd2ap.set("ext_mgmt_frame_handling", "1") - hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd2ap.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) ev = hapd2ap.wait_event(["MGMT-TX-STATUS"], timeout=5) if ev is None: raise Exception("No TX status seen") diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 69519a767..d22112d00 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -2255,7 +2255,12 @@ def read_process_memory(pid, key=None): mem.seek(start) data = mem.read(end - start) buf += data - if key and key in binascii.hexlify(data).decode(): + if key == None: + continue + converted_key = key + if not type(key) == bytes: + converted_key = binascii.unhexlify(key) + if converted_key in data: logger.info("Key found in " + l) logger.info("Total process memory read: %d bytes" % len(buf)) return buf From patchwork Thu Jan 24 07:45:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eH08I4Ju"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rEpJWlXC"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ8M4Ngqz9s9h for ; Thu, 24 Jan 2019 18:50:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NCmHV5b2G+iJfxk1EOc5fiGQKJGO6cmyePbwz/tEzLI=; b=eH08I4Ju7bMeDGQyxWnN2oKFSa NWalelP9vStRZioUS8UXwaqya6nxjNKyv/t0mVwu6o6FOkj1BUGcXb/nrs5NUSNejpLvILaDnaoAL f8rH3hNH+78g43n/M1kO7J2kjFjM5E7IN0trchk2ei2MBDprwhk0+aDMzv88XvnJHblj6aJSDaK4k 7Q4j78txwhmo9OgcupPDeuTu7LlOJseEt2KbcAKdfq6RfdV6nEEF+RlopTVrrPuuHwQm0ww0nw9Or TFAbaz772VPY6aad+uoc+k/Cz7TZ6yjlOZ74t+EvzX19Ppx0pB/SrEg5qYPHqc5XywXTHVpF9/tIH joFSjX3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZmP-0001wR-Rv; Thu, 24 Jan 2019 07:50:30 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjH-00060Q-1v for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:57 +0000 Received: by mail-pl1-x642.google.com with SMTP id u6so2510368plm.8 for ; Wed, 23 Jan 2019 23:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wZGNIvQt2lmGpBAvc2pexzqqifWxKmlo3+vEdSfc6tI=; b=rEpJWlXCUoMHXmh9D36grHAqLq3O2kK5S1jypo70WlnOBfGnByhor6EEvEHdzV72PP smlg4xlq6Q3y14pB1Yl7FiKarJn18pfG6hxeM1NWqOKYBSjvbfqWg2Ne53d98XtPZnV8 e2VQC1TvNafh5pSx2+9twXsCgFLf21jZF8yE2Xc55wEzDCKA+Gq/gig4b3JrPhy1qxxe +W0pme0XzuqCLvgq8CVhLfxXIJ6pisfZ3Mrej8vTGmS5JWGo9/mh9/cOPIusp7go2Cpl RW9VyFkZwxeA+f8o0bkSoCKG0IwcjybEW57dk56RnWO4CPVg2iWZeL0QiYv72qSFCqrN 78uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wZGNIvQt2lmGpBAvc2pexzqqifWxKmlo3+vEdSfc6tI=; b=cT6iloP4ftkD4ywHGdFF8HeVWxaXh5Au8q8TkDA/OmZmMBbqzKof+LECXKq6gYY0a3 /8WQ2s9YAPKgK8mOMHE+uHPC0RS2e64Izb7kgZopC3V/xlQl+AZJivnu1bXj4zMs87yC LsQlm+wDbgozrI/zB88hFmv3PIf31BVdmLFfip21ayrk2J8FlU1MoSOLgUji6afw4Vo5 VVRSM7hwdMBwmz6/dqfu0jQeNvAAlpioU7EQDTkq+zc0LdfdgmjFfv5T0lysAbp4rsiW koNjABGUiv/+1tn56t5z2CxUYypLOvaaJ0rS8huCf2l/fJ43C6tmMZBNVJVRwCcqTFBR yDYQ== X-Gm-Message-State: AJcUukc6abBiWocxNN/cXrNzqaTumNsNfhAcIqhRGiaGoOW9FhMHMSxe NX9a5e0ygcEtDEArAkdeZHjHk6c8 X-Google-Smtp-Source: ALg8bN7tWTP4MeRyTLSkNRhjgpi5ILBqdH5+8wejmQwu+r0Btz5aK30hS+GK/IZu8vOKLbQBXIAxAQ== X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr5294891plb.6.1548316033377; Wed, 23 Jan 2019 23:47:13 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:12 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 17/50] tests: Modify ap_hs20 test sets for python3 Date: Thu, 24 Jan 2019 16:45:57 +0900 Message-Id: <20190124074630.4192-18-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234715_729141_DE2EB171 X-CRM114-Status: GOOD ( 11.66 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_hs20.py | 189 ++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 6aef83a8a..e18fe9b20 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -351,13 +351,13 @@ def test_ap_nai_home_realm_query(dev, apdev): if len(nai1) >= len(nai2): raise Exception("Unexpected NAI Realm list response lengths") - if "example.com".encode('hex') not in nai1: + if binascii.hexlify("example.com".encode()).decode() not in nai1: raise Exception("Home realm not reported") - if "example.org".encode('hex') in nai1: + if binascii.hexlify("example.org".encode()).decode() in nai1: raise Exception("Non-home realm reported") - if "example.com".encode('hex') not in nai2: + if binascii.hexlify("example.com".encode()).decode() not in nai2: raise Exception("Home realm not reported in wildcard query") - if "example.org".encode('hex') not in nai2: + if binascii.hexlify("example.org".encode()).decode() not in nai2: raise Exception("Non-home realm not reported in wildcard query ") cmds = [ "foo", @@ -1586,7 +1586,7 @@ def test_ap_hs20_disallow_aps(dev, apdev): dev[0].scan_for_bss(bssid, freq="2412") logger.info("Verify disallow_aps bssid") - dev[0].request("SET disallow_aps bssid " + bssid.translate(None, ':')) + dev[0].request("SET disallow_aps bssid " + bssid.replace(':', '')) dev[0].request("INTERWORKING_SELECT auto") ev = dev[0].wait_event(["INTERWORKING-NO-MATCH"], timeout=15) if ev is None: @@ -1605,7 +1605,7 @@ def test_ap_hs20_disallow_aps(dev, apdev): dev[0].request("SET disallow_aps ") interworking_select(dev[0], bssid, "home", freq="2412") - dev[0].request("SET disallow_aps bssid " + bssid.translate(None, ':')) + dev[0].request("SET disallow_aps bssid " + bssid.replace(':', '')) ret = dev[0].request("INTERWORKING_CONNECT " + bssid) if "FAIL" not in ret: raise Exception("INTERWORKING_CONNECT to disallowed BSS not rejected") @@ -2923,8 +2923,8 @@ def test_ap_hs20_fetch_osu(dev, apdev): params['osu_server_uri'] = "https://example.org/osu/" hostapd.add_ap(apdev[1], params) - with open("w1fi_logo.png", "r") as f: - orig_logo = f.read() + with open("w1fi_logo.png", "rb") as f: + orig_logo = f.read(os.path.getsize("w1fi_logo.png")) dev[0].hs20_enable() dir = "/tmp/osu-fetch" if os.path.isdir(dir): @@ -2956,8 +2956,9 @@ def test_ap_hs20_fetch_osu(dev, apdev): if "OSU provider fetch completed" in ev: break if "RX-HS20-ANQP-ICON" in ev: - with open(ev.split(' ')[1], "r") as f: - logo = f.read() + file_path = ev.split(' ')[1] + with open(file_path, "rb") as f: + logo = f.read(os.path.getsize(file_path)) if logo == orig_logo: icons += 1 @@ -3011,7 +3012,7 @@ def test_ap_hs20_fetch_osu(dev, apdev): raise Exception("GET_HS20_ICON with too many output bytes to fit the buffer succeeded") if "FAIL" not in dev[2].request("GET_HS20_ICON " + bssid + " w1fi_logo 0 0"): raise Exception("GET_HS20_ICON 0..0 succeeded") - icon = "" + icon = bytes() pos = 0 while True: if pos > 100000: @@ -3022,10 +3023,10 @@ def test_ap_hs20_fetch_osu(dev, apdev): icon += base64.b64decode(res) pos += 1000 hex = binascii.hexlify(icon) - if not hex.startswith("0009696d6167652f706e677d1d"): + if not hex.startswith(b"0009696d6167652f706e677d1d"): raise Exception("Unexpected beacon binary header: " + hex) - with open('w1fi_logo.png', 'r') as f: - data = f.read() + with open('w1fi_logo.png', 'rb') as f: + data = f.read(os.path.getsize('w1fi_logo.png')) if icon[13:] != data: raise Exception("Unexpected icon data") if len(icon) != int(event_icon_len): @@ -3253,7 +3254,7 @@ def test_ap_hs20_fetch_osu_single_ssid2(dev, apdev): os.rmdir(dir) def get_icon(dev, bssid, iconname): - icon = "" + icon = bytes() pos = 0 while True: if pos > 100000: @@ -3304,13 +3305,13 @@ def run_req_hs20_icon(dev, bssid): hdr, data1 = get_icon(dev[0], bssid, "w1fi_logo") hdr, data2 = get_icon(dev[0], bssid, "test_logo") - with open('w1fi_logo.png', 'r') as f: - data = f.read() + with open('w1fi_logo.png', 'rb') as f: + data = f.read(os.path.getsize('w1fi_logo.png')) if data1 != data: raise Exception("Unexpected icon data (1)") - with open('auth_serv/sha512-server.pem', 'r') as f: - data = f.read() + with open('auth_serv/sha512-server.pem', 'rb') as f: + data = f.read(os.path.getsize('auth_serv/sha512-server.pem')) if data2 != data: raise Exception("Unexpected icon data (2)") @@ -3330,13 +3331,13 @@ def test_ap_hs20_req_operator_icon(dev, apdev): params['operator_icon'] = [ "w1fi_logo", "unknown_logo", "test_logo" ] hostapd.add_ap(apdev[0], params) - value = struct.pack('LBBBB", len(icmp), 0, 0, 0, 58) csum = ip_checksum(pseudo + icmp) return start + csum + end @@ -4362,7 +4363,7 @@ def build_ra(src_ll, ip_src, ip_dst, cur_hop_limit=0, router_lifetime=0, reachable_time=0, retrans_timer=0, opt=None): link_mc = binascii.unhexlify("3333ff000002") _src_ll = binascii.unhexlify(src_ll.replace(':','')) - proto = '\x86\xdd' + proto = b'\x86\xdd' ehdr = link_mc + _src_ll + proto _ip_src = socket.inet_pton(socket.AF_INET6, ip_src) _ip_dst = socket.inet_pton(socket.AF_INET6, ip_dst) @@ -4383,14 +4384,14 @@ def build_ra(src_ll, ip_src, ip_dst, cur_hop_limit=0, router_lifetime=0, def build_ns(src_ll, ip_src, ip_dst, target, opt=None): link_mc = binascii.unhexlify("3333ff000002") _src_ll = binascii.unhexlify(src_ll.replace(':','')) - proto = '\x86\xdd' + proto = b'\x86\xdd' ehdr = link_mc + _src_ll + proto _ip_src = socket.inet_pton(socket.AF_INET6, ip_src) if ip_dst is None: ip_dst = ipv6_solicited_node_mcaddr(target) _ip_dst = socket.inet_pton(socket.AF_INET6, ip_dst) - reserved = '\x00\x00\x00\x00' + reserved = b'\x00\x00\x00\x00' _target = socket.inet_pton(socket.AF_INET6, target) if opt: payload = reserved + _target + opt @@ -4415,17 +4416,17 @@ def send_ns(dev, src_ll=None, target=None, ip_src=None, ip_dst=None, opt=None, cmd = "DATA_TEST_FRAME " if opt is None: - opt = "\x01\x01" + binascii.unhexlify(src_ll.replace(':','')) + opt = b"\x01\x01" + binascii.unhexlify(src_ll.replace(':','')) pkt = build_ns(src_ll=src_ll, ip_src=ip_src, ip_dst=ip_dst, target=target, opt=opt) - if "OK" not in dev.request(cmd + binascii.hexlify(pkt)): + if "OK" not in dev.request(cmd + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") def build_na(src_ll, ip_src, ip_dst, target, opt=None, flags=0): link_mc = binascii.unhexlify("3333ff000002") _src_ll = binascii.unhexlify(src_ll.replace(':','')) - proto = '\x86\xdd' + proto = b'\x86\xdd' ehdr = link_mc + _src_ll + proto _ip_src = socket.inet_pton(socket.AF_INET6, ip_src) _ip_dst = socket.inet_pton(socket.AF_INET6, ip_dst) @@ -4455,7 +4456,7 @@ def send_na(dev, src_ll=None, target=None, ip_src=None, ip_dst=None, opt=None, pkt = build_na(src_ll=src_ll, ip_src=ip_src, ip_dst=ip_dst, target=target, opt=opt) - if "OK" not in dev.request(cmd + binascii.hexlify(pkt)): + if "OK" not in dev.request(cmd + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") def build_dhcp_ack(dst_ll, src_ll, ip_src, ip_dst, yiaddr, chaddr, @@ -4464,42 +4465,42 @@ def build_dhcp_ack(dst_ll, src_ll, ip_src, ip_dst, yiaddr, chaddr, udp_checksum=True): _dst_ll = binascii.unhexlify(dst_ll.replace(':','')) _src_ll = binascii.unhexlify(src_ll.replace(':','')) - proto = '\x08\x00' + proto = b'\x08\x00' ehdr = _dst_ll + _src_ll + proto _ip_src = socket.inet_pton(socket.AF_INET, ip_src) _ip_dst = socket.inet_pton(socket.AF_INET, ip_dst) _subnet_mask = socket.inet_pton(socket.AF_INET, subnet_mask) - _ciaddr = '\x00\x00\x00\x00' + _ciaddr = b'\x00\x00\x00\x00' _yiaddr = socket.inet_pton(socket.AF_INET, yiaddr) - _siaddr = '\x00\x00\x00\x00' - _giaddr = '\x00\x00\x00\x00' + _siaddr = b'\x00\x00\x00\x00' + _giaddr = b'\x00\x00\x00\x00' _chaddr = binascii.unhexlify(chaddr.replace(':','') + "00000000000000000000") payload = struct.pack('>BBBBL3BB', 2, 1, 6, 0, 12345, 0, 0, 0, 0) - payload += _ciaddr + _yiaddr + _siaddr + _giaddr + _chaddr + 192*'\x00' + payload += _ciaddr + _yiaddr + _siaddr + _giaddr + _chaddr + 192 * b'\x00' # magic if wrong_magic: - payload += '\x63\x82\x53\x00' + payload += b'\x63\x82\x53\x00' else: - payload += '\x63\x82\x53\x63' + payload += b'\x63\x82\x53\x63' if truncated_opt: - payload += '\x22\xff\x00' + payload += b'\x22\xff\x00' # Option: DHCP Message Type = ACK - payload += '\x35\x01\x05' + payload += b'\x35\x01\x05' # Pad Option - payload += '\x00' + payload += b'\x00' # Option: Subnet Mask - payload += '\x01\x04' + _subnet_mask + payload += b'\x01\x04' + _subnet_mask # Option: Time Offset payload += struct.pack('>BBL', 2, 4, 0) # End Option - payload += '\xff' + payload += b'\xff' # Pad Option - payload += '\x00\x00\x00\x00' + payload += b'\x00\x00\x00\x00' if no_dhcp: payload = struct.pack('>BBBBL3BB', 2, 1, 6, 0, 12345, 0, 0, 0, 0) - payload += _ciaddr + _yiaddr + _siaddr + _giaddr + _chaddr + 192*'\x00' + payload += _ciaddr + _yiaddr + _siaddr + _giaddr + _chaddr + 192 * b'\x00' if udp_checksum: pseudohdr = _ip_src + _ip_dst + struct.pack('>BBH', 0, 17, @@ -4515,7 +4516,7 @@ def build_dhcp_ack(dst_ll, src_ll, ip_src, ip_dst, yiaddr, chaddr, else: tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) ipv4 = start + csum + _ip_src + _ip_dst @@ -4525,7 +4526,7 @@ def build_arp(dst_ll, src_ll, opcode, sender_mac, sender_ip, target_mac, target_ip): _dst_ll = binascii.unhexlify(dst_ll.replace(':','')) _src_ll = binascii.unhexlify(src_ll.replace(':','')) - proto = '\x08\x06' + proto = b'\x08\x06' ehdr = _dst_ll + _src_ll + proto _sender_mac = binascii.unhexlify(sender_mac.replace(':','')) @@ -4559,12 +4560,12 @@ def send_arp(dev, dst_ll="ff:ff:ff:ff:ff:ff", src_ll=None, opcode=1, pkt = build_arp(dst_ll=dst_ll, src_ll=src_ll, opcode=opcode, sender_mac=sender_mac, sender_ip=sender_ip, target_mac=target_mac, target_ip=target_ip) - if "OK" not in dev.request(cmd + binascii.hexlify(pkt)): + if "OK" not in dev.request(cmd + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") def get_permanent_neighbors(ifname): cmd = subprocess.Popen(['ip', 'nei'], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() return [ line for line in res.splitlines() if "PERMANENT" in line and ifname in line ] @@ -4678,13 +4679,13 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): time.sleep(0.1) brcmd = subprocess.Popen(['brctl', 'show'], stdout=subprocess.PIPE) - res = brcmd.stdout.read() + res = brcmd.stdout.read().decode() brcmd.stdout.close() logger.info("Bridge setup: " + res) brcmd = subprocess.Popen(['brctl', 'showstp', 'ap-br0'], stdout=subprocess.PIPE) - res = brcmd.stdout.read() + res = brcmd.stdout.read().decode() brcmd.stdout.close() logger.info("Bridge showstp: " + res) @@ -4695,28 +4696,28 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): pkt = build_dhcp_ack(dst_ll="ff:ff:ff:ff:ff:ff", src_ll=bssid, ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.124", chaddr=addr0) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Change address and verify unicast pkt = build_dhcp_ack(dst_ll=addr0, src_ll=bssid, ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.123", chaddr=addr0, udp_checksum=False) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Not-associated client MAC address pkt = build_dhcp_ack(dst_ll="ff:ff:ff:ff:ff:ff", src_ll=bssid, ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.125", chaddr="22:33:44:55:66:77") - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # No IP address pkt = build_dhcp_ack(dst_ll=addr1, src_ll=bssid, ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="0.0.0.0", chaddr=addr1) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Zero subnet mask @@ -4724,7 +4725,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.126", chaddr=addr1, subnet_mask="0.0.0.0") - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Truncated option @@ -4732,7 +4733,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.127", chaddr=addr1, truncated_opt=True) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Wrong magic @@ -4740,7 +4741,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.128", chaddr=addr1, wrong_magic=True) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # Wrong IPv4 total length @@ -4748,7 +4749,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.129", chaddr=addr1, force_tot_len=1000) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") # BOOTP @@ -4756,7 +4757,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.129", chaddr=addr1, no_dhcp=True) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") macs = get_bridge_macs("ap-br0") @@ -4873,7 +4874,7 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): if ebtables: cmd = subprocess.Popen(['ebtables', '-L', '--Lc'], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ebtables results:\n" + res) @@ -5024,13 +5025,13 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False): time.sleep(0.1) brcmd = subprocess.Popen(['brctl', 'show'], stdout=subprocess.PIPE) - res = brcmd.stdout.read() + res = brcmd.stdout.read().decode() brcmd.stdout.close() logger.info("Bridge setup: " + res) brcmd = subprocess.Popen(['brctl', 'showstp', 'ap-br0'], stdout=subprocess.PIPE) - res = brcmd.stdout.read() + res = brcmd.stdout.read().decode() brcmd.stdout.close() logger.info("Bridge showstp: " + res) @@ -5038,8 +5039,8 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False): addr1 = dev[1].p2p_interface_addr() addr2 = dev[2].p2p_interface_addr() - src_ll_opt0 = "\x01\x01" + binascii.unhexlify(addr0.replace(':','')) - src_ll_opt1 = "\x01\x01" + binascii.unhexlify(addr1.replace(':','')) + src_ll_opt0 = b"\x01\x01" + binascii.unhexlify(addr0.replace(':','')) + src_ll_opt1 = b"\x01\x01" + binascii.unhexlify(addr1.replace(':','')) # DAD NS send_ns(dev[0], ip_src="::", target="aaaa:bbbb:cccc::2") @@ -5050,13 +5051,13 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False): opt='') # test frame with bogus option send_ns(dev[0], ip_src="aaaa:bbbb:cccc::2", target="aaaa:bbbb:cccc::2", - opt="\x70\x01\x01\x02\x03\x04\x05\x05") + opt=b"\x70\x01\x01\x02\x03\x04\x05\x05") # test frame with truncated source link-layer address option send_ns(dev[0], ip_src="aaaa:bbbb:cccc::2", target="aaaa:bbbb:cccc::2", - opt="\x01\x01\x01\x02\x03\x04") + opt=b"\x01\x01\x01\x02\x03\x04") # test frame with foreign source link-layer address option send_ns(dev[0], ip_src="aaaa:bbbb:cccc::2", target="aaaa:bbbb:cccc::2", - opt="\x01\x01\x01\x02\x03\x04\x05\x06") + opt=b"\x01\x01\x01\x02\x03\x04\x05\x06") send_ns(dev[1], ip_src="aaaa:bbbb:dddd::2", target="aaaa:bbbb:dddd::2") @@ -5130,7 +5131,7 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False): if ebtables: cmd = subprocess.Popen(['ebtables', '-L', '--Lc'], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ebtables results:\n" + res) @@ -5283,16 +5284,16 @@ def run_proxyarp_errors(dev, apdev, params): pkt = build_ra(src_ll=apdev[0]['bssid'], ip_src="aaaa:bbbb:cccc::33", ip_dst="ff01::1") with fail_test(hapd, 1, "x_snoop_mcast_to_ucast_convert_send"): - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") wait_fail_trigger(dev[0], "GET_FAIL") with alloc_fail(hapd, 1, "sta_ip6addr_add"): - src_ll_opt0 = "\x01\x01" + binascii.unhexlify(addr0.replace(':','')) + src_ll_opt0 = b"\x01\x01" + binascii.unhexlify(addr0.replace(':','')) pkt = build_ns(src_ll=addr0, ip_src="aaaa:bbbb:cccc::2", ip_dst="ff02::1:ff00:2", target="aaaa:bbbb:cccc::2", opt=src_ll_opt0) - if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt)): + if "OK" not in dev[0].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") From patchwork Thu Jan 24 07:45:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cdiNuXtU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="DVwuESKE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YcJNoNyj"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZT10pMhz9sBn for ; Thu, 24 Jan 2019 19:05:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JYXh0SKlAFsc/MZLps/jokaYW+oBjYSv3norD29/fss=; b=cdiNuXtUC5a9pjyx+0CijeZrgx 8Yy+gxhEnSha5TCf0XqS6LtM5g5Z8jtu8QWCja/6dxLDH2vZphF7l/9WWOTt8hRDjwEUrFRJTdJx3 oatz/hNQaWMmJB3+U2LmS2NXmMW7VYJZMaYS0pBJvnL9pSfH9h40IBWiZZPmgtTCfWMMQczWwVbAV VgpraMi6zPJM5JiSLAYAem3POc91cRd/egjBlzhxynJi0Zw91t1wgdMTki2kDnwoz+higHdc2AicM pu7jzAkLeOsjtXN8c+wTRxWom7o1GQLsLgh4pUsqLpSavwHHTgfG92rTpvbGvHwNct2zSanFwnJw5 OCv54Rjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzu-0002lJ-1p; Thu, 24 Jan 2019 08:04:26 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyc-0001E8-Di for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:03:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=phzkx2GtBa3tK3qlVaGkBBDMhBW9mmdm0Rwi8/aRAvU=; b=DVwuESKE+IXQ2xzPeAefBja8d lHR91I1rctKpPFx3pSz3MxxcHfZ9VDZPl9dykYjtzI3JsJGdwCUhpupQx5b43RuSo7Jqzwodi+QmL gxV/AfFXG0l+SlVJPwo+W2QQXateDM48MLwX8nDtbvbb3ImWohAan0DMSPVpZl11fItpEqtuj/NAs nu66ud7iPuL1yRYmFCnRSymQvTScnh0yy1LzV9bDxPiKSXeKDBNTtukF5qrh0XjHdC14eN5D/7zP1 Bg8aVDlS9jfh+ZOAMuDcfHV909rCgD6rt+sW0wa5lvk6g/PdVR4+AsgFfkom8c9cbKyKj8NuE4kqD 6CxoySJsw==; Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjK-0001sk-65 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:19 +0000 Received: by mail-pg1-x536.google.com with SMTP id d72so2300482pga.9 for ; Wed, 23 Jan 2019 23:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=phzkx2GtBa3tK3qlVaGkBBDMhBW9mmdm0Rwi8/aRAvU=; b=YcJNoNyjz9hDgzxoaJR9Qojun90SAPGtWVVbYTKnpUfOKzbQpmx0mA/5MV6KQt0379 sH+qNKJwc+FGyv2IKFcR+6W7fYYO3M1FnPgbD2IHwHIXCTLitjSIgZ180p6bHzVrpS8T MgeQEN3MzxEABwvVSjJXf3BNs7aaNRnMHh7KX7lQxSRaoZBsEE/m6QH8vi+Vfo93Akfn DbpaJKeroQtgeysa74SbVz5vVJGp0ok6KLIAlW5coZTETnfMLdHUhnSPBOdIBZDovdz5 HI/VBkPqJAKyHN6FLvCRd9mYmyfovDTlsGLphXJGKcN5lbrvvEKnpHG+4gsRud6envk2 +Ngg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=phzkx2GtBa3tK3qlVaGkBBDMhBW9mmdm0Rwi8/aRAvU=; b=VIOtTcQ0Jz81zmmFrmeuoyQnhNpTziFtg6PLc8qoODOKIgrAHkzrTJcDoOkle5GsI3 BkwnvcO+LUby6pLRlVuM70tliAV+ElRD9R2UAG9F2J6p4OKISOplXdPzjH/0ncRknFFg smRlxEnlEMtoXdEVmzplbjY1ClGm5Z2YHDHmco23P5IuNO/u/PW1pxzoJULpfiEAntD/ bBzCH7dvtebQHhjdF1CgiyxHyAzpAo7/IxUfyRiWbOCH+zYUtvsoUyEOnl2DtV5Sp0ny P6G4lIzdW6KS805asU4QqtjNZcVZ4ANjffrjB2k0TL69Rj17doogKk0F5Vf0TAAoBSWy 0urg== X-Gm-Message-State: AJcUuke+CdJD8817zYo6dBKsLeWtU9T1qB8Id/URE1Za72/c6k4kRQjJ VZT0IOX2n8a0ezIp01xDYDPBh6r4 X-Google-Smtp-Source: ALg8bN4qyum9bg0v2W9RaSV3XvBK8baNV4I6OiPzhnNNeWf/WGNFLshOP1GsQNujNaGRUTfdGJmkwg== X-Received: by 2002:a63:4e41:: with SMTP id o1mr5112028pgl.282.1548316035038; Wed, 23 Jan 2019 23:47:15 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:14 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 18/50] tests: Modify ap_psk test sets for python3 Date: Thu, 24 Jan 2019 16:45:58 +0900 Message-Id: <20190124074630.4192-19-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074718_229168_5623C094 X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:536 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_psk.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index d22112d00..3078658c1 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -1144,16 +1144,19 @@ def build_eapol(msg): data += msg['rsn_key_id'] data += msg['rsn_key_mic'] data += struct.pack('>H', msg['rsn_key_data_len']) - data += msg['rsn_key_data'] + if type(msg['rsn_key_data']) == bytes: + data += msg['rsn_key_data'] + else: + data += msg['rsn_key_data'].encode() else: data += msg['payload'] return data def sha1_prf(key, label, data, outlen): - res = '' + res = bytes() counter = 0 while outlen > 0: - m = hmac.new(key, label, hashlib.sha1) + m = hmac.new(key, label.encode(), hashlib.sha1) m.update(struct.pack('B', 0)) m.update(data) m.update(struct.pack('B', counter)) @@ -1212,7 +1215,7 @@ def recv_eapol(hapd): return parse_eapol(eapol) def send_eapol(hapd, addr, data): - res = hapd.request("EAPOL_RX " + addr + " " + binascii.hexlify(data)) + res = hapd.request("EAPOL_RX " + addr + " " + binascii.hexlify(data).decode()) if "OK" not in res: raise Exception("EAPOL_RX to hostapd failed") @@ -1522,24 +1525,31 @@ def build_eapol_key_3_4(anonce, kck, key_data, replay_counter=2, return msg def aes_wrap(kek, plain): - n = len(plain) / 8 + n = int(len(plain) / 8) a = 0xa6a6a6a6a6a6a6a6 enc = AES.new(kek).encrypt r = [plain[i * 8:(i + 1) * 8] for i in range(0, n)] for j in range(6): for i in range(1, n + 1): - b = enc(struct.pack('>Q', a) + r[i - 1]) + if type(r[i - 1]) == bytes: + value = r[i - 1] + else: + value = r[i - 1].encode() + b = enc(struct.pack('>Q', a) + value) a = struct.unpack('>Q', b[:8])[0] ^ (n * j + i) r[i - 1] =b[8:] - return struct.pack('>Q', a) + ''.join(r) + ret = bytes() + for elem in r: + ret = ret + elem + return struct.pack('>Q', a) + ret def pad_key_data(plain): pad_len = len(plain) % 8 if pad_len: pad_len = 8 - pad_len - plain += '\xdd' + plain += b'\xdd' pad_len -= 1 - plain += pad_len * '\0' + plain += pad_len * b'\x00' return plain def test_ap_wpa2_psk_supp_proto(dev, apdev): From patchwork Thu Jan 24 07:45:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030384 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L4/PtLfQ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RR/pVoV1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lcxR1V4Sz9s55 for ; Thu, 24 Jan 2019 20:56:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VM7DxkUBWgSe9ct04qwSojxIRApDQty6JrkOxvpqjkU=; b=L4/PtLfQ1WGfZgSytDeR9MAs37 bIAi9M/X6V5lGW0To9EDaGtZfPNdU7rPZsKDOSqohaYTQDN7Ys2QSs43g8tzOYbWtO+pT0uunDb9B TVUqzYl7rD7JlpZXwf54JAyZv7mbHJ5SouhajOJt3Zfl5Ekdda3NEytBJZ+93MhNkT8nf2a56rWgK pg/hcaW7zYA5J0/Ro7jyHTxuRbIu/+45/cUZ78dgYEFm9rL5egOUU3iuMlwWqZ90mhjFAdk35Y6BO 4Hq50hLm7JwqSagiMcNq1o0vRn86qE4choTgR2gc9RNJi6l/PC87E4vKaNqyzAcKI89n142nZ0/v5 rvoHdaIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmbk7-0003jj-WE; Thu, 24 Jan 2019 09:56:16 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjM-00064R-3J for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:07 +0000 Received: by mail-pg1-x533.google.com with SMTP id z11so2325411pgu.0 for ; Wed, 23 Jan 2019 23:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nT5r2gDft7pns8AtZ58XpXXRd0bVy7pQ0/eV3rVT2YA=; b=RR/pVoV1Wcrz9mO1vktsg+I2BMkjjK4OocPohkB4/XY+sNDyerVWd7MEw1d4vkaP/3 rLQkWpthefdlAIKCnQ8irwqGXo9IPIP+MDeamft1P/Xf5vCaeO2atUIDiMFnCNmkytC6 ZPNXNmZoMZf6mVyJCE50mlsRmB8h1BsWNeXIBAnYWixeZCZNfFQ8+GkDxFGiqw59LUYv 1edhOc4mB531lksp7CjTRVuxtQKVW1DindJoYhnexRkE9CtrU0AT70U3C6XwVEIKETHd xTn4aStTGCE88rYz9SKwYaLv6hFUm6m9gYDC7gNQsee2T1Lo22A5PN8NTl79N7uIGMHP 5qdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nT5r2gDft7pns8AtZ58XpXXRd0bVy7pQ0/eV3rVT2YA=; b=en/rJgSW7MLc8HNcQgNySeI/5Xx9wQQxlBvxdnSpF1JuOZurpcep8nVypqZ0eSpqbB VRLIishBZwa/ZW8mwI5g7ZKJ+FcOxHH+jcUSUBThaUEy9OF5fWhPEnZYvjKf1fdie7zc kU4sIABpVtcQ8Uc/Q+OS7RwcqZPm2L1b/xVAC0MdH9UWqxVC3OI86MUHfSfbCy4xL0wv uaZT2VLny6heq3lNhkBUkGy1z2NpS3uJiS1IawQqJRLIRgtThZ7PbSscFXJONGaKmQFA XEupWX/D/F9v7b2o8ZaTkoR8eafUEDWxLMzO7fXKeyeHi4NsfHSkbUW0iJaxQ+ap0FkK mw1Q== X-Gm-Message-State: AJcUukdamBdnK4p97yXoC08jfahyP1oBYqtXiUQQsgCyUUlbA2cgsOnC cv+nUnjxmcZk77GNwz0sEyuagJiM X-Google-Smtp-Source: ALg8bN5+p0K8lO0vDd0/My5kclPQXMTUDsddT90ZeoTxcjLXXSCoxhMSm+/C1FDGfvXmeM0F91LbNg== X-Received: by 2002:a65:6684:: with SMTP id b4mr5001184pgw.55.1548316037140; Wed, 23 Jan 2019 23:47:17 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:16 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 19/50] tests: Modify ap_wps test sets for python3 Date: Thu, 24 Jan 2019 16:45:59 +0900 Message-Id: <20190124074630.4192-20-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234720_520691_BF1177F9 X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:533 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) 0.0 NORMAL_HTTP_TO_IP URI: URI host has a public dotted-decimal IPv4 address 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Mailman-Approved-At: Thu, 24 Jan 2019 01:56:15 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_wps.py | 614 ++++++++++++++++++++----------------- 1 file changed, 325 insertions(+), 289 deletions(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index b41a53be9..466c1eeaa 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -12,6 +12,7 @@ import hashlib import hmac import os import time +import sys import stat import subprocess import logging @@ -21,15 +22,14 @@ import socket import struct try: from http.client import HTTPConnection + from urllib.request import urlopen from urllib.parse import urlparse, urljoin from urllib.error import HTTPError - from io import StringIO from socketserver import StreamRequestHandler, TCPServer except ImportError: from httplib import HTTPConnection + from urllib import urlopen from urlparse import urlparse, urljoin - from urllib2 import build_opener, ProxyHandler, HTTPError - from StringIO import StringIO from SocketServer import StreamRequestHandler, TCPServer import urllib import xml.etree.ElementTree as ET @@ -175,7 +175,7 @@ def test_ap_wps_init_through_wps_config(dev, apdev): ssid = "test-wps-init-config" hapd = hostapd.add_ap(apdev[0], { "ssid": ssid, "eap_server": "1", "wps_state": "1" }) - if "FAIL" in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "12345678".encode("hex")): + if "FAIL" in hapd.request("WPS_CONFIG " + binascii.hexlify(ssid.encode()).decode() + " WPA2PSK CCMP " + binascii.hexlify("12345678".encode()).decode()): raise Exception("WPS_CONFIG command failed") ev = hapd.wait_event(["WPS-NEW-AP-SETTINGS"], timeout=5) if ev is None: @@ -198,7 +198,7 @@ def test_ap_wps_init_through_wps_config_2(dev, apdev): hapd = hostapd.add_ap(apdev[0], { "ssid": ssid, "eap_server": "1", "wps_state": "1", "wps_cred_processing": "2" }) - if "FAIL" in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "12345678".encode("hex")): + if "FAIL" in hapd.request("WPS_CONFIG " + binascii.hexlify(ssid.encode()).decode() + " WPA2PSK CCMP " + binascii.hexlify("12345678".encode()).decode()): raise Exception("WPS_CONFIG command failed") ev = hapd.wait_event(["WPS-NEW-AP-SETTINGS"], timeout=5) if ev is None: @@ -212,7 +212,7 @@ def test_ap_wps_invalid_wps_config_passphrase(dev, apdev): ssid = "test-wps-init-config" hapd = hostapd.add_ap(apdev[0], { "ssid": ssid, "eap_server": "1", "wps_state": "1" }) - if "FAIL" not in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "1234567".encode("hex")): + if "FAIL" not in hapd.request("WPS_CONFIG " + binascii.hexlify(ssid.encode()).decode() + " WPA2PSK CCMP " + binascii.hexlify("1234567".encode()).decode()): raise Exception("Invalid WPS_CONFIG command accepted") def test_ap_wps_conf(dev, apdev): @@ -610,13 +610,13 @@ def test_ap_wps_reg_override_ap_settings(dev, apdev): except: pass # Override AP Settings with values that point to another AP - data = build_wsc_attr(ATTR_NETWORK_INDEX, '\x01') - data += build_wsc_attr(ATTR_SSID, "test") - data += build_wsc_attr(ATTR_AUTH_TYPE, '\x00\x01') - data += build_wsc_attr(ATTR_ENCR_TYPE, '\x00\x01') - data += build_wsc_attr(ATTR_NETWORK_KEY, '') + data = build_wsc_attr(ATTR_NETWORK_INDEX, b'\x01') + data += build_wsc_attr(ATTR_SSID, "test".encode()) + data += build_wsc_attr(ATTR_AUTH_TYPE, b'\x00\x01') + data += build_wsc_attr(ATTR_ENCR_TYPE, b'\x00\x01') + data += build_wsc_attr(ATTR_NETWORK_KEY, bytes()) 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) ssid = "test-wps-reg-ap-pin" appin = "12345670" @@ -769,7 +769,7 @@ def test_ap_wps_reg_config_ext_processing(dev, apdev): if "1026" not in ev: raise Exception("AP Settings missing from event") hapd.request("SET wps_cred_processing 0") - if "FAIL" in hapd.request("WPS_CONFIG " + new_ssid.encode("hex") + " WPA2PSK CCMP " + new_passphrase.encode("hex")): + if "FAIL" in hapd.request("WPS_CONFIG " + binascii.hexlify(new_ssid.encode()).decode() + " WPA2PSK CCMP " + binascii.hexlify(new_passphrase.encode()).decode()): raise Exception("WPS_CONFIG command failed") dev[0].wait_connected(timeout=15) @@ -1570,8 +1570,8 @@ def _test_ap_wps_er_config_ap(dev, apdev): raise Exception("Expected AP UUID not found") new_passphrase = "1234567890" dev[0].request("WPS_ER_CONFIG " + apdev[0]['bssid'] + " " + ap_pin + " " + - ssid.encode("hex") + " WPA2PSK CCMP " + - new_passphrase.encode("hex")) + binascii.hexlify(ssid.encode()).decode() + " WPA2PSK CCMP " + + binascii.hexlify(new_passphrase.encode()).decode()) ev = dev[0].wait_event(["WPS-SUCCESS"]) if ev is None: raise Exception("WPS ER configuration operation timed out") @@ -2359,13 +2359,13 @@ def test_ap_wps_pbc_timeout(dev, apdev, params): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urllib.parse.urlparse(urls['event_sub_url']) - ctrlurl = urllib.parse.urlparse(urls['control_url']) + eventurl = urlparse(urls['event_sub_url']) + ctrlurl = urlparse(urls['control_url']) - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(location) + conn = HTTPConnection(url.netloc) - class WPSERHTTPServer(socketserver.StreamRequestHandler): + class WPSERHTTPServer(StreamRequestHandler): def handle(self): data = self.rfile.readline().strip() logger.debug(data) @@ -2484,7 +2484,7 @@ def ssdp_send(msg, no_recv=False): sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2) sock.bind(("127.0.0.1", 0)) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) if no_recv: return None return sock.recv(1000) @@ -2555,7 +2555,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN: "ssdp:discover"', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Negative MX") msg = '\r\n'.join([ @@ -2565,7 +2565,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN: "ssdp:discover"', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Invalid MX") msg = '\r\n'.join([ @@ -2575,7 +2575,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN: "ssdp:discover"', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Missing MAN") msg = '\r\n'.join([ @@ -2584,7 +2584,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Invalid MAN") msg = '\r\n'.join([ @@ -2594,7 +2594,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN: foo', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) msg = '\r\n'.join([ 'M-SEARCH * HTTP/1.1', 'HOST: 239.255.255.250:1900', @@ -2602,7 +2602,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN; "ssdp:discover"', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Missing HOST") msg = '\r\n'.join([ @@ -2611,7 +2611,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Missing ST") msg = '\r\n'.join([ @@ -2620,7 +2620,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MAN: "ssdp:discover"', 'MX: 1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Mismatching ST") msg = '\r\n'.join([ @@ -2630,7 +2630,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: uuid:16d5f8a9-4ee4-4f5e-81f9-cc6e2f47f42d', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) msg = '\r\n'.join([ 'M-SEARCH * HTTP/1.1', 'HOST: 239.255.255.250:1900', @@ -2638,7 +2638,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: foo:bar', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) msg = '\r\n'.join([ 'M-SEARCH * HTTP/1.1', 'HOST: 239.255.255.250:1900', @@ -2646,7 +2646,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: foobar', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Invalid ST") msg = '\r\n'.join([ @@ -2656,7 +2656,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST; urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Invalid M-SEARCH") msg = '\r\n'.join([ @@ -2666,7 +2666,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) msg = '\r\n'.join([ 'M-SEARCH-* HTTP/1.1', 'HOST: 239.255.255.250:1900', @@ -2674,10 +2674,10 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) logger.debug("Invalid message format") - sock.sendto("NOTIFY * HTTP/1.1", ("239.255.255.250", 1900)) + sock.sendto("NOTIFY * HTTP/1.1".encode(), ("239.255.255.250", 1900)) msg = '\r'.join([ 'M-SEARCH * HTTP/1.1', 'HOST: 239.255.255.250:1900', @@ -2685,7 +2685,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) try: r = sock.recv(1000) @@ -2701,7 +2701,7 @@ def test_ap_wps_ssdp_invalid_msearch(dev, apdev): 'MX: 1', 'ST: urn:schemas-wifialliance-org:device:WFADevice:1', '', '']) - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) try: r = sock.recv(1000) @@ -2727,11 +2727,11 @@ def test_ap_wps_ssdp_burst(dev, apdev): sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2) sock.bind(("127.0.0.1", 0)) for i in range(0, 25): - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) resp = 0 while True: try: - r = sock.recv(1000) + r = sock.recv(1000).decode() if not r.startswith("HTTP/1.1 200 OK\r\n"): raise Exception("Unexpected message: " + r) resp += 1 @@ -2745,10 +2745,10 @@ def test_ap_wps_ssdp_burst(dev, apdev): sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2) sock.bind(("127.0.0.1", 0)) for i in range(0, 25): - sock.sendto(msg, ("239.255.255.250", 1900)) + sock.sendto(msg.encode(), ("239.255.255.250", 1900)) while True: try: - r = sock.recv(1000) + r = sock.recv(1000).decode() if ap_uuid in r: break except socket.timeout: @@ -2758,6 +2758,7 @@ def ssdp_get_location(uuid): res = ssdp_send_msearch("uuid:" + uuid) location = None for l in res.splitlines(): + l = l.decode() if l.lower().startswith("location:"): location = l.split(':', 1)[1].strip() break @@ -2766,15 +2767,15 @@ def ssdp_get_location(uuid): return location def upnp_get_urls(location): - conn = urllib.urlopen(location, proxies={}) + conn = urlopen(location) tree = ET.parse(conn) root = tree.getroot() urn = '{urn:schemas-upnp-org:device-1-0}' service = root.find("./" + urn + "device/" + urn + "serviceList/" + urn + "service") res = {} - res['scpd_url'] = urllib.parse.urljoin(location, service.find(urn + 'SCPDURL').text) - res['control_url'] = urllib.parse.urljoin(location, service.find(urn + 'controlURL').text) - res['event_sub_url'] = urllib.parse.urljoin(location, service.find(urn + 'eventSubURL').text) + res['scpd_url'] = urljoin(location, service.find(urn + 'SCPDURL').text) + res['control_url'] = urljoin(location, service.find(urn + 'controlURL').text) + res['event_sub_url'] = urljoin(location, service.find(urn + 'eventSubURL').text) return res def upnp_soap_action(conn, path, action, include_soap_action=True, @@ -2791,23 +2792,19 @@ def upnp_soap_action(conn, path, action, include_soap_action=True, act = ET.SubElement(body, "{%s}%s" % (wpsns, action)) if newmsg: msg = ET.SubElement(act, "NewMessage") - msg.text = base64.b64encode(newmsg) + msg.text = base64.b64encode(newmsg.encode()).decode() if neweventtype: msg = ET.SubElement(act, "NewWLANEventType") msg.text = neweventtype if neweventmac: msg = ET.SubElement(act, "NewWLANEventMAC") msg.text = neweventmac - tree = ET.ElementTree(root) - soap = io.StringIO() - tree.write(soap, xml_declaration=True, encoding='utf-8') - headers = { "Content-type": 'text/xml; charset="utf-8"' } if include_soap_action: headers["SOAPAction"] = '"urn:schemas-wifialliance-org:service:WFAWLANConfig:1#%s"' % action elif soap_action_override: headers["SOAPAction"] = soap_action_override - conn.request("POST", path, soap.getvalue(), headers) + conn.request("POST", path, ET.tostring(root), headers) return conn.getresponse() def test_ap_wps_upnp(dev, apdev): @@ -2818,16 +2815,23 @@ def test_ap_wps_upnp(dev, apdev): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - conn = urllib.urlopen(urls['scpd_url'], proxies={}) + conn = urlopen(urls['scpd_url']) scpd = conn.read() - conn = urllib.urlopen(urllib.parse.urljoin(location, "unknown.html"), - proxies={}) - if conn.getcode() != 404: - raise Exception("Unexpected HTTP response to GET unknown URL") + if sys.version_info[0] > 2: + try: + conn = urlopen(urljoin(location, "unknown.html")) + raise Exception("Unexpected HTTP response to GET unknown URL") + except HTTPError as e: + if e.code != 404: + raise Exception("Unexpected HTTP response to GET unknown URL") + else: + conn = urlopen(urljoin(location, "unknown.html"), proxies={}) + if conn.getcode() != 404: + raise Exception("Unexpected HTTP response to GET unknown URL") - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(location) + conn = HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "Content-type": 'text/xml; charset="utf-8"', "SOAPAction": '"urn:schemas-wifialliance-org:service:WFAWLANConfig:1#GetDeviceInfo"' } @@ -2843,7 +2847,7 @@ def test_ap_wps_upnp(dev, apdev): headers = { "Content-type": 'text/xml; charset="utf-8"', "SOAPAction": '"urn:some-unknown-action#GetDeviceInfo"' } - ctrlurl = urllib.parse.urlparse(urls['control_url']) + ctrlurl = urlparse(urls['control_url']) conn.request("POST", ctrlurl.path, "\r\n\r\n", headers) resp = conn.getresponse() if resp.status != 401: @@ -2869,7 +2873,7 @@ def test_ap_wps_upnp(dev, apdev): resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") if resp.status != 200: raise Exception("Unexpected HTTP response: %d" % resp.status) - dev = resp.read() + dev = resp.read().decode() if "NewDeviceInfo" not in dev: raise Exception("Unexpected GetDeviceInfo response") @@ -2900,10 +2904,10 @@ def test_ap_wps_upnp_subscribe(dev, apdev): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urllib.parse.urlparse(urls['event_sub_url']) + eventurl = urlparse(urls['event_sub_url']) - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(location) + conn = HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "callback": '', "timeout": "Second-1234" } @@ -3249,9 +3253,9 @@ def test_ap_wps_upnp_subscribe_events(dev, apdev): location = ssdp_get_location(ap_uuid) urls = upnp_get_urls(location) - eventurl = urllib.parse.urlparse(urls['event_sub_url']) + eventurl = urlparse(urls['event_sub_url']) - class WPSERHTTPServer(socketserver.StreamRequestHandler): + class WPSERHTTPServer(StreamRequestHandler): def handle(self): data = self.rfile.readline().strip() logger.debug(data) @@ -3260,8 +3264,8 @@ def test_ap_wps_upnp_subscribe_events(dev, apdev): server = MyTCPServer(("127.0.0.1", 12345), WPSERHTTPServer) server.timeout = 1 - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(location) + conn = HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", @@ -3316,8 +3320,8 @@ def test_ap_wps_upnp_http_proto(dev, apdev): location = ssdp_get_location(ap_uuid) - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc, timeout=0.2) + url = urlparse(location) + conn = HTTPConnection(url.netloc, timeout=0.2) #conn.set_debuglevel(1) conn.request("HEAD", "hello") @@ -3415,8 +3419,8 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): location = ssdp_get_location(ap_uuid) - url = urllib.parse.urlparse(location) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(location) + conn = HTTPConnection(url.netloc) #conn.set_debuglevel(1) headers = { "Transfer-Encoding": 'chunked' } @@ -3431,10 +3435,10 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): conn.putrequest("POST", "hello") conn.putheader('Transfer-Encoding', 'chunked') conn.endheaders() - conn.send("a\r\nabcdefghij\r\n") + conn.send("a\r\nabcdefghij\r\n".encode()) time.sleep(0.1) - conn.send("2\r\nkl\r\n") - conn.send("0\r\n\r\n") + conn.send("2\r\nkl\r\n".encode()) + conn.send("0\r\n\r\n".encode()) resp = conn.getresponse() if resp.status != 404: raise Exception("Unexpected HTTP response: %d" % resp.status) @@ -3446,8 +3450,8 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev): completed = False try: for i in range(20000): - conn.send("1\r\nZ\r\n") - conn.send("0\r\n\r\n") + conn.send("1\r\nZ\r\n".encode()) + conn.send("0\r\n\r\n".encode()) resp = conn.getresponse() completed = True except Exception as e: @@ -3902,7 +3906,7 @@ def test_ap_wps_wpa_cli_action(dev, apdev, test_params): arg = [ 'ps', 'ax' ] cmd = subprocess.Popen(arg, stdout=subprocess.PIPE) - out = cmd.communicate()[0] + out = cmd.communicate()[0].decode() cmd.wait() logger.debug("Processes:\n" + out) if "wpa_cli -P %s -B -i %s" % (pidfile, dev[0].ifname) not in out: @@ -3928,7 +3932,7 @@ def test_ap_wps_wpa_cli_action(dev, apdev, test_params): arg = [ 'ps', 'ax' ] cmd = subprocess.Popen(arg, stdout=subprocess.PIPE) - out = cmd.communicate()[0] + out = cmd.communicate()[0].decode() cmd.wait() logger.debug("Remaining processes:\n" + out) if "wpa_cli -P %s -B -i %s" % (pidfile, dev[0].ifname) in out: @@ -3954,49 +3958,51 @@ def _test_ap_wps_er_ssdp_proto(dev, apdev): if "OK" not in dev[0].request("WPS_ER_START ifname=lo 1.2.3.4"): raise Exception("WPS_ER_START with filter failed") (msg,addr) = sock.recvfrom(1000) + msg = msg.decode() logger.debug("Received SSDP message from %s: %s" % (str(addr), msg)) if "M-SEARCH" not in msg: raise Exception("Not an M-SEARCH") - sock.sendto("FOO", addr) + sock.sendto("FOO".encode(), addr) time.sleep(0.1) dev[0].request("WPS_ER_STOP") dev[0].request("WPS_ER_START ifname=lo") (msg,addr) = sock.recvfrom(1000) + msg = msg.decode() logger.debug("Received SSDP message from %s: %s" % (str(addr), msg)) if "M-SEARCH" not in msg: raise Exception("Not an M-SEARCH") - sock.sendto("FOO", addr) - sock.sendto("HTTP/1.1 200 OK\r\nFOO\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nNTS:foo\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nNTS:ssdp:byebye\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\ncache-control: foo=1\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\ncache-control: max-age=1\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nusn:\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nusn:foo\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid:\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid: \r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid: foo\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nNTS:ssdp:byebye\r\n\r\n", addr) - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\n\r\n", addr) + sock.sendto("FOO".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nFOO\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nNTS:foo\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nNTS:ssdp:byebye\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\ncache-control: foo=1\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\ncache-control: max-age=1\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nusn:\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nusn:foo\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid:\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid: \r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nusn: uuid: foo\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nNTS:ssdp:byebye\r\n\r\n".encode(), addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\n\r\n".encode(), addr) with alloc_fail(dev[0], 1, "wps_er_ap_add"): - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n", addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n".encode(), addr) time.sleep(0.1) with alloc_fail(dev[0], 2, "wps_er_ap_add"): - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n", addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n".encode(), addr) time.sleep(0.1) # Add an AP with bogus URL - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n", addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:foo\r\ncache-control:max-age=1\r\n\r\n".encode(), addr) # Update timeout on AP without updating URL - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:http://127.0.0.1:12345/foo.xml\r\ncache-control:max-age=1\r\n\r\n", addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:http://127.0.0.1:12345/foo.xml\r\ncache-control:max-age=1\r\n\r\n".encode(), addr) ev = dev[0].wait_event(["WPS-ER-AP-REMOVE"], timeout=5) if ev is None: raise Exception("No WPS-ER-AP-REMOVE event on max-age timeout") # Add an AP with a valid URL (but no server listing to it) - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:http://127.0.0.1:12345/foo.xml\r\ncache-control:max-age=1\r\n\r\n", addr) + sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:http://127.0.0.1:12345/foo.xml\r\ncache-control:max-age=1\r\n\r\n".encode(), addr) ev = dev[0].wait_event(["WPS-ER-AP-REMOVE"], timeout=5) if ev is None: raise Exception("No WPS-ER-AP-REMOVE event on max-age timeout") @@ -4044,7 +4050,7 @@ def gen_upnp_info(eventSubURL='wps_event', controlURL='wps_control', 'Connection: close\r\n' + \ 'Content-Length: ' + str(len(payload)) + '\r\n' + \ 'Date: Sat, 15 Aug 2015 18:55:08 GMT\r\n\r\n' - return hdr + payload + return (hdr + payload).encode() def gen_wps_control(payload_override=None): payload = ''' @@ -4072,7 +4078,7 @@ AAYANyoAASA= 'Connection: close\r\n' + \ 'Content-Length: ' + str(len(payload)) + '\r\n' + \ 'Date: Sat, 15 Aug 2015 18:55:08 GMT\r\n\r\n' - return hdr + payload + return (hdr + payload).encode() def gen_wps_event(sid='uuid:7eb3342a-8a5f-47fe-a585-0785bfec6d8a'): payload = "" @@ -4085,14 +4091,14 @@ def gen_wps_event(sid='uuid:7eb3342a-8a5f-47fe-a585-0785bfec6d8a'): hdr += 'SID: ' + sid + '\r\n' hdr += 'Timeout: Second-1801\r\n' + \ 'Date: Sat, 15 Aug 2015 18:55:08 GMT\r\n\r\n' - return hdr + payload + return (hdr + payload).encode() class WPSAPHTTPServer(StreamRequestHandler): def handle(self): - data = self.rfile.readline().strip() + data = self.rfile.readline().decode().strip() logger.info("HTTP server received: " + data) while True: - hdr = self.rfile.readline().strip() + hdr = self.rfile.readline().decode().strip() if len(hdr) == 0: break logger.info("HTTP header: " + hdr) @@ -4124,7 +4130,7 @@ class WPSAPHTTPServer(StreamRequestHandler): class MyTCPServer(TCPServer): def __init__(self, addr, handler): self.allow_reuse_address = True - socketserver.TCPServer.__init__(self, addr, handler) + TCPServer.__init__(self, addr, handler) def wps_er_start(dev, http_server, max_age=1, wait_m_search=False, location_url=None): @@ -4135,6 +4141,7 @@ def wps_er_start(dev, http_server, max_age=1, wait_m_search=False, dev.request("WPS_ER_START ifname=lo") for i in range(100): (msg,addr) = sock.recvfrom(1000) + msg = msg.decode() logger.debug("Received SSDP message from %s: %s" % (str(addr), msg)) if "M-SEARCH" in msg: break @@ -4147,7 +4154,7 @@ def wps_er_start(dev, http_server, max_age=1, wait_m_search=False, server = MyTCPServer(("127.0.0.1", 12345), http_server) if not location_url: location_url = 'http://127.0.0.1:12345/foo.xml' - sock.sendto("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:%s\r\ncache-control:max-age=%d\r\n\r\n" % (location_url, max_age), addr) + sock.sendto(("HTTP/1.1 200 OK\r\nST: urn:schemas-wifialliance-org:device:WFADevice:1\r\nlocation:%s\r\ncache-control:max-age=%d\r\n\r\n" % (location_url, max_age)).encode(), addr) server.timeout = 1 return server,sock @@ -4192,13 +4199,13 @@ def run_wps_er_proto_test(dev, handler, no_event_url=False, location_url=None): dev.request("WPS_ER_STOP") def send_wlanevent(url, uuid, data, no_response=False): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) payload = ''' 1 1 ''' - payload += base64.b64encode(data) + payload += base64.b64encode(data).decode() payload += '' headers = { "Content-type": 'text/xml; charset="utf-8"', "Server": "Unspecified, UPnP/1.0, Unspecified", @@ -4247,8 +4254,8 @@ def _test_ap_wps_er_http_proto(dev, apdev): sock.close() logger.info("Valid Probe Request notification") - url = urllib.parse.urlparse(wps_event_url) - conn = http.client.HTTPConnection(url.netloc) + url = urlparse(wps_event_url) + conn = HTTPConnection(url.netloc) payload = ''' 1 @@ -4278,32 +4285,32 @@ RGV2aWNlIEEQSQAGADcqAAEg raise Exception("No Enrollee UUID match") logger.info("Incorrect event URL AP id") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("NOTIFY", url.path + '123', payload, headers) resp = conn.getresponse() if resp.status != 404: raise Exception("Unexpected HTTP response: %d" % resp.status) logger.info("Missing AP id") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("NOTIFY", '/event/' + url.path.split('/')[2], payload, headers) time.sleep(0.1) logger.info("Incorrect event URL event id") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("NOTIFY", '/event/123456789/123', payload, headers) time.sleep(0.1) logger.info("Incorrect event URL prefix") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("NOTIFY", '/foobar/123456789/123', payload, headers) resp = conn.getresponse() if resp.status != 404: raise Exception("Unexpected HTTP response: %d" % resp.status) logger.info("Unsupported request") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("FOOBAR", '/foobar/123456789/123', payload, headers) resp = conn.getresponse() if resp.status != 501: @@ -4311,169 +4318,169 @@ RGV2aWNlIEEQSQAGADcqAAEg logger.info("Unsupported request and OOM") with alloc_fail(dev[0], 1, "wps_er_http_req"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("FOOBAR", '/foobar/123456789/123', payload, headers) time.sleep(0.5) logger.info("Too short WLANEvent") - data = '\x00' + data = b'\x00' send_wlanevent(url, uuid, data) logger.info("Invalid WLANEventMAC") - data = '\x00qwertyuiopasdfghjklzxcvbnm' + data = b'\x00qwertyuiopasdfghjklzxcvbnm' send_wlanevent(url, uuid, data) logger.info("Unknown WLANEventType") - data = '\xff02:00:00:00:00:00' + data = b'\xff02:00:00:00:00:00' send_wlanevent(url, uuid, data) logger.info("Probe Request notification without any attributes") - data = '\x0102:00:00:00:00:00' + data = b'\x0102:00:00:00:00:00' send_wlanevent(url, uuid, data) logger.info("Probe Request notification with invalid attribute") - data = '\x0102:00:00:00:00:00\xff' + data = b'\x0102:00:00:00:00:00\xff' send_wlanevent(url, uuid, data) logger.info("EAP message without any attributes") - data = '\x0202:00:00:00:00:00' + data = b'\x0202:00:00:00:00:00' send_wlanevent(url, uuid, data) logger.info("EAP message with invalid attribute") - data = '\x0202:00:00:00:00:00\xff' + data = b'\x0202:00:00:00:00:00\xff' send_wlanevent(url, uuid, data) logger.info("EAP message from new STA and not M1") - data = '\x0202:ff:ff:ff:ff:ff' + '\x10\x22\x00\x01\x05' + data = b'\x0202:ff:ff:ff:ff:ff' + b'\x10\x22\x00\x01\x05' send_wlanevent(url, uuid, data) logger.info("EAP message: M1") - data = '\x0202:00:00:00:00:00' - data += '\x10\x22\x00\x01\x04' - data += '\x10\x47\x00\x10' + 16*'\x00' - data += '\x10\x20\x00\x06\x02\x00\x00\x00\x00\x00' - data += '\x10\x1a\x00\x10' + 16*'\x00' - data += '\x10\x32\x00\xc0' + 192*'\x00' - data += '\x10\x04\x00\x02\x00\x00' - data += '\x10\x10\x00\x02\x00\x00' - data += '\x10\x0d\x00\x01\x00' - data += '\x10\x08\x00\x02\x00\x00' - data += '\x10\x44\x00\x01\x00' - data += '\x10\x21\x00\x00' - data += '\x10\x23\x00\x00' - data += '\x10\x24\x00\x00' - data += '\x10\x42\x00\x00' - data += '\x10\x54\x00\x08' + 8*'\x00' - data += '\x10\x11\x00\x00' - data += '\x10\x3c\x00\x01\x00' - data += '\x10\x02\x00\x02\x00\x00' - data += '\x10\x12\x00\x02\x00\x00' - data += '\x10\x09\x00\x02\x00\x00' - data += '\x10\x2d\x00\x04\x00\x00\x00\x00' + data = b'\x0202:00:00:00:00:00' + data += b'\x10\x22\x00\x01\x04' + data += b'\x10\x47\x00\x10' + 16 * b'\x00' + data += b'\x10\x20\x00\x06\x02\x00\x00\x00\x00\x00' + data += b'\x10\x1a\x00\x10' + 16 * b'\x00' + data += b'\x10\x32\x00\xc0' + 192 * b'\x00' + data += b'\x10\x04\x00\x02\x00\x00' + data += b'\x10\x10\x00\x02\x00\x00' + data += b'\x10\x0d\x00\x01\x00' + data += b'\x10\x08\x00\x02\x00\x00' + data += b'\x10\x44\x00\x01\x00' + data += b'\x10\x21\x00\x00' + data += b'\x10\x23\x00\x00' + data += b'\x10\x24\x00\x00' + data += b'\x10\x42\x00\x00' + data += b'\x10\x54\x00\x08' + 8 * b'\x00' + data += b'\x10\x11\x00\x00' + data += b'\x10\x3c\x00\x01\x00' + data += b'\x10\x02\x00\x02\x00\x00' + data += b'\x10\x12\x00\x02\x00\x00' + data += b'\x10\x09\x00\x02\x00\x00' + data += b'\x10\x2d\x00\x04\x00\x00\x00\x00' m1 = data send_wlanevent(url, uuid, data) logger.info("EAP message: WSC_ACK") - data = '\x0202:00:00:00:00:00' + '\x10\x22\x00\x01\x0d' + data = b'\x0202:00:00:00:00:00' + b'\x10\x22\x00\x01\x0d' send_wlanevent(url, uuid, data) logger.info("EAP message: M1") send_wlanevent(url, uuid, m1) logger.info("EAP message: WSC_NACK") - data = '\x0202:00:00:00:00:00' + '\x10\x22\x00\x01\x0e' + data = b'\x0202:00:00:00:00:00' + b'\x10\x22\x00\x01\x0e' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 - Too long attribute values") - data = '\x0202:00:00:00:00:00' - data += '\x10\x11\x00\x21' + 33*'\x00' - data += '\x10\x45\x00\x21' + 33*'\x00' - data += '\x10\x42\x00\x21' + 33*'\x00' - data += '\x10\x24\x00\x21' + 33*'\x00' - data += '\x10\x23\x00\x21' + 33*'\x00' - data += '\x10\x21\x00\x41' + 65*'\x00' - data += '\x10\x49\x00\x09\x00\x37\x2a\x05\x02\x00\x00\x05\x00' + data = b'\x0202:00:00:00:00:00' + data += b'\x10\x11\x00\x21' + 33 * b'\x00' + data += b'\x10\x45\x00\x21' + 33 * b'\x00' + data += b'\x10\x42\x00\x21' + 33 * b'\x00' + data += b'\x10\x24\x00\x21' + 33 * b'\x00' + data += b'\x10\x23\x00\x21' + 33 * b'\x00' + data += b'\x10\x21\x00\x41' + 65 * b'\x00' + data += b'\x10\x49\x00\x09\x00\x37\x2a\x05\x02\x00\x00\x05\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing UUID-E") - data = '\x0202:00:00:00:00:00' - data += '\x10\x22\x00\x01\x04' + data = b'\x0202:00:00:00:00:00' + data += b'\x10\x22\x00\x01\x04' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing MAC Address") - data += '\x10\x47\x00\x10' + 16*'\x00' + data += b'\x10\x47\x00\x10' + 16 * b'\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Enrollee Nonce") - data += '\x10\x20\x00\x06\x02\x00\x00\x00\x00\x00' + data += b'\x10\x20\x00\x06\x02\x00\x00\x00\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Public Key") - data += '\x10\x1a\x00\x10' + 16*'\x00' + data += b'\x10\x1a\x00\x10' + 16 * b'\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Authentication Type flags") - data += '\x10\x32\x00\xc0' + 192*'\x00' + data += b'\x10\x32\x00\xc0' + 192 * b'\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Encryption Type Flags") - data += '\x10\x04\x00\x02\x00\x00' + data += b'\x10\x04\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Connection Type flags") - data += '\x10\x10\x00\x02\x00\x00' + data += b'\x10\x10\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Config Methods") - data += '\x10\x0d\x00\x01\x00' + data += b'\x10\x0d\x00\x01\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Wi-Fi Protected Setup State") - data += '\x10\x08\x00\x02\x00\x00' + data += b'\x10\x08\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Manufacturer") - data += '\x10\x44\x00\x01\x00' + data += b'\x10\x44\x00\x01\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Model Name") - data += '\x10\x21\x00\x00' + data += b'\x10\x21\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Model Number") - data += '\x10\x23\x00\x00' + data += b'\x10\x23\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Serial Number") - data += '\x10\x24\x00\x00' + data += b'\x10\x24\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Primary Device Type") - data += '\x10\x42\x00\x00' + data += b'\x10\x42\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Device Name") - data += '\x10\x54\x00\x08' + 8*'\x00' + data += b'\x10\x54\x00\x08' + 8 * b'\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing RF Bands") - data += '\x10\x11\x00\x00' + data += b'\x10\x11\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Association State") - data += '\x10\x3c\x00\x01\x00' + data += b'\x10\x3c\x00\x01\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Device Password ID") - data += '\x10\x02\x00\x02\x00\x00' + data += b'\x10\x02\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing Configuration Error") - data += '\x10\x12\x00\x02\x00\x00' + data += b'\x10\x12\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("EAP message: M1 missing OS Version") - data += '\x10\x09\x00\x02\x00\x00' + data += b'\x10\x09\x00\x02\x00\x00' send_wlanevent(url, uuid, data) logger.info("Check max concurrent requests") @@ -4485,11 +4492,11 @@ RGV2aWNlIEEQSQAGADcqAAEg socks[i].settimeout(10) socks[i].connect(addr) for i in range(20): - socks[i].send("GET / HTTP/1.1\r\n\r\n") + socks[i].send("GET / HTTP/1.1\r\n\r\n".encode()) count = 0 for i in range(20): try: - res = socks[i].recv(100) + res = socks[i].recv(100).decode() if "HTTP/1" in res: count += 1 else: @@ -4510,7 +4517,7 @@ RGV2aWNlIEEQSQAGADcqAAEg sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) sock.connect(addr) - sock.send("GET / HTTP/1.1\r\n\r\n") + sock.send("GET / HTTP/1.1\r\n\r\n".encode()) try: sock.recv(100) except: @@ -4533,7 +4540,7 @@ RGV2aWNlIEEQSQAGADcqAAEg socket.IPPROTO_TCP) sock.settimeout(0.1) sock.connect(addr) - sock.send(req) + sock.send(req.encode()) try: sock.recv(100) except: @@ -4544,14 +4551,14 @@ RGV2aWNlIEEQSQAGADcqAAEg sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) sock.connect(addr) - sock.send("NOTIFY / HTTP/1.1\r\n\r\n" + 4500*'a') + sock.send(("NOTIFY / HTTP/1.1\r\n\r\n" + 4500 * 'a').encode()) try: sock.recv(100) except: pass sock.close() - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) payload = ' 2: + msg['eap_type'] = data[0] + else: + msg['eap_type'], = struct.unpack('B', data[0]) data = data[1:] if msg['eap_type'] == 254: if len(data) < 3 + 4: raise Exception("Truncated EAP expanded header") - msg['eap_vendor_id'], msg['eap_vendor_type'] = struct.unpack('>LL', '\0' + data[0:7]) + msg['eap_vendor_id'], msg['eap_vendor_type'] = struct.unpack('>LL', b'\x00' + data[0:7]) data = data[7:] else: raise Exception("Unexpected EAP type") @@ -6220,7 +6231,11 @@ def recv_wsc_msg(dev, opcode, msg_type): return msg, msg['wsc_attrs'], msg['raw_attrs'] def build_wsc_attr(attr, payload): - return struct.pack('>HH', attr, len(payload)) + payload + if type(payload) == bytes: + _payload = payload + else: + _payload = payload.encode() + return struct.pack('>HH', attr, len(payload)) + _payload def build_attr_msg_type(msg_type): return build_wsc_attr(ATTR_MSG_TYPE, struct.pack('B', msg_type)) @@ -6238,7 +6253,10 @@ def build_eap_wsc(eap_code, eap_id, payload, opcode=WSC_MSG): # EAP-WSC header msg += struct.pack('BB', opcode, 0) # WSC attributes - msg += payload + if type(payload) == bytes: + msg += payload + else: + msg += payload.encode() return msg def build_eap_success(eap_id): @@ -6258,7 +6276,7 @@ def build_eap_failure(eap_id): return msg def send_wsc_msg(dev, src, msg): - res = dev.request("EAPOL_RX " + src + " " + binascii.hexlify(msg)) + res = dev.request("EAPOL_RX " + src + " " + binascii.hexlify(msg).decode()) if "OK" not in res: raise Exception("EAPOL_RX failed") @@ -6266,14 +6284,14 @@ group_5_prime = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC group_5_generator = 2 def wsc_kdf(key, label, bits): - result = '' + result = bytes() i = 1 while len(result) * 8 < bits: - data = struct.pack('>L', i) + label + struct.pack('>L', bits) + data = struct.pack('>L', i) + label.encode() + struct.pack('>L', bits) m = hmac.new(key, data, hashlib.sha256) result += m.digest() i += 1 - return result[0:bits / 8] + return result[0:bits // 8] def wsc_keys(kdk): keys = wsc_kdf(kdk, "Wi-Fi Easy and Secure Key Derivation", 640) @@ -6283,12 +6301,12 @@ def wsc_keys(kdk): return authkey,keywrapkey,emsk def wsc_dev_pw_half_psk(authkey, dev_pw): - m = hmac.new(authkey, dev_pw, hashlib.sha256) + m = hmac.new(authkey, dev_pw.encode(), hashlib.sha256) return m.digest()[0:16] def wsc_dev_pw_psk(authkey, dev_pw): - dev_pw_1 = dev_pw[0:len(dev_pw) / 2] - dev_pw_2 = dev_pw[len(dev_pw) / 2:] + dev_pw_1 = dev_pw[0:len(dev_pw) // 2] + dev_pw_2 = dev_pw[len(dev_pw) // 2:] psk1 = wsc_dev_pw_half_psk(authkey, dev_pw_1) psk2 = wsc_dev_pw_half_psk(authkey, dev_pw_2) return psk1,psk2 @@ -6299,15 +6317,22 @@ def build_attr_authenticator(authkey, prev_msg, curr_msg): return build_wsc_attr(ATTR_AUTHENTICATOR, auth) def build_attr_encr_settings(authkey, keywrapkey, data): - m = hmac.new(authkey, data, hashlib.sha256) + if type(data) == bytes: + _data = data + else: + if len(data) > 0: + _data = data.encode() + else: + _data = bytes() + m = hmac.new(authkey, _data, hashlib.sha256) kwa = m.digest()[0:8] - data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, kwa) - iv = 16*'\x99' + _data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, kwa) + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) - pad_len = 16 - len(data) % 16 + pad_len = 16 - len(_data) % 16 ps = pad_len * struct.pack('B', pad_len) - data += ps - wrapped = aes.encrypt(data) + _data += ps + wrapped = aes.encrypt(_data) return build_wsc_attr(ATTR_ENCR_SETTINGS, iv + wrapped) def decrypt_attr_encr_settings(authkey, keywrapkey, data): @@ -6317,7 +6342,10 @@ def decrypt_attr_encr_settings(authkey, keywrapkey, data): encr = data[16:] aes = AES.new(keywrapkey, AES.MODE_CBC, iv) decrypted = aes.decrypt(encr) - pad_len, = struct.unpack('B', decrypted[-1]) + if sys.version_info[0] > 2: + pad_len = decrypted[-1] + else: + pad_len, = struct.unpack('B', decrypted[-1]) if pad_len > len(decrypted): raise Exception("Invalid padding in Encrypted Settings") for i in range(-pad_len, -1): @@ -6358,7 +6386,7 @@ def wsc_dh_kdf(peer_pk, own_private, mac_addr, e_nonce, r_nonce): peer_public = int(binascii.hexlify(peer_pk), 16) if peer_public < 2 or peer_public >= group_5_prime: raise Exception("Invalid peer public key") - if pow(peer_public, (group_5_prime - 1) / 2, group_5_prime) != 1: + if pow(peer_public, (group_5_prime - 1) // 2, group_5_prime) != 1: raise Exception("Unexpected Legendre symbol for peer public key") shared_secret = pow(peer_public, own_private, group_5_prime) @@ -6366,33 +6394,41 @@ def wsc_dh_kdf(peer_pk, own_private, mac_addr, e_nonce, r_nonce): logger.debug("DH shared secret: " + ss) dhkey = hashlib.sha256(binascii.unhexlify(ss)).digest() - logger.debug("DHKey: " + binascii.hexlify(dhkey)) + logger.debug("DHKey: " + binascii.hexlify(dhkey).decode()) - m = hmac.new(dhkey, e_nonce + mac_addr + r_nonce, hashlib.sha256) + if type(e_nonce) == bytes: + _e_nonce = e_nonce + else: + _e_nonce = e_nonce.encode() + if type(r_nonce) == bytes: + _r_nonce = r_nonce + else: + _r_nonce = r_nonce.encode() + m = hmac.new(dhkey, _e_nonce + mac_addr + _r_nonce, hashlib.sha256) kdk = m.digest() - logger.debug("KDK: " + binascii.hexlify(kdk)) + logger.debug("KDK: " + binascii.hexlify(kdk).decode()) authkey,keywrapkey,emsk = wsc_keys(kdk) - logger.debug("AuthKey: " + binascii.hexlify(authkey)) - logger.debug("KeyWrapKey: " + binascii.hexlify(keywrapkey)) - logger.debug("EMSK: " + binascii.hexlify(emsk)) + logger.debug("AuthKey: " + binascii.hexlify(authkey).decode()) + logger.debug("KeyWrapKey: " + binascii.hexlify(keywrapkey).decode()) + logger.debug("EMSK: " + binascii.hexlify(emsk).decode()) return authkey,keywrapkey def wsc_dev_pw_hash(authkey, dev_pw, e_pk, r_pk): psk1,psk2 = wsc_dev_pw_psk(authkey, dev_pw) - logger.debug("PSK1: " + binascii.hexlify(psk1)) - logger.debug("PSK2: " + binascii.hexlify(psk2)) + logger.debug("PSK1: " + binascii.hexlify(psk1).decode()) + logger.debug("PSK2: " + binascii.hexlify(psk2).decode()) # Note: Secret values are supposed to be random, but hardcoded values are # fine for testing. - s1 = 16*'\x77' + s1 = 16 * b'\x77' m = hmac.new(authkey, s1 + psk1 + e_pk + r_pk, hashlib.sha256) hash1 = m.digest() - logger.debug("Hash1: " + binascii.hexlify(hash1)) + logger.debug("Hash1: " + binascii.hexlify(hash1).decode()) - s2 = 16*'\x88' + s2 = 16 * b'\x88' m = hmac.new(authkey, s2 + psk2 + e_pk + r_pk, hashlib.sha256) hash2 = m.digest() - logger.debug("Hash2: " + binascii.hexlify(hash2)) + logger.debug("Hash2: " + binascii.hexlify(hash2).decode()) return s1,s2,hash1,hash2 def build_m1(eap_id, uuid_e, mac_addr, e_nonce, e_pk, @@ -6580,7 +6616,7 @@ def test_wps_ext(dev, apdev): msg, m8_attrs, raw_m8_attrs = recv_wsc_msg(hapd, WSC_MSG, WPS_M8) m8_cred = decrypt_attr_encr_settings(authkey, keywrapkey, m8_attrs[ATTR_ENCR_SETTINGS]) - logger.debug("M8 Credential: " + binascii.hexlify(m8_cred)) + logger.debug("M8 Credential: " + binascii.hexlify(m8_cred).decode()) logger.debug("Prepare WSC_Done") attrs = build_wsc_attr(ATTR_VERSION, '\x10') @@ -6746,7 +6782,7 @@ def test_wps_ext_kwa_proto_no_kwa(dev, apdev): r_s1,keywrapkey,authkey,raw_m3_attrs,eap_id,bssid,attrs = wps_start_kwa(dev, apdev) data = build_wsc_attr(ATTR_R_SNONCE1, r_s1) # Encrypted Settings without KWA - iv = 16*'\x99' + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) pad_len = 16 - len(data) % 16 ps = pad_len * struct.pack('B', pad_len) @@ -6764,7 +6800,7 @@ def test_wps_ext_kwa_proto_data_after_kwa(dev, apdev): kwa = m.digest()[0:8] data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, kwa) data += build_wsc_attr(ATTR_VENDOR_EXT, "1234567890") - iv = 16*'\x99' + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) pad_len = 16 - len(data) % 16 ps = pad_len * struct.pack('B', pad_len) @@ -6779,7 +6815,7 @@ def test_wps_ext_kwa_proto_kwa_mismatch(dev, apdev): data = build_wsc_attr(ATTR_R_SNONCE1, r_s1) # Encrypted Settings and KWA with incorrect value data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, 8*'\x00') - iv = 16*'\x99' + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) pad_len = 16 - len(data) % 16 ps = pad_len * struct.pack('B', pad_len) @@ -6902,7 +6938,7 @@ def wps_run_cred_proto(dev, apdev, m8_cred, connect=False, no_connect=False): def build_cred(nw_idx='\x01', ssid='test-wps-conf', auth_type='\x00\x20', encr_type='\x00\x08', nw_key="12345678", mac_addr='\x00\x00\x00\x00\x00\x00'): - attrs = '' + attrs = bytes() if nw_idx is not None: attrs += build_wsc_attr(ATTR_NETWORK_INDEX, nw_idx) if ssid is not None: @@ -7036,8 +7072,8 @@ def test_wps_ext_proto_m2_invalid_public_key(dev, apdev): wps_ext_eap_wsc(dev[0], hapd, bssid, "EAP-WSC/Start") mac_addr = binascii.unhexlify(dev[0].own_addr().replace(':', '')) - uuid_r = 16*'\x33' - r_nonce = 16*'\x44' + uuid_r = 16 * b'\x33' + r_nonce = 16 * b'\x44' own_private, e_pk = wsc_dh_init() logger.debug("Receive M1 from STA") @@ -7053,7 +7089,7 @@ def test_wps_ext_proto_m2_invalid_public_key(dev, apdev): logger.debug("Send M2 to STA") m2, raw_m2_attrs = build_m2(authkey, raw_m1_attrs, eap_id, m1_attrs[ATTR_ENROLLEE_NONCE], - r_nonce, uuid_r, 192*'\xff') + r_nonce, uuid_r, 192 * b'\xff') send_wsc_msg(dev[0], bssid, m2) eap_id = (eap_id + 1) % 256 @@ -7555,7 +7591,7 @@ def test_wps_ext_proto_m4_invalid_pad_string(dev, apdev): m = hmac.new(authkey, data, hashlib.sha256) kwa = m.digest()[0:8] data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, kwa) - iv = 16*'\x99' + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) pad_len = 16 - len(data) % 16 ps = (pad_len - 1) * struct.pack('B', pad_len) + struct.pack('B', pad_len - 1) @@ -7592,7 +7628,7 @@ def test_wps_ext_proto_m4_invalid_pad_value(dev, apdev): m = hmac.new(authkey, data, hashlib.sha256) kwa = m.digest()[0:8] data += build_wsc_attr(ATTR_KEY_WRAP_AUTH, kwa) - iv = 16*'\x99' + iv = 16 * b'\x99' aes = AES.new(keywrapkey, AES.MODE_CBC, iv) pad_len = 16 - len(data) % 16 ps = (pad_len - 1) * struct.pack('B', pad_len) + struct.pack('B', 255) @@ -9257,7 +9293,7 @@ def test_wps_ext_m1_workaround(dev, apdev): logger.debug("Send M1 to AP") m1, raw_m1_attrs = build_m1(msg['eap_identifier'], uuid_e, mac_addr, e_nonce, e_pk, manufacturer='Apple TEST', - model_name='AirPort', config_methods='\xff\xff') + model_name='AirPort', config_methods=b'\xff\xff') send_wsc_msg(hapd, addr, m1) logger.debug("Receive M2 from AP") @@ -9277,12 +9313,12 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): hapd = add_ssdp_ap(apdev[0], ap_uuid) location = ssdp_get_location(ap_uuid) - url = urllib.parse.urlparse(location) + url = urlparse(location) urls = upnp_get_urls(location) - eventurl = urllib.parse.urlparse(urls['event_sub_url']) - ctrlurl = urllib.parse.urlparse(urls['control_url']) + eventurl = urlparse(urls['event_sub_url']) + ctrlurl = urlparse(urls['control_url']) - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) with alloc_fail(hapd, 1, "web_connection_parse_get"): conn.request("GET", "/wps_device.xml") try: @@ -9290,7 +9326,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): except: pass - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("GET", "/unknown") resp = conn.getresponse() if resp.status != 404: @@ -9304,56 +9340,56 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): except: pass - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("GET", "/wps_device.xml") resp = conn.getresponse() if resp.status != 200: raise Exception("GET /wps_device.xml failed") - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") if resp.status != 200: raise Exception("GetDeviceInfo failed") with alloc_fail(hapd, 1, "web_process_get_device_info"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") if resp.status != 500: raise Exception("Internal error not reported from GetDeviceInfo OOM") with alloc_fail(hapd, 1, "wps_build_m1;web_process_get_device_info"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") if resp.status != 500: raise Exception("Internal error not reported from GetDeviceInfo OOM") with alloc_fail(hapd, 1, "wpabuf_alloc;web_connection_send_reply"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) try: resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") except: pass - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "GetDeviceInfo") if resp.status != 200: raise Exception("GetDeviceInfo failed") # No NewWLANEventType in PutWLANResponse NewMessage - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "PutWLANResponse", newmsg="foo") if resp.status != 600: raise Exception("Unexpected HTTP response: %d" % resp.status) # No NewWLANEventMAC in PutWLANResponse NewMessage - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "PutWLANResponse", newmsg="foo", neweventtype="1") if resp.status != 600: raise Exception("Unexpected HTTP response: %d" % resp.status) # Invalid NewWLANEventMAC in PutWLANResponse NewMessage - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "PutWLANResponse", newmsg="foo", neweventtype="1", neweventmac="foo") @@ -9362,7 +9398,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): # Workaround for NewWLANEventMAC in PutWLANResponse NewMessage # Ignored unexpected PutWLANResponse WLANEventType 1 - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "PutWLANResponse", newmsg="foo", neweventtype="1", neweventmac="00.11.22.33.44.55") @@ -9370,7 +9406,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): raise Exception("Unexpected HTTP response: %d" % resp.status) # PutWLANResponse NewMessage with invalid EAP message - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) resp = upnp_soap_action(conn, ctrlurl.path, "PutWLANResponse", newmsg="foo", neweventtype="2", neweventmac="00:11:22:33:44:55") @@ -9378,7 +9414,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): raise Exception("Unexpected HTTP response: %d" % resp.status) with alloc_fail(hapd, 1, "web_connection_parse_subscribe"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9389,7 +9425,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): pass with alloc_fail(hapd, 1, "dup_binstr;web_connection_parse_subscribe"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9399,7 +9435,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): raise Exception("Unexpected HTTP response: %d" % resp.status) with alloc_fail(hapd, 1, "wpabuf_alloc;web_connection_parse_unsubscribe"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) headers = { "callback": '', "NT": "upnp:event", "timeout": "Second-1234" } @@ -9410,7 +9446,7 @@ def test_ap_wps_upnp_web_oom(dev, apdev, params): pass with alloc_fail(hapd, 1, "web_connection_unimplemented"): - conn = http.client.HTTPConnection(url.netloc) + conn = HTTPConnection(url.netloc) conn.request("HEAD", "/wps_device.xml") try: resp = conn.getresponse() From patchwork Thu Jan 24 07:46:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tg3i+Tg7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F3JpAd++"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ7h5cf8z9s9h for ; Thu, 24 Jan 2019 18:50:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=t59vOvhq9ftpEn+KRINQuB/8E3BWLaOE0TVPLDnVUak=; b=Tg3i+Tg7GIqVoXETkB1vc4f06q 3vHrGLe2OGsQd+E3J5avbStFc49nnXLwTzWvBeGWq66ma85LaFDvxfY72lk/Z9Dhs3J381VF0TkJI iwXwwWf+JQMW6yjexW3kfmAduXhm50Y502e3QQoiyiLCP6YOAo3XYRznVcCe55i9KWx5lE7XJOtx3 DTgVwvYzDFx7drW9PLWKyVk8o1AMFOwnaBrUcrbxJUt+uAx8TYbJd1R8U4SU0BZ36sk/d/6508mVC rs4XouUj7Vh4xVNJl5LH2Hf/FNI0FIejjXEbfuQX8xz+MIkIeSnqCAxNLHlnUJcVYpH5CtpT7TrdV C7yx84/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZlt-00008M-4i; Thu, 24 Jan 2019 07:49:57 +0000 Received: from mail-pf1-f170.google.com ([209.85.210.170]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjM-00064o-FB for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:47 +0000 Received: by mail-pf1-f170.google.com with SMTP id g62so2570039pfd.12 for ; Wed, 23 Jan 2019 23:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9/jzNPRKYy79zWsHwEW+/G56R1P8phIgxUR66URBesw=; b=F3JpAd++oS2PvXyDKsd5fUuG/bORb6NIKzxmQFoeT2B4WYfwv5uf5YrT3vbfxVSlI5 oAWR2mBfWlik0SIzO+B7THG8rjP9FjTdhW09DETyfEaMiqZqXsxf65QaL9OUVdegN6CS KvLIWPQup8nEAaZ/2AJ0c2Z2WDsI3FZcGeMMu1zJ1StbJC2bc2cOC3R9mfK+j/G9ikwK YgNquFRvuFazUp1wkrDHjM2ieh2rP1iFfVaPkRajkvHdTmIB5iQj7yQne+Jf/SNGVv7I M2k6WikQGR9yfPbGdggzo/L3Sc19/x29dGEWw/ofm+2amtLrNoGs1XAY0lxbwgchFmg+ FKLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9/jzNPRKYy79zWsHwEW+/G56R1P8phIgxUR66URBesw=; b=VIJDMg7SZ+l7haxhOexUa4bZZQDmVcgLN0UOkqSsfHjv98ArE8inL4aTGgE/pW/TbF NNnWkuQJMFwUs3XbO4Y6BALs2OSEa14EkGqcmPsmMQrtudCAEsRF3DYZJ/U+wRVNig5d DMyMx+B6QJSQ1dYJLpIIYLuDwbjDNC4tW3LTBIw6hgMgaGH9GFaO/ch5Yj3oePsk9Sae h7yUVCpJzHa9cG5Hl56k5TZuRrvzmhr+No0lOrTbD5xmXZSc+54LQ9aleIHrc6iDUItI FK3qPnBSMjZoVAcz96MGby4qCuX65iAomOmntXSi6ZSf4DwobOqxsNHFuo1OEnMMS2gm uWgQ== X-Gm-Message-State: AJcUukeuDI6AV+BTxhYJTOP2h5vleYnwBAPunvHRD1XFzfHS7oIqOXwd vHCJT6wPoW9oy6ZPtxc+U5EXmEvQ X-Google-Smtp-Source: ALg8bN71vw638x9zwYYB1YMlR5eInHY+6I5Gwoo+n6Uc+yYq7K0yB5lm2panNtB2Iaqh9FTzbG2m1g== X-Received: by 2002:a63:6984:: with SMTP id e126mr5079433pgc.143.1548316038837; Wed, 23 Jan 2019 23:47:18 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:18 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 20/50] tests: Modify cfg80211 test sets for python3 Date: Thu, 24 Jan 2019 16:46:00 +0900 Message-Id: <20190124074630.4192-21-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234720_974304_2B564D63 X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.170 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_cfg80211.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_cfg80211.py b/tests/hwsim/test_cfg80211.py index b21296140..0890984fc 100644 --- a/tests/hwsim/test_cfg80211.py +++ b/tests/hwsim/test_cfg80211.py @@ -19,7 +19,7 @@ from wpasupplicant import WpaSupplicant def nl80211_command(dev, cmd, attr): res = dev.request("VENDOR ffffffff {} {}".format(nl80211_cmd[cmd], - binascii.hexlify(attr))) + binascii.hexlify(attr).decode())) if "FAIL" in res: raise Exception("nl80211 command failed") return binascii.unhexlify(res) @@ -70,7 +70,7 @@ def test_cfg80211_tx_frame(dev, apdev, params): dev[0].p2p_start_go(freq='2412') go = WpaSupplicant(dev[0].group_ifname) - frame = binascii.unhexlify("d0000000020000000100" + go.own_addr().translate(None, ':') + "02000000010000000409506f9a090001dd5e506f9a0902020025080401001f0502006414060500585804510b0906000200000000000b1000585804510b0102030405060708090a0b0d1d000200000000000108000000000000000000101100084465766963652041110500585804510bdd190050f204104a0001101012000200011049000600372a000120") + frame = binascii.unhexlify("d0000000020000000100" + go.own_addr().replace(':', '') + "02000000010000000409506f9a090001dd5e506f9a0902020025080401001f0502006414060500585804510b0906000200000000000b1000585804510b0102030405060708090a0b0d1d000200000000000108000000000000000000101100084465766963652041110500585804510bdd190050f204104a0001101012000200011049000600372a000120") ifindex = int(go.get_driver_status_field("ifindex")) res = nl80211_frame(go, ifindex, frame, freq=2422, duration=500, offchannel_tx_ok=True) From patchwork Thu Jan 24 07:46:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tA3ifRk5"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="j3VT3Mp0"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ld2Z5gtlz9s9G for ; Thu, 24 Jan 2019 21:00:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UG68vL2viwmRj8S4StTqDhsq7pDQXqTrZ2js9CWp4c8=; b=tA3ifRk59WA6FSDP/wCjlZ4om3 zJzAQERWLMDrBpoOC6WdBka91E59TpHDhgx0I73AKDKiCPTAut8dAG+4wQ2imQRkNStI0jS3MxIS+ 5uHf+P2kuZcxgnuTmo3168PP3o8p6hSvXaPRjhc9tBfnNZOiOKbLRaiy2nBihgxJcSZPdajVSxlmV sa/8mvS49Zgk/4USAJwnB7NHJwQqAeYy3V6f/duSJCixIrPauwzw06WjIBj00d6O+8xfa3YrZERL4 UzuYR8qG0TO9RnV+zdem+cH3/QpOVmnkZHhHPx/sKPgbX4D1TSLuQWzEaMC093aKqcUYn8zChOZ/+ IVPvmpfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmboR-0006gQ-MM; Thu, 24 Jan 2019 10:00:43 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjP-00066t-1C for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:17 +0000 Received: by mail-pl1-x62d.google.com with SMTP id z23so2523641plo.0 for ; Wed, 23 Jan 2019 23:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hE0YXImBVurkVvT3OB3Ean8+Jn+bO6fryUiYjXMp2Fk=; b=j3VT3Mp0jtobst/InQv+M8A/f2JgX5Bul+Ji7UecCySB/vQxoCoZubXQE0QflcA3Yo komLyrfDYh2MsuuN1Nhz6ZTrwiuefOKQ4RalMVaCwqtHXX2f2oG/1JAh6elYkgriwU9J ehnPbdGeb1YhRZ4NWBP2ht1AUIr8RY2pHaAFVJ2GoIXbZDrHwUsPAQKb139J04O0rbWD QInLCrC2w1BOtVWiyhl+PGjBa2zosWfT+PWSVidAL84wX031WG2FC/jqLgyNi89uonq7 o7iGIrqT8BYIpB3I4ZbaPGQy14eAUPuPdScQzURzzUxGxu6uO80NxTRpiNrOp3f27Mh+ mNUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hE0YXImBVurkVvT3OB3Ean8+Jn+bO6fryUiYjXMp2Fk=; b=qTnX7ky4yRotCqDaWAO9g1RdM301Jpaa9UZSCg9HEJrYRFQ8aldTpBnkunvoxIeyLx z6Ps5mJ0VtJ3gHRh0VQNlxQJ5vRzT92ueXiQqihkf5OZMV0tPAz9mOplScsK/7DwwaNY vCVxYOpj/uTlromQhEAno0qGGQZdubnyrq8EaD59bcU3QU1dsrJW0+rigUEMlLA5/UPc THM8nqdlBkdVZloBCXv5/jxjDn76hidlaEwGw0l7juzJBwLRzYWaTGRra+5pGaay4qJe GHvX1QrGQ6qtNX6hcuD9nkihAzO3T2ccOrFX7YLDaeD7AYWQg98qG1+CvKRgjz/SLZ7r FWMg== X-Gm-Message-State: AJcUukdG58yyjRZ/9VmKSJ6SyzuQwDyjdoG2znOxTK0588KaVkXTeVRU Gv6P1EKr5740m4bWcnRQlNQPseKX X-Google-Smtp-Source: ALg8bN6LEqInk13+TzI29PYZErScKq7gPRHHqheut/Ygv7YNcrKBJrz7LcdSfrvmSb2rWW+Id1qU+A== X-Received: by 2002:a17:902:6113:: with SMTP id t19mr5398562plj.248.1548316040709; Wed, 23 Jan 2019 23:47:20 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:19 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 21/50] tests: Modify dbus test sets for python3 Date: Thu, 24 Jan 2019 16:46:01 +0900 Message-Id: <20190124074630.4192-22-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234723_721545_1CAD123C X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Mailman-Approved-At: Thu, 24 Jan 2019 02:00:41 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_dbus.py | 377 +++++++++++++++++++++------------------ 1 file changed, 203 insertions(+), 174 deletions(-) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index e0703fae0..c4aff59dd 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -9,9 +9,14 @@ import logging logger = logging.getLogger() import subprocess import time +import sys + +if sys.version_info[0] > 2: + from gi.repository import GObject +else: + import gobject as GObject try: - import gobject import dbus dbus_imported = True except ImportError: @@ -56,7 +61,7 @@ def prepare_dbus(dev): class TestDbus(object): def __init__(self, bus): - self.loop = gobject.MainLoop() + self.loop = GObject.MainLoop() self.signals = [] self.bus = bus @@ -259,14 +264,14 @@ def test_dbus_properties(dev, apdev): if val != res: raise Exception("WFDIEs value changed") try: - dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray('\x00')) + dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray(b'\x00')) raise Exception("Invalid WFDIEs value accepted") except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e): raise Exception("Unexpected error message: " + str(e)) - dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray('')) + dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray(bytes())) dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray(val)) - dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray('')) + dbus_set(dbus, wpas_obj, "WFDIEs", dbus.ByteArray(bytes())) res = dbus_get(dbus, wpas_obj, "WFDIEs", byte_arrays=True) if len(res) != 0: raise Exception("WFDIEs not cleared properly") @@ -314,7 +319,7 @@ def test_dbus_properties(dev, apdev): try: wpas_obj.Set(WPAS_DBUS_SERVICE, "WFDIEs", - dbus.ByteArray('', variant_level=2), + dbus.ByteArray(bytes(), variant_level=2), dbus_interface=dbus.PROPERTIES_IFACE) raise Exception("Invalid Set accepted") except dbus.exceptions.DBusException as e: @@ -443,7 +448,7 @@ def _test_dbus_get_set_wps(dev, apdev): if val[0] != 0x00 or val[1] != 0x05 != val[2] != 0x00 or val[3] != 0x50 or val[4] != 0xf2 or val[5] != 0x04 or val[6] != 0x00 or val[7] != 0x01: raise Exception("DeviceType mismatch after Set") - val2 = '\x01\x02\x03\x04\x05\x06\x07\x08' + val2 = b'\x01\x02\x03\x04\x05\x06\x07\x08' if_obj.Set(WPAS_DBUS_IFACE_WPS, "DeviceType", dbus.ByteArray(val2), dbus_interface=dbus.PROPERTIES_IFACE) val = if_obj.Get(WPAS_DBUS_IFACE_WPS, "DeviceType", @@ -460,8 +465,8 @@ def _test_dbus_get_set_wps(dev, apdev): self.sets_done = False def __enter__(self): - gobject.timeout_add(1, self.run_sets) - gobject.timeout_add(1000, self.timeout) + GObject.timeout_add(1, self.run_sets) + GObject.timeout_add(1000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE_WPS, "PropertiesChanged") self.add_signal(self.propertiesChanged2, dbus.PROPERTIES_IFACE, @@ -471,7 +476,7 @@ def _test_dbus_get_set_wps(dev, apdev): def propertiesChanged(self, properties): logger.debug("PropertiesChanged: " + str(properties)) - if properties.has_key("ProcessCredentials"): + if "ProcessCredentials" in properties: self.signal_received_deprecated = True if self.sets_done and self.signal_received: self.loop.quit() @@ -481,7 +486,7 @@ def _test_dbus_get_set_wps(dev, apdev): logger.debug("propertiesChanged2: interface_name=%s changed_properties=%s invalidated_properties=%s" % (interface_name, str(changed_properties), str(invalidated_properties))) if interface_name != WPAS_DBUS_IFACE_WPS: return - if changed_properties.has_key("ProcessCredentials"): + if "ProcessCredentials" in changed_properties: self.signal_received = True if self.sets_done and self.signal_received_deprecated: self.loop.quit() @@ -527,11 +532,11 @@ def test_dbus_wps_invalid(dev, apdev): 'Bssid': '02:33:44:55:66:77'}, {'Role': 'enrollee', 'Type': 'pin', 'Pin': 123}, {'Role': 'enrollee', 'Type': 'pbc', - 'Bssid': dbus.ByteArray('12345')}, + 'Bssid': dbus.ByteArray('12345'.encode())}, {'Role': 'enrollee', 'Type': 'pbc', 'P2PDeviceAddress': 12345}, {'Role': 'enrollee', 'Type': 'pbc', - 'P2PDeviceAddress': dbus.ByteArray('12345')}, + 'P2PDeviceAddress': dbus.ByteArray('12345'.encode())}, {'Role': 'enrollee', 'Type': 'pbc', 'Foo': 'bar'} ] for args in failures: try: @@ -640,8 +645,8 @@ def _test_dbus_wps_pbc(dev, apdev): self.wps = wps def __enter__(self): - gobject.timeout_add(1, self.start_pbc) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.start_pbc) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.add_signal(self.credentials, WPAS_DBUS_IFACE_WPS, "Credentials") @@ -700,8 +705,8 @@ def test_dbus_wps_pbc_overlap(dev, apdev): self.wps = wps def __enter__(self): - gobject.timeout_add(1, self.start_pbc) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.start_pbc) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.loop.run() return self @@ -753,8 +758,8 @@ def _test_dbus_wps_pin(dev, apdev): self.credentials_received = False def __enter__(self): - gobject.timeout_add(1, self.start_pin) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.start_pin) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.add_signal(self.credentials, WPAS_DBUS_IFACE_WPS, "Credentials") @@ -776,7 +781,7 @@ def _test_dbus_wps_pin(dev, apdev): def start_pin(self, *args): logger.debug("start_pin") - bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex')) + bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode())) wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670', 'Bssid': bssid_ay}) return False @@ -813,8 +818,8 @@ def _test_dbus_wps_pin2(dev, apdev): self.failed = False def __enter__(self): - gobject.timeout_add(1, self.start_pin) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.start_pin) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.add_signal(self.credentials, WPAS_DBUS_IFACE_WPS, "Credentials") @@ -836,7 +841,7 @@ def _test_dbus_wps_pin2(dev, apdev): def start_pin(self, *args): logger.debug("start_pin") - bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex')) + bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode())) res = wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Bssid': bssid_ay}) pin = res['Pin'] @@ -876,8 +881,8 @@ def _test_dbus_wps_pin_m2d(dev, apdev): self.credentials_received = False def __enter__(self): - gobject.timeout_add(1, self.start_pin) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.start_pin) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.add_signal(self.credentials, WPAS_DBUS_IFACE_WPS, "Credentials") @@ -902,7 +907,7 @@ def _test_dbus_wps_pin_m2d(dev, apdev): def start_pin(self, *args): logger.debug("start_pin") - bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex')) + bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode())) wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670', 'Bssid': bssid_ay}) return False @@ -939,8 +944,8 @@ def _test_dbus_wps_reg(dev, apdev): self.credentials_received = False def __enter__(self): - gobject.timeout_add(100, self.start_reg) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(100, self.start_reg) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsEvent, WPAS_DBUS_IFACE_WPS, "Event") self.add_signal(self.credentials, WPAS_DBUS_IFACE_WPS, "Credentials") @@ -957,7 +962,7 @@ def _test_dbus_wps_reg(dev, apdev): def start_reg(self, *args): logger.debug("start_reg") - bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex')) + bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode())) wps.Start({'Role': 'registrar', 'Type': 'pin', 'Pin': '12345670', 'Bssid': bssid_ay}) return False @@ -981,7 +986,7 @@ def test_dbus_wps_cancel(dev, apdev): wps.Cancel() dev[0].scan_for_bss(bssid, freq="2412") - bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex')) + bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode())) wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670', 'Bssid': bssid_ay}) wps.Cancel() @@ -999,18 +1004,18 @@ def test_dbus_scan_invalid(dev, apdev): ({'Type': 'active', 'SSIDs': 'foo'}, "InvalidArgs"), ({'Type': 'active', 'SSIDs': ['foo']}, "InvalidArgs"), ({'Type': 'active', - 'SSIDs': [ dbus.ByteArray("1"), dbus.ByteArray("2"), - dbus.ByteArray("3"), dbus.ByteArray("4"), - dbus.ByteArray("5"), dbus.ByteArray("6"), - dbus.ByteArray("7"), dbus.ByteArray("8"), - dbus.ByteArray("9"), dbus.ByteArray("10"), - dbus.ByteArray("11"), dbus.ByteArray("12"), - dbus.ByteArray("13"), dbus.ByteArray("14"), - dbus.ByteArray("15"), dbus.ByteArray("16"), - dbus.ByteArray("17") ]}, + 'SSIDs': [ dbus.ByteArray("1".encode()), dbus.ByteArray("2".encode()), + dbus.ByteArray("3".encode()), dbus.ByteArray("4".encode()), + dbus.ByteArray("5".encode()), dbus.ByteArray("6".encode()), + dbus.ByteArray("7".encode()), dbus.ByteArray("8".encode()), + dbus.ByteArray("9".encode()), dbus.ByteArray("10".encode()), + dbus.ByteArray("11".encode()), dbus.ByteArray("12".encode()), + dbus.ByteArray("13".encode()), dbus.ByteArray("14".encode()), + dbus.ByteArray("15".encode()), dbus.ByteArray("16".encode()), + dbus.ByteArray("17".encode()) ]}, "InvalidArgs"), ({'Type': 'active', - 'SSIDs': [ dbus.ByteArray("1234567890abcdef1234567890abcdef1") ]}, + 'SSIDs': [ dbus.ByteArray("1234567890abcdef1234567890abcdef1".encode()) ]}, "InvalidArgs"), ({'Type': 'active', 'IEs': 'foo'}, "InvalidArgs"), ({'Type': 'active', 'IEs': ['foo']}, "InvalidArgs"), @@ -1023,9 +1028,9 @@ def test_dbus_scan_invalid(dev, apdev): 'Channels': [ (dbus.UInt32(2412), dbus.Int32(20)) ] }, "InvalidArgs"), ({'Type': 'active', 'AllowRoam': "yes" }, "InvalidArgs"), - ({'Type': 'passive', 'IEs': [ dbus.ByteArray("\xdd\x00") ]}, + ({'Type': 'passive', 'IEs': [ dbus.ByteArray(b"\xdd\x00") ]}, "InvalidArgs"), - ({'Type': 'passive', 'SSIDs': [ dbus.ByteArray("foo") ]}, + ({'Type': 'passive', 'SSIDs': [ dbus.ByteArray("foo".encode()) ]}, "InvalidArgs")] for (t,err) in tests: try: @@ -1056,14 +1061,14 @@ def test_dbus_scan_oom(dev, apdev): "=wpas_dbus_get_scan_ies;wpas_dbus_handler_scan", "Scan"): iface.Scan({ 'Type': 'active', - 'IEs': [ dbus.ByteArray("\xdd\x00") ], + 'IEs': [ dbus.ByteArray(b"\xdd\x00") ], 'Channels': [ (dbus.UInt32(2412), dbus.UInt32(20)) ] }) with alloc_fail_dbus(dev[0], 1, "=wpas_dbus_get_scan_ssids;wpas_dbus_handler_scan", "Scan"): iface.Scan({ 'Type': 'active', - 'SSIDs': [ dbus.ByteArray("open"), + 'SSIDs': [ dbus.ByteArray("open".encode()), dbus.ByteArray() ], 'Channels': [ (dbus.UInt32(2412), dbus.UInt32(20)) ] }) @@ -1082,8 +1087,8 @@ def test_dbus_scan(dev, apdev): self.fail_reason = None def __enter__(self): - gobject.timeout_add(1, self.run_scan) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_scan) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.scanDone, WPAS_DBUS_IFACE, "ScanDone") self.add_signal(self.bssAdded, WPAS_DBUS_IFACE, "BSSAdded") self.add_signal(self.bssRemoved, WPAS_DBUS_IFACE, "BSSRemoved") @@ -1120,9 +1125,9 @@ def test_dbus_scan(dev, apdev): def run_scan(self, *args): logger.debug("run_scan") iface.Scan({'Type': 'active', - 'SSIDs': [ dbus.ByteArray("open"), + 'SSIDs': [ dbus.ByteArray("open".encode()), dbus.ByteArray() ], - 'IEs': [ dbus.ByteArray("\xdd\x00"), + 'IEs': [ dbus.ByteArray(b"\xdd\x00"), dbus.ByteArray() ], 'AllowRoam': False, 'Channels': [(dbus.UInt32(2412), dbus.UInt32(20))]}) @@ -1211,8 +1216,8 @@ def test_dbus_connect(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.networkAdded, WPAS_DBUS_IFACE, "NetworkAdded") self.add_signal(self.networkRemoved, WPAS_DBUS_IFACE, "NetworkRemoved") @@ -1311,8 +1316,8 @@ def test_dbus_connect_psk_mem(dev, apdev): self.connected = False def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.add_signal(self.networkRequest, WPAS_DBUS_IFACE, @@ -1371,8 +1376,8 @@ def test_dbus_connect_oom(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(1500, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(1500, self.timeout) self.add_signal(self.networkAdded, WPAS_DBUS_IFACE, "NetworkAdded") self.add_signal(self.networkRemoved, WPAS_DBUS_IFACE, "NetworkRemoved") @@ -1530,8 +1535,8 @@ def test_dbus_connect_eap(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.add_signal(self.certification, WPAS_DBUS_IFACE, @@ -1793,7 +1798,7 @@ def test_dbus_network_oom(dev, apdev): tests = [ (1, 'wpa_dbus_dict_get_entry;set_network_properties;wpas_dbus_handler_add_network', - dbus.Dictionary({ 'ssid': dbus.ByteArray(' ') }, + dbus.Dictionary({ 'ssid': dbus.ByteArray(' '.encode()) }, signature='sv')), (1, '=set_network_properties;wpas_dbus_handler_add_network', dbus.Dictionary({ 'ssid': 'foo' }, signature='sv')), @@ -1806,7 +1811,7 @@ def test_dbus_network_oom(dev, apdev): dbus.Dictionary({ 'priority': dbus.Int32(1) }, signature='sv')), (1, '=set_network_properties;wpas_dbus_handler_add_network', - dbus.Dictionary({ 'ssid': dbus.ByteArray(' ') }, + dbus.Dictionary({ 'ssid': dbus.ByteArray(' '.encode()) }, signature='sv')) ] for (count,funcs,args) in tests: with alloc_fail_dbus(dev[0], count, funcs, "AddNetwork", "InvalidArgs"): @@ -1934,10 +1939,10 @@ def test_dbus_blob(dev, apdev): (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) iface = dbus.Interface(if_obj, WPAS_DBUS_IFACE) - blob = dbus.ByteArray("\x01\x02\x03") + blob = dbus.ByteArray(b"\x01\x02\x03") iface.AddBlob('blob1', blob) try: - iface.AddBlob('blob1', dbus.ByteArray("\x01\x02\x04")) + iface.AddBlob('blob1', dbus.ByteArray(b"\x01\x02\x04")) raise Exception("Invalid AddBlob() accepted") except dbus.exceptions.DBusException as e: if "BlobExists" not in str(e): @@ -1973,8 +1978,8 @@ def test_dbus_blob(dev, apdev): self.blob_removed = False def __enter__(self): - gobject.timeout_add(1, self.run_blob) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_blob) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.blobAdded, WPAS_DBUS_IFACE, "BlobAdded") self.add_signal(self.blobRemoved, WPAS_DBUS_IFACE, "BlobRemoved") self.loop.run() @@ -1993,7 +1998,7 @@ def test_dbus_blob(dev, apdev): def run_blob(self, *args): logger.debug("run_blob") - iface.AddBlob('blob2', dbus.ByteArray("\x01\x02\x04")) + iface.AddBlob('blob2', dbus.ByteArray(b"\x01\x02\x04")) iface.RemoveBlob('blob2') return False @@ -2012,7 +2017,7 @@ def test_dbus_blob_oom(dev, apdev): for i in range(1, 4): with alloc_fail_dbus(dev[0], i, "wpas_dbus_handler_add_blob", "AddBlob"): - iface.AddBlob('blob_no_mem', dbus.ByteArray("\x01\x02\x03\x04")) + iface.AddBlob('blob_no_mem', dbus.ByteArray(b"\x01\x02\x03\x04")) def test_dbus_autoscan(dev, apdev): """D-Bus Autoscan()""" @@ -2121,8 +2126,8 @@ def test_dbus_tdls(dev, apdev): self.tdls_teardown = False def __enter__(self): - gobject.timeout_add(1, self.run_tdls) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_tdls) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.loop.run() @@ -2134,13 +2139,13 @@ def test_dbus_tdls(dev, apdev): def run_tdls(self, *args): logger.debug("run_tdls") iface.TDLSDiscover(addr1) - gobject.timeout_add(100, self.run_tdls2) + GObject.timeout_add(100, self.run_tdls2) return False def run_tdls2(self, *args): logger.debug("run_tdls2") iface.TDLSSetup(addr1) - gobject.timeout_add(500, self.run_tdls3) + GObject.timeout_add(500, self.run_tdls3) return False def run_tdls3(self, *args): @@ -2151,7 +2156,7 @@ def test_dbus_tdls(dev, apdev): else: logger.info("Unexpected TDLSStatus: " + res) iface.TDLSTeardown(addr1) - gobject.timeout_add(200, self.run_tdls4) + GObject.timeout_add(200, self.run_tdls4) return False def run_tdls4(self, *args): @@ -2192,8 +2197,8 @@ def test_dbus_tdls_channel_switch(dev, apdev): self.tdls_done = False def __enter__(self): - gobject.timeout_add(1, self.run_tdls) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_tdls) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.loop.run() @@ -2205,13 +2210,13 @@ def test_dbus_tdls_channel_switch(dev, apdev): def run_tdls(self, *args): logger.debug("run_tdls") iface.TDLSDiscover(addr1) - gobject.timeout_add(100, self.run_tdls2) + GObject.timeout_add(100, self.run_tdls2) return False def run_tdls2(self, *args): logger.debug("run_tdls2") iface.TDLSSetup(addr1) - gobject.timeout_add(500, self.run_tdls3) + GObject.timeout_add(500, self.run_tdls3) return False def run_tdls3(self, *args): @@ -2271,7 +2276,7 @@ def test_dbus_tdls_channel_switch(dev, apdev): signature='sv') iface.TDLSChannelSwitch(args) - gobject.timeout_add(200, self.run_tdls4) + GObject.timeout_add(200, self.run_tdls4) return False def run_tdls4(self, *args): @@ -2587,8 +2592,8 @@ def test_dbus_probe_req_reporting(dev, apdev): self.reported = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, "GroupStarted") self.add_signal(self.probeRequest, WPAS_DBUS_IFACE, "ProbeRequest", @@ -2704,8 +2709,8 @@ def test_dbus_p2p_invalid(dev, apdev): {'RequestedDeviceTypes': dbus.Array([], signature="s")}, {'RequestedDeviceTypes': dbus.Array([['foo']], signature="as")}, {'RequestedDeviceTypes': dbus.Array([], signature="i")}, - {'RequestedDeviceTypes': [dbus.ByteArray('12345678'), - dbus.ByteArray('1234567')]}, + {'RequestedDeviceTypes': [dbus.ByteArray('12345678'.encode()), + dbus.ByteArray('1234567'.encode())]}, {'Foo': dbus.Int16(1)}, {'Foo': dbus.UInt16(1)}, {'Foo': dbus.Int64(1)}, @@ -2904,29 +2909,29 @@ def test_dbus_p2p_oom(dev, apdev): with alloc_fail_dbus(dev[0], 1, ":=_wpa_dbus_dict_entry_get_binarray", "Find", "InvalidArgs"): - p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123') ] })) + p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123'.encode()) ] })) with alloc_fail_dbus(dev[0], 1, "_wpa_dbus_dict_entry_get_byte_array;_wpa_dbus_dict_entry_get_binarray", "Find", "InvalidArgs"): - p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123') ] })) + p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123'.encode()) ] })) with alloc_fail_dbus(dev[0], 2, "=_wpa_dbus_dict_entry_get_binarray", "Find", "InvalidArgs"): - p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123'), - dbus.ByteArray('123') ] })) + p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()), + dbus.ByteArray('123'.encode()) ] })) with alloc_fail_dbus(dev[0], 1, "wpabuf_alloc_ext_data;_wpa_dbus_dict_entry_get_binarray", "Find", "InvalidArgs"): - p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123') ] })) + p2p.Find(dbus.Dictionary({ 'Foo': [ dbus.ByteArray('123'.encode()) ] })) with alloc_fail_dbus(dev[0], 1, "_wpa_dbus_dict_fill_value_from_variant;wpas_dbus_handler_p2p_find", "Find", "InvalidArgs"): @@ -2935,7 +2940,7 @@ def test_dbus_p2p_oom(dev, apdev): with alloc_fail_dbus(dev[0], 1, "_wpa_dbus_dict_entry_get_byte_array", "AddService", "InvalidArgs"): args = { 'service_type': 'bonjour', - 'response': dbus.ByteArray(500*'b') } + 'response': dbus.ByteArray(500 * b'b') } p2p.AddService(args) with alloc_fail_dbus(dev[0], 2, "_wpa_dbus_dict_entry_get_byte_array", @@ -2978,7 +2983,7 @@ def run_dbus_p2p_discovery(dev, apdev): raise Exception("Unexpected peer(s) in the list") args = {'DiscoveryType': 'social', - 'RequestedDeviceTypes': [dbus.ByteArray('12345678')], + 'RequestedDeviceTypes': [dbus.ByteArray('12345678'.encode())], 'Timeout': dbus.Int32(1) } p2p.Find(dbus.Dictionary(args)) p2p.StopFind() @@ -2993,8 +2998,8 @@ def run_dbus_p2p_discovery(dev, apdev): self.find_stopped = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.deviceFoundProperties, @@ -3029,7 +3034,7 @@ def run_dbus_p2p_discovery(dev, apdev): sec = res['SecondaryDeviceTypes'] if len(sec) < 1: raise Exception("Secondary device type missing") - if "\x00\x01\x00\x50\xF2\x04\x00\x02" not in sec: + if b"\x00\x01\x00\x50\xF2\x04\x00\x02" not in sec: raise Exception("Secondary device type mismatch") if 'VendorExtension' not in res: @@ -3037,7 +3042,7 @@ def run_dbus_p2p_discovery(dev, apdev): vendor = res['VendorExtension'] if len(vendor) < 1: raise Exception("Vendor extension missing") - if "\x11\x22\x33\x44" not in vendor: + if b"\x11\x22\x33\x44" not in vendor: raise Exception("Secondary device type mismatch") if 'VSIE' not in res: @@ -3045,7 +3050,7 @@ def run_dbus_p2p_discovery(dev, apdev): vendor = res['VSIE'] if len(vendor) < 1: raise Exception("VSIE missing") - if vendor != "\xdd\x06\x00\x11\x22\x33\x55\x66": + if vendor != b"\xdd\x06\x00\x11\x22\x33\x55\x66": raise Exception("VSIE mismatch") self.found = True @@ -3143,8 +3148,8 @@ def test_dbus_p2p_discovery_freq(dev, apdev): self.found = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(5000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(5000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.loop.run() @@ -3250,7 +3255,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): { 'service_type': 'bonjour', 'response': 'foo' }, { 'service_type': 'bonjour', 'query': bonjour_query }, { 'service_type': 'bonjour', 'response': bonjour_response }, - { 'service_type': 'bonjour', 'query': dbus.ByteArray(500*'a') }, + { 'service_type': 'bonjour', 'query': dbus.ByteArray(500 * b'a') }, { 'service_type': 'bonjour', 'foo': 'bar' } ] for args in tests: try: @@ -3260,7 +3265,7 @@ def test_dbus_p2p_service_discovery(dev, apdev): if "InvalidArgs" not in str(e): raise Exception("Unexpected error message for invalid AddService(): " + str(e)) - args = { 'tlv': dbus.ByteArray("\x02\x00\x00\x01") } + args = { 'tlv': dbus.ByteArray(b"\x02\x00\x00\x01") } ref = p2p.ServiceDiscoveryRequest(args) p2p.ServiceDiscoveryCancelRequest(ref) try: @@ -3335,8 +3340,8 @@ def test_dbus_p2p_service_discovery_query(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.serviceDiscoveryResponse, @@ -3348,7 +3353,7 @@ def test_dbus_p2p_service_discovery_query(dev, apdev): def deviceFound(self, path): logger.debug("deviceFound: path=%s" % path) args = { 'peer_object': path, - 'tlv': dbus.ByteArray("\x02\x00\x00\x01") } + 'tlv': dbus.ByteArray(b"\x02\x00\x00\x01") } p2p.ServiceDiscoveryRequest(args) def serviceDiscoveryResponse(self, sd_request): @@ -3396,8 +3401,8 @@ def _test_dbus_p2p_service_discovery_external(dev, apdev): self.sd = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.serviceDiscoveryRequest, @@ -3462,8 +3467,8 @@ def test_dbus_p2p_autogo(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, @@ -3553,7 +3558,10 @@ def test_dbus_p2p_autogo(dev, apdev): for p in peer: if len(addr) > 0: addr += ':' - addr += '%02x' % ord(p) + if type(p) == int: + addr += '%02x' % p + else: + addr += '%02x' % ord(p) params = { 'Role': 'registrar', 'P2PDeviceAddress': self.peer['DeviceAddress'], @@ -3598,7 +3606,7 @@ def test_dbus_p2p_autogo(dev, apdev): self.exceptions = True raise Exception("Unexpected number of group members") - ext = dbus.ByteArray("\x11\x22\x33\x44") + ext = dbus.ByteArray(b"\x11\x22\x33\x44") # Earlier implementation of this interface was a bit strange. The # property is defined to have aay signature and that is what the # getter returned. However, the setter expected there to be a @@ -3621,7 +3629,7 @@ def test_dbus_p2p_autogo(dev, apdev): # And now verify that the more appropriate encoding is accepted as # well. - res.append(dbus.ByteArray('\xaa\xbb\xcc\xdd\xee\xff')) + res.append(dbus.ByteArray(b'\xaa\xbb\xcc\xdd\xee\xff')) g_obj.Set(WPAS_DBUS_GROUP, 'WPSVendorExtensions', res, dbus_interface=dbus.PROPERTIES_IFACE) res2 = g_obj.Get(WPAS_DBUS_GROUP, 'WPSVendorExtensions', @@ -3635,7 +3643,7 @@ def test_dbus_p2p_autogo(dev, apdev): raise Exception("Vendor extension value changed") for i in range(10): - res.append(dbus.ByteArray('\xaa\xbb')) + res.append(dbus.ByteArray(b'\xaa\xbb')) try: g_obj.Set(WPAS_DBUS_GROUP, 'WPSVendorExtensions', res, dbus_interface=dbus.PROPERTIES_IFACE) @@ -3722,8 +3730,8 @@ def test_dbus_p2p_autogo_pbc(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, @@ -3767,7 +3775,10 @@ def test_dbus_p2p_autogo_pbc(dev, apdev): for p in peer: if len(addr) > 0: addr += ':' - addr += '%02x' % ord(p) + if type(p) == int: + addr += '%02x' % p + else: + addr += '%02x' % ord(p) params = { 'Role': 'registrar', 'P2PDeviceAddress': self.peer['DeviceAddress'], 'Type': 'pbc' } @@ -3810,8 +3821,8 @@ def test_dbus_p2p_autogo_legacy(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, "GroupStarted") self.add_signal(self.groupFinished, WPAS_DBUS_IFACE_P2PDEVICE, @@ -3828,7 +3839,12 @@ def test_dbus_p2p_autogo_legacy(dev, apdev): res = g_obj.GetAll(WPAS_DBUS_GROUP, dbus_interface=dbus.PROPERTIES_IFACE, byte_arrays=True) - bssid = ':'.join([binascii.hexlify(l) for l in res['BSSID']]) + if sys.version_info[0] > 2: + bssid = "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( + res['BSSID'][0], res['BSSID'][1], res['BSSID'][2], + res['BSSID'][3], res['BSSID'][4], res['BSSID'][5]) + else: + bssid = ':'.join([binascii.hexlify(l) for l in res['BSSID']]) pin = '12345670' params = { 'Role': 'enrollee', @@ -3886,8 +3902,8 @@ def test_dbus_p2p_join(dev, apdev): self.go = None def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, @@ -3947,7 +3963,7 @@ def test_dbus_p2p_join(dev, apdev): byte_arrays=True) logger.debug("Group properties: " + str(res)) - ext = dbus.ByteArray("\x11\x22\x33\x44") + ext = dbus.ByteArray(b"\x11\x22\x33\x44") try: # Set(WPSVendorExtensions) not allowed for P2P Client g_obj.Set(WPAS_DBUS_GROUP, 'WPSVendorExtensions', res, @@ -4012,8 +4028,8 @@ def test_dbus_p2p_invitation_received(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.invitationReceived, WPAS_DBUS_IFACE_P2PDEVICE, "InvitationReceived") self.loop.run() @@ -4068,8 +4084,8 @@ def _test_dbus_p2p_config(dev, apdev): raise Exception("Parameter %s value changes" % k) changes = { 'SsidPostfix': 'foo', - 'VendorExtension': [ dbus.ByteArray('\x11\x22\x33\x44') ], - 'SecondaryDeviceTypes': [ dbus.ByteArray('\x11\x22\x33\x44\x55\x66\x77\x88') ]} + 'VendorExtension': [ dbus.ByteArray(b'\x11\x22\x33\x44') ], + 'SecondaryDeviceTypes': [ dbus.ByteArray(b'\x11\x22\x33\x44\x55\x66\x77\x88') ]} if_obj.Set(WPAS_DBUS_IFACE_P2PDEVICE, "P2PDeviceConfig", dbus.Dictionary(changes, signature='sv'), dbus_interface=dbus.PROPERTIES_IFACE) @@ -4147,8 +4163,8 @@ def test_dbus_p2p_persistent(dev, apdev): TestDbus.__init__(self, bus) def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, "GroupStarted") self.add_signal(self.groupFinished, WPAS_DBUS_IFACE_P2PDEVICE, @@ -4246,8 +4262,8 @@ def test_dbus_p2p_reinvoke_persistent(dev, apdev): self.invited = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, @@ -4275,7 +4291,12 @@ def test_dbus_p2p_reinvoke_persistent(dev, apdev): res = g_obj.GetAll(WPAS_DBUS_GROUP, dbus_interface=dbus.PROPERTIES_IFACE, byte_arrays=True) - bssid = ':'.join([binascii.hexlify(l) for l in res['BSSID']]) + if sys.version_info[0] > 2: + bssid = "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( + res['BSSID'][0], res['BSSID'][1], res['BSSID'][2], + res['BSSID'][3], res['BSSID'][4], res['BSSID'][5]) + else: + bssid = ':'.join([binascii.hexlify(l) for l in res['BSSID']]) dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1') dev1.scan_for_bss(bssid, freq=2412) dev1.global_request("P2P_CONNECT " + addr0 + " 12345670 join") @@ -4328,7 +4349,10 @@ def test_dbus_p2p_reinvoke_persistent(dev, apdev): for p in peer: if len(addr) > 0: addr += ':' - addr += '%02x' % ord(p) + if type(p) == int: + addr += '%02x' % p + else: + addr += '%02x' % ord(p) params = { 'Role': 'registrar', 'P2PDeviceAddress': self.peer['DeviceAddress'], 'Bssid': self.peer['DeviceAddress'], @@ -4381,8 +4405,8 @@ def test_dbus_p2p_go_neg_rx(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.goNegotiationRequest, @@ -4466,8 +4490,8 @@ def test_dbus_p2p_go_neg_auth(dev, apdev): self.peer_disconnected = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.goNegotiationSuccess, @@ -4567,8 +4591,8 @@ def test_dbus_p2p_go_neg_init(dev, apdev): self.peer_group_removed = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.goNegotiationSuccess, @@ -4662,8 +4686,8 @@ def test_dbus_p2p_group_termination_by_go(dev, apdev): self.peer_group_removed = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.goNegotiationSuccess, @@ -4758,8 +4782,8 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev): self.peer_group_removed = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.add_signal(self.goNegotiationSuccess, @@ -4852,8 +4876,8 @@ def test_dbus_p2p_wps_failure(dev, apdev): self.formation_failure = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.goNegotiationRequest, WPAS_DBUS_IFACE_P2PDEVICE, "GONegotiationRequest", @@ -4938,8 +4962,8 @@ def test_dbus_p2p_two_groups(dev, apdev): self.groups_removed = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, dbus.PROPERTIES_IFACE, "PropertiesChanged", byte_arrays=True) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, @@ -5017,7 +5041,12 @@ def test_dbus_p2p_two_groups(dev, apdev): g_wps = dbus.Interface(self.g2_if_obj, WPAS_DBUS_IFACE_WPS) g_wps.Start(params) - bssid = ':'.join([binascii.hexlify(l) for l in self.g2_bssid]) + if sys.version_info[0] > 2: + bssid = "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( + self.g2_bssid[0], self.g2_bssid[1], self.g2_bssid[2], + self.g2_bssid[3], self.g2_bssid[4], self.g2_bssid[5]) + else: + bssid = ':'.join([binascii.hexlify(l) for l in self.g2_bssid]) dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2') dev2.scan_for_bss(bssid, freq=2412) dev2.global_request("P2P_CONNECT " + bssid + " 12345670 join freq=2412") @@ -5125,8 +5154,8 @@ def test_dbus_p2p_cancel(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFound") self.loop.run() @@ -5195,8 +5224,8 @@ def test_dbus_p2p_ip_addr(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.groupStarted, WPAS_DBUS_IFACE_P2PDEVICE, "GroupStarted") self.loop.run() @@ -5280,8 +5309,8 @@ def run_busctl(service, obj): cmd.wait() logger.info("busctl stdout:\n%s" % out[0].strip()) if len(out[1]) > 0: - logger.info("busctl stderr: %s" % out[1].strip()) - if "Duplicate property" in out[1]: + logger.info("busctl stderr: %s" % out[1].decode().strip()) + if "Duplicate property" in out[1].decode(): raise Exception("Duplicate property") def test_dbus_introspect_busctl(dev, apdev): @@ -5321,8 +5350,8 @@ def test_dbus_ap(dev, apdev): self.stations = False def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.networkAdded, WPAS_DBUS_IFACE, "NetworkAdded") self.add_signal(self.networkSelected, WPAS_DBUS_IFACE, "NetworkSelected") @@ -5424,8 +5453,8 @@ def test_dbus_connect_wpa_eap(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.add_signal(self.eap, WPAS_DBUS_IFACE, "EAP") @@ -5554,7 +5583,7 @@ def _test_dbus_vendor_elem(dev, apdev): dev[0].request("VENDOR_ELEM_REMOVE 1 *") try: - ie = dbus.ByteArray("\x00\x00") + ie = dbus.ByteArray(b"\x00\x00") iface.VendorElemAdd(-1, ie) raise Exception("Invalid VendorElemAdd() accepted") except dbus.exceptions.DBusException as e: @@ -5562,7 +5591,7 @@ def _test_dbus_vendor_elem(dev, apdev): raise Exception("Unexpected error message for invalid VendorElemAdd[1]: " + str(e)) try: - ie = dbus.ByteArray("") + ie = dbus.ByteArray(bytes()) iface.VendorElemAdd(1, ie) raise Exception("Invalid VendorElemAdd() accepted") except dbus.exceptions.DBusException as e: @@ -5570,7 +5599,7 @@ def _test_dbus_vendor_elem(dev, apdev): raise Exception("Unexpected error message for invalid VendorElemAdd[2]: " + str(e)) try: - ie = dbus.ByteArray("\x00\x01") + ie = dbus.ByteArray(b"\x00\x01") iface.VendorElemAdd(1, ie) raise Exception("Invalid VendorElemAdd() accepted") except dbus.exceptions.DBusException as e: @@ -5592,7 +5621,7 @@ def _test_dbus_vendor_elem(dev, apdev): raise Exception("Unexpected error message for invalid VendorElemGet[2]: " + str(e)) try: - ie = dbus.ByteArray("\x00\x00") + ie = dbus.ByteArray(b"\x00\x00") iface.VendorElemRem(-1, ie) raise Exception("Invalid VendorElemRemove() accepted") except dbus.exceptions.DBusException as e: @@ -5600,16 +5629,16 @@ def _test_dbus_vendor_elem(dev, apdev): raise Exception("Unexpected error message for invalid VendorElemRemove[1]: " + str(e)) try: - ie = dbus.ByteArray("") + ie = dbus.ByteArray(bytes()) iface.VendorElemRem(1, ie) raise Exception("Invalid VendorElemRemove() accepted") except dbus.exceptions.DBusException as e: if "InvalidArgs" not in str(e) or "Invalid value" not in str(e): raise Exception("Unexpected error message for invalid VendorElemRemove[1]: " + str(e)) - iface.VendorElemRem(1, "*") + iface.VendorElemRem(1, "*".encode()) - ie = dbus.ByteArray("\x00\x01\x00") + ie = dbus.ByteArray(b"\x00\x01\x00") iface.VendorElemAdd(1, ie) val = iface.VendorElemGet(1) @@ -5619,7 +5648,7 @@ def _test_dbus_vendor_elem(dev, apdev): if val[i] != dbus.Byte(ie[i]): raise Exception("Unexpected VendorElemGet data") - ie2 = dbus.ByteArray("\xe0\x00") + ie2 = dbus.ByteArray(b"\xe0\x00") iface.VendorElemAdd(1, ie2) ies = ie + ie2 @@ -5631,7 +5660,7 @@ def _test_dbus_vendor_elem(dev, apdev): raise Exception("Unexpected VendorElemGet data[2]") try: - test_ie = dbus.ByteArray("\x01\x01") + test_ie = dbus.ByteArray(b"\x01\x01") iface.VendorElemRem(1, test_ie) raise Exception("Invalid VendorElemRemove() accepted") except dbus.exceptions.DBusException as e: @@ -5643,7 +5672,7 @@ def _test_dbus_vendor_elem(dev, apdev): if len(val) != len(ie2): raise Exception("Unexpected VendorElemGet length[3]") - iface.VendorElemRem(1, "*") + iface.VendorElemRem(1, "*".encode()) try: iface.VendorElemGet(1) raise Exception("Invalid VendorElemGet() accepted after removal") @@ -5668,8 +5697,8 @@ def test_dbus_assoc_reject(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.propertiesChanged, WPAS_DBUS_IFACE, "PropertiesChanged") self.loop.run() @@ -5717,8 +5746,8 @@ def test_dbus_mesh(dev, apdev): self.done = False def __enter__(self): - gobject.timeout_add(1, self.run_test) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_test) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.meshGroupStarted, WPAS_DBUS_IFACE_MESH, "MeshGroupStarted") self.add_signal(self.meshGroupRemoved, WPAS_DBUS_IFACE_MESH, @@ -5747,14 +5776,14 @@ def test_dbus_mesh(dev, apdev): logger.debug("MeshPeers: " + str(res)) if len(res) != 1: raise Exception("Unexpected number of MeshPeer values") - if binascii.hexlify(res[0]) != addr1.replace(':', ''): + if binascii.hexlify(res[0]).decode() != addr1.replace(':', ''): raise Exception("Unexpected peer address") res = if_obj.Get(WPAS_DBUS_IFACE_MESH, 'MeshGroup', dbus_interface=dbus.PROPERTIES_IFACE, byte_arrays=True) logger.debug("MeshGroup: " + str(res)) - if res != "wpas-mesh-open": + if res.decode() != "wpas-mesh-open": raise Exception("Unexpected MeshGroup") dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1') dev1.mesh_group_remove() From patchwork Thu Jan 24 07:46:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F35y/o7n"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Dyzn/L6H"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ861ffRz9s9h for ; Thu, 24 Jan 2019 18:50:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=e1/PE2OKD12m/lXwAvI5G/e7VsC5kRHGQUlvGEP1xss=; b=F35y/o7nYoz4VxEzAf01Ysnxbl 0UahWd7zx7vJPlsGKDz2GG8HCME0FHLZB+5hp5aUC5o0SU0E+qamfYN20Mm93DdcQVoYo9/uM2Zm5 EXj1rpIcp7gx7iYuIzJvMuOerA+VfbsU5E7bFcgKBc49ws9V8MKIyGNXGQ6g337rujInKwVZMXXnG tjbxtSHMuVdxv6AMhB5eTypdFtts1adxTtA3mFZe0oG6XqcP4le6DQeqJtjeF3wp4W0DKhEQ8dXsL xxXLP4XzP+ySKh1l2MqQh6gFDk7QryEkqq5713kAfLTSxyfsJ22n7IxP88rk4Q3R8jZHY2fwCxS+L 8/RJo/iQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZmE-0001LU-J3; Thu, 24 Jan 2019 07:50:18 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjP-00067b-H8 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:55 +0000 Received: by mail-pl1-x642.google.com with SMTP id e5so2515926plb.5 for ; Wed, 23 Jan 2019 23:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b5uQSFpepGCKYfSAQJ8OO46BuraUoVC1H44m+QnpZ4Y=; b=Dyzn/L6HTkiRNOKEYrJoDrLAMBr0Lk87E/H3JA+DrURlszwBfk4IDP6tSM1BzesERO RwVWoBrslLEgnNWCwo7t0jJ7cnMMAvo113Iu5gyalA64xbGr3sV8xMskKsibJKu3Twhe IrTLCZO+GxoPD9EUEzaA5lwQ0+Pd5yJI4bTF7lljQurh6PMm17M+n0XafupXhA6/ye9G vxB0slFuSrjkboVN3m9KqEU4FS5rj/Mlzn1hpGipOk2C6GVhfdGqdMp092LjuhlpcXYC Ff6UEKERUVvCbM/Up89mAi/ReE3oQKodh0a5HoyhteZFJIMqTAgayOiScEq+QKTF6Dd0 59dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b5uQSFpepGCKYfSAQJ8OO46BuraUoVC1H44m+QnpZ4Y=; b=G/NFy5z4TUhC+NrSgCfaD1HGpvVl3ACALaYT2kwSeIvAk1EeT/aGzU5WocLfZCctOG vumzwqqJctSIW4NwXB+MxgXNIPEpdIiP7TK96dx0U+Ruf6hcDLSc6xUy7LpgXSKJk4dE Bl0Vpo3uoEaPhE5MTAyGLoe5mMO7nmMuUcng9IApA+6UKPzoW4oD35SEpek9aiDXblhw GwETOVcqjm+8y+gdJknFWnI7F5Ng9mFqlFLpnQNFLHXo6FG63BEPIj6+BRm8PZWmvQ1s 0xubqXWTeVUwtQxLmaRChA/rxbGZkkuMdhcsJqiLD69z8+mDkxp0kQzbHsnHJmIQW9Cp LbmA== X-Gm-Message-State: AJcUukcSynHXVw1aCUh3vFa3Jpd1sibyJV7WgmWFEfDrlOGI0n2HnEpz ygti7qgTiyzjgp46nN7Db0RR3QMz X-Google-Smtp-Source: ALg8bN5ZNJH+W55pA+O/w2o6A+uazMYWm7oGOmTuBBjI9tAQMmq1FNIaekbHoFHItA2c3IRWzAG0Ew== X-Received: by 2002:a17:902:850c:: with SMTP id bj12mr5463052plb.46.1548316042403; Wed, 23 Jan 2019 23:47:22 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:21 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 22/50] tests: Modify dbus_old test sets for python3 Date: Thu, 24 Jan 2019 16:46:02 +0900 Message-Id: <20190124074630.4192-23-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234724_182785_C08E4053 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_dbus_old.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/test_dbus_old.py b/tests/hwsim/test_dbus_old.py index bb6043e7e..806c03175 100644 --- a/tests/hwsim/test_dbus_old.py +++ b/tests/hwsim/test_dbus_old.py @@ -4,11 +4,16 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. +import sys import logging logger = logging.getLogger() +if sys.version_info[0] > 2: + from gi.repository import GObject +else: + import gobject as GObject + try: - import gobject import dbus dbus_imported = True except ImportError: @@ -45,8 +50,8 @@ class TestDbusOldWps(TestDbus): self.event_ok = False def __enter__(self): - gobject.timeout_add(1, self.run_wps) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_wps) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsCred, WPAS_DBUS_OLD_IFACE, "WpsCred") self.loop.run() return self @@ -123,8 +128,8 @@ def test_dbus_old_scan(dev, apdev): self.scan_completed = False def __enter__(self): - gobject.timeout_add(1, self.run_scan) - gobject.timeout_add(7000, self.timeout) + GObject.timeout_add(1, self.run_scan) + GObject.timeout_add(7000, self.timeout) self.add_signal(self.scanDone, WPAS_DBUS_OLD_IFACE, "ScanResultsAvailable") self.loop.run() @@ -489,8 +494,8 @@ def test_dbus_old_connect(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.scanDone, WPAS_DBUS_OLD_IFACE, "ScanResultsAvailable") self.add_signal(self.stateChange, WPAS_DBUS_OLD_IFACE, @@ -579,8 +584,8 @@ def test_dbus_old_connect_eap(dev, apdev): self.certification_received = False def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.stateChange, WPAS_DBUS_OLD_IFACE, "StateChange") self.add_signal(self.certification, WPAS_DBUS_OLD_IFACE, From patchwork Thu Jan 24 07:46:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eCanUfn1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="wqzHoVDp"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XhTR4Oho"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZcl6JSnz9s4s for ; Thu, 24 Jan 2019 19:11:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=eGiFiwPvdHwd3ZqwNKxbc/AaJq2jCP3Mh1N4bN/Vf2k=; b=eCanUfn1Vca+QqM1HeNrKIuScT vL8BJ1bX2HEFnVusg0H4Ah5Sc+NIKLhwjnDoAskekxxpYxNCttMh6n/bDETrJPdY6JZ7UJ7dC53xE 3YWC+NQp4y/N/u2OkSi7PS0bc9is9Omh8lxI/IXYxmOonIBZrZraaIIKpeQGmY85W/CcMTwEIgtfG dNBbY2gu0qLMRaHWhrFdZmmvM6zGEa1B/uy8qWCCIbHjBJqFRLfKy0qRqgVnlscJ11O4kjql4yGH4 PHB2Rd981yyda9zswjaIqYcXqmKu018xc4cSEZOildJg1O06iA8AJZnQktnErQ14egOxVhIysXKP5 EDqonCBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma6v-0007DX-Ns; Thu, 24 Jan 2019 08:11:41 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma69-0006Ht-7J for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZB6YlFJWhcu4qkwFozhTeiXuD/tBBLbooLSZaWOnp/c=; b=wqzHoVDpfXtbAWHv6GF1lmJSR WCWCs2tlynTK491/VNEmoGouCViI3vx61UG2+0jUSdjgE6FstRPFiUQ4fpLcULSZICxahFy5jgVjq CODmSUQdTXidbl/HjfHb0KtW9XXdNpiOMLAPs9EjI0Selv54O1rO6+kRpcjHL1mcfdPKoaxSZPXAC XWpuUCXSbrkFYyy08so3iv7NQpBVDnVw9ytn7ZD92n4NhAUehn0CwKJLaQ9jcA0+ka3TkocVZETHy 71zfIvf1qYu6olcy2EB/qnOKLgHhXmmkpXdxtZhPut0Z0avgZbluj8UsjlG/LOFTiUjV0L5hzr9Tl iXmz4nUlA==; Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjT-0006bp-AN for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:28 +0000 Received: by mail-pl1-x634.google.com with SMTP id t13so2491101ply.13 for ; Wed, 23 Jan 2019 23:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZB6YlFJWhcu4qkwFozhTeiXuD/tBBLbooLSZaWOnp/c=; b=XhTR4OhoZIFPdJonUPyB/eFdgU1BWcte312b5N47wcYsIqD1YjThJgg55C2u8N59MA 4iX3MKKeroun9QuLLoGJSTXdZJFncjB/2Au6FsFIEuiXCEttfevpYdcg/jLx/hepdciG sPwPjaMB1Z4TGq0M5LZvDVE1DVNWfw5Kpi+7Oc5LgPOacYdSMjOMT6L0U2mGBQ41xUgt myVP6HYzoU0wc37gSTLpzyQWkwxhmLIK0hJLurJU22FJtpBhrhy939oAdZVqJ5JwZB0s 2BMvcYpr3WTN1TQMlNiZrPc0VIhuNEYtpUJu/nQZum/MeOty4t/WC0GQlU6surBjGAYM L30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZB6YlFJWhcu4qkwFozhTeiXuD/tBBLbooLSZaWOnp/c=; b=rC5T0T2xS3SGbNi0IcP6SUWJZSOLSlM1Rox7OJteIdEWZj4lwQR5VfXaUIyNC0G2en Mli3NYzaDINewDUFEwbfpKZKqwvoFsKaRzW82/JCGMMYDBE+xGGfv5uk/hMjQ7kC1PsB pVog5D2au2FxeLfVVIxJLpzh2NALqUzKIZy6GLE6yxeNeG5q9kxL+973gOIKIYo5F2fF XoGxc9VLJA961l6Bp0YGlWatnyvV+JKWBiim0Hql/7c051FLPHsLajx5f8Z5vrJWNwJb n+s2Fi7oGqXGHOgpqRmMWcarsLjcY329rOB8Q01TyUiC+CRQa+rGRTnMgpvP19vbDra5 ogqg== X-Gm-Message-State: AJcUukcDZNzVQRVr2ZExpOcG1jffddNIZtRTYlbOxZjA/Q5uVB0aayyu nc/vWARnLFLVrKk/TXQUVHfb8Yb6 X-Google-Smtp-Source: ALg8bN6rCrHOQIVo5fpXx+74YXdo4qGe8ZjQoXcGHhVZyYx7NA/jx2Ad6ClthlrCTEngoW9CGXL2Ww== X-Received: by 2002:a17:902:1105:: with SMTP id d5mr5367119pla.47.1548316044105; Wed, 23 Jan 2019 23:47:24 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:23 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 23/50] tests: Modify dpp test sets for python3 Date: Thu, 24 Jan 2019 16:46:03 +0900 Message-Id: <20190124074630.4192-24-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024727_392681_3EF32386 X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:634 listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_dpp.py | 71 ++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index c02b17fad..aa155a8b2 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -57,7 +57,7 @@ def test_dpp_qr_code_parsing(dev, apdev): "DPP:;;", "DPP:C:1/2;M:;K;;", "DPP:I:;M:01020304050;K:MDkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDIgADURzxmttZoIRIPWGoQMV00XHWCAQIhXruVWOz0NjlkIA=;;", - "DPP:K:" + base64.b64encode("hello") + ";;", + "DPP:K:" + base64.b64encode("hello".encode()).decode() + ";;", "DPP:K:MEkwEwYHKoZIzj0CAQYIKoZIzj0DAQEDMgAEXiJuIWt1Q/CPCkuULechh37UsXPmbUANOeN5U9sOQROE4o/NEFeFEejROHYwwehF;;", "DPP:K:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANNZaZA4T/kRDjnmpI1ACOJhAuTIIEk2KFOpS6XPpGF+EVr/ao3XemkE0/nzXmGaLzLqTUCJknSdxTnVPeWfCVsCAwEAAQ==;;", "DPP:K:MIIBCjCB0wYHKoZIzj0CATCBxwIBATAkBgcqhkjOPQEBAhkA/////////////////////v//////////MEsEGP////////////////////7//////////AQYZCEFGeWcgOcPp+mrciQwSf643uzBRrmxAxUAMEWub8hCL2TtV5Uo04Eg6uEhltUEMQQYjagOsDCQ9ny/IOtDoYgA9P8K/YL/EBIHGSuV/8jaeGMQEe1rJM3Vc/l3oR55SBECGQD///////////////+Z3vg2FGvJsbTSKDECAQEDMgAEXiJuIWt1Q/CPCkuULechh37UsXPmbUANOeN5U9sOQROE4o/NEFeFEejROHYwwehF;;", @@ -1115,7 +1115,7 @@ def test_dpp_config_fragmentation(dev, apdev): def test_dpp_config_legacy_gen(dev, apdev): """Generate DPP Config Object for legacy network""" run_dpp_qr_code_auth_unicast(dev, apdev, "prime256v1", - init_extra="conf=sta-psk pass=%s" % "passphrase".encode("hex"), + init_extra="conf=sta-psk pass=%s" % binascii.hexlify("passphrase".encode()).decode(), require_conf_success=True) def test_dpp_config_legacy_gen_psk(dev, apdev): @@ -1290,8 +1290,8 @@ def build_conf_obj(kty="EC", crv="P-256", elif not no_signed_connector: payload = '{"groups":[{"groupId":"*","netRole":"sta"}],"netAccessKey":{"kty":"EC","crv":"P-256","x":"aTF4JEGIPKSZ0Xv9zdCMjm-tn5XpMsYIVZ9wySAz1gI","y":"QGcHWA_6rbU9XDXAztoX-M5Q3suTnMaqEhULtn7SSXw"}}' sign = "_sm6YswxMf6hJLVTyYoU1uYUeY2VVkUNjrzjSiEhY42StD_RWowStEE-9CRsdCvLmsTptZ72_g40vTFwdId20A" - conn = base64.urlsafe_b64encode(prot_hdr).rstrip('=') + '.' - conn += base64.urlsafe_b64encode(payload).rstrip('=') + '.' + conn = base64.urlsafe_b64encode(prot_hdr.encode()).decode().rstrip('=') + '.' + conn += base64.urlsafe_b64encode(payload.encode()).decode().rstrip('=') + '.' conn += sign conf += '"signedConnector":"%s",' % conn @@ -1556,7 +1556,7 @@ def ecdsa_sign(pkey, message, alg="sha256"): raise Exception("Extra data at the end of ECDSA signature") raw_sign = r + s - return base64.urlsafe_b64encode(raw_sign).rstrip('=') + return base64.urlsafe_b64encode(raw_sign).decode().rstrip('=') p256_priv_key = """-----BEGIN EC PRIVATE KEY----- MHcCAQEEIBVQij9ah629f1pu3tarDQGQvrzHgAkgYd1jHGiLxNajoAoGCCqGSM49 @@ -1572,11 +1572,11 @@ def run_dpp_config_connector(dev, apdev, expiry=None, payload=None, raise HwsimSkip("OpenSSL python method not available") pkey = OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_PEM, p256_priv_key) - x = base64.urlsafe_b64encode(p256_pub_key_x).rstrip('=') - y = base64.urlsafe_b64encode(p256_pub_key_y).rstrip('=') + x = base64.urlsafe_b64encode(p256_pub_key_x).decode().rstrip('=') + y = base64.urlsafe_b64encode(p256_pub_key_y).decode().rstrip('=') - pubkey = '\04' + p256_pub_key_x + p256_pub_key_y - kid = base64.urlsafe_b64encode(hashlib.sha256(pubkey).digest()).rstrip('=') + pubkey = b'\x04' + p256_pub_key_x + p256_pub_key_y + kid = base64.urlsafe_b64encode(hashlib.sha256(pubkey).digest()).decode().rstrip('=') prot_hdr = '{"typ":"dppCon","kid":"%s","alg":"ES256"}' % kid @@ -1585,8 +1585,8 @@ def run_dpp_config_connector(dev, apdev, expiry=None, payload=None, if expiry: payload += ',"expiry":"%s"' % expiry payload += '}' - conn = base64.urlsafe_b64encode(prot_hdr).rstrip('=') + '.' - conn += base64.urlsafe_b64encode(payload).rstrip('=') + conn = base64.urlsafe_b64encode(prot_hdr.encode()).decode().rstrip('=') + '.' + conn += base64.urlsafe_b64encode(payload.encode()).decode().rstrip('=') sign = ecdsa_sign(pkey, conn) conn += '.' + sign run_dpp_config_error(dev, apdev, @@ -1707,12 +1707,14 @@ def test_dpp_gas_timeout(dev, apdev): # DPP Authentication Request msg = dev[0].mgmt_rx() - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + msg['freq'], msg['datarate'], msg['ssi_signal'], binascii.hexlify(msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") # DPP Authentication Confirmation msg = dev[0].mgmt_rx() - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + msg['freq'], msg['datarate'], msg['ssi_signal'], binascii.hexlify(msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5) @@ -1724,7 +1726,8 @@ def test_dpp_gas_timeout(dev, apdev): # DPP Configuration Response (GAS Initial Response frame) msg = dev[0].mgmt_rx() - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + msg['freq'], msg['datarate'], msg['ssi_signal'], binascii.hexlify(msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") # GAS Comeback Response frame @@ -2266,7 +2269,9 @@ def run_dpp_auto_connect_legacy(dev, apdev, conf='sta-psk', if "OK" not in dev[0].request(cmd): raise Exception("Failed to start listen operation") - cmd = "DPP_AUTH_INIT peer=%d conf=%s ssid=%s pass=%s" % (id1, conf, "dpp-legacy".encode("hex"), "secret passphrase".encode("hex")) + cmd = "DPP_AUTH_INIT peer=%d conf=%s ssid=%s pass=%s" % (id1, conf, + binascii.hexlify("dpp-legacy".encode()).decode(), + binascii.hexlify("secret passphrase".encode()).decode()) if "OK" not in dev[1].request(cmd): raise Exception("Failed to initiate DPP Authentication") ev = dev[1].wait_event(["DPP-CONF-SENT"], timeout=10) @@ -2317,7 +2322,9 @@ def run_dpp_auto_connect_legacy_pmf_required(dev, apdev): if "OK" not in dev[0].request(cmd): raise Exception("Failed to start listen operation") - cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk ssid=%s pass=%s" % (id1, "dpp-legacy".encode("hex"), "secret passphrase".encode("hex")) + cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk ssid=%s pass=%s" % (id1, + binascii.hexlify("dpp-legacy".encode()).decode(), + binascii.hexlify("secret passphrase".encode()).decode()) if "OK" not in dev[1].request(cmd): raise Exception("Failed to initiate DPP Authentication") ev = dev[1].wait_event(["DPP-CONF-SENT"], timeout=10) @@ -5149,7 +5156,8 @@ def test_dpp_keygen_configurator_error(dev, apdev): def rx_process_frame(dev): msg = dev.mgmt_rx() - if "OK" not in dev.request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], msg['frame'].encode('hex'))): + if "OK" not in dev.request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + msg['freq'], msg['datarate'], msg['ssi_signal'], binascii.hexlify(msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") def wait_auth_success(responder, initiator): @@ -5238,7 +5246,7 @@ def test_dpp_gas_comeback_after_failure(dev, apdev): # DPP Configuration Request (GAS Comeback Request frame) msg = dev[0].mgmt_rx() - frame = msg['frame'].encode('hex') + frame = binascii.hexlify(msg['frame']).decode() with alloc_fail(dev[0], 1, "gas_build_comeback_resp;gas_server_handle_rx_comeback_req"): if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame)): raise Exception("MGMT_RX_PROCESS failed") @@ -5269,26 +5277,29 @@ def test_dpp_gas(dev, apdev): msg = dev[0].mgmt_rx() # Protected Dual of GAS Initial Request frame (dropped by GAS server) - frame = msg['frame'].encode('hex') - frame = frame[0:48] + "09" + frame[50:] + if msg == None: + raise Exception("MGMT_RX_PROCESS failed. ") + frame = binascii.hexlify(msg['frame']) + frame = frame[0:48] + "09".encode() + frame[50:] + frame = frame.decode() if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame)): raise Exception("MGMT_RX_PROCESS failed") with alloc_fail(dev[0], 1, "gas_server_send_resp"): - frame = msg['frame'].encode('hex') + frame = binascii.hexlify(msg['frame']).decode() if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame)): raise Exception("MGMT_RX_PROCESS failed") wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") with alloc_fail(dev[0], 1, "gas_build_initial_resp;gas_server_send_resp"): - frame = msg['frame'].encode('hex') + frame = binascii.hexlify(msg['frame']).decode() if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame)): raise Exception("MGMT_RX_PROCESS failed") wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") # Add extra data after Query Request field to trigger # "GAS: Ignored extra data after Query Request field" - frame = msg['frame'].encode('hex') + "00" + frame = binascii.hexlify(msg['frame']).decode() + "00" if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame)): raise Exception("MGMT_RX_PROCESS failed") @@ -5314,7 +5325,7 @@ def test_dpp_truncated_attr(dev, apdev): frame = msg['frame'] # DPP: Truncated message - not enough room for the attribute - dropped - frame1 = frame[0:36].encode('hex') + frame1 = binascii.hexlify(frame[0:36]).decode() if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame1)): raise Exception("MGMT_RX_PROCESS failed") ev = dev[0].wait_event(["DPP-RX"], timeout=5) @@ -5322,7 +5333,7 @@ def test_dpp_truncated_attr(dev, apdev): raise Exception("Invalid attribute error not reported") # DPP: Unexpected octets (3) after the last attribute - frame2 = frame.encode('hex') + "000000" + frame2 = binascii.hexlify(frame).decode() + "000000" if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(msg['freq'], msg['datarate'], msg['ssi_signal'], frame2)): raise Exception("MGMT_RX_PROCESS failed") ev = dev[0].wait_event(["DPP-RX"], timeout=5) @@ -5425,7 +5436,7 @@ def test_dpp_invalid_legacy_params(dev, apdev): id1 = int(res) # No pass/psk - cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk ssid=%s" % (id1, "dpp-legacy".encode("hex")) + cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk ssid=%s" % (id1, binascii.hexlify("dpp-legacy".encode()).decode()) if "FAIL" not in dev[1].request(cmd): raise Exception("Invalid command not rejected") @@ -5448,7 +5459,7 @@ def test_dpp_invalid_legacy_params2(dev, apdev): id1 = int(res) dev[0].set("dpp_configurator_params", - " conf=sta-psk ssid=%s" % ("dpp-legacy".encode("hex"))) + " conf=sta-psk ssid=%s" % (binascii.hexlify("dpp-legacy".encode()).decode())) cmd = "DPP_LISTEN 2412 role=configurator" if "OK" not in dev[0].request(cmd): raise Exception("Failed to start listen operation") @@ -5483,7 +5494,9 @@ def test_dpp_legacy_params_failure(dev, apdev): if "OK" not in dev[0].request("DPP_LISTEN 2412"): raise Exception("Failed to start listen operation") - cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk pass=%s ssid=%s" % (id1, "passphrase".encode("hex"), "dpp-legacy".encode("hex")) + cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk pass=%s ssid=%s" % (id1, + binascii.hexlify("passphrase".encode()).decode(), + binascii.hexlify("dpp-legacy".encode()).decode()) with alloc_fail(dev[1], 1, "dpp_build_conf_obj_legacy"): if "OK" not in dev[1].request(cmd): raise Exception("Failed to initiate DPP") @@ -5819,7 +5832,7 @@ def run_dpp_network_addition_failure(dev, apdev): wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") dev[0].dump_monitor() - cmd = "DPP_CONFIGURATOR_SIGN conf=sta-psk pass=%s configurator=%d" % ("passphrase".encode("hex"), conf_id) + cmd = "DPP_CONFIGURATOR_SIGN conf=sta-psk pass=%s configurator=%d" % (binascii.hexlify("passphrase".encode()).decode(), conf_id) tests = [ (1, "wpa_config_set_quoted;wpas_dpp_add_network") ] for count,func in tests: with alloc_fail(dev[0], count, func): From patchwork Thu Jan 24 07:46:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XWky8Mhk"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EkZ3NA5S"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ8V1DGHz9s9h for ; Thu, 24 Jan 2019 18:50:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9Qxhfvinyi1Mt21YHuGmL1cK4hNzXmgxT6un1b4SYWU=; b=XWky8Mhk0XC+VUkRDp3eHDG9QC 4FV3AvzLeacj/2Y2CC6Yo4le70eLb0erRJ+7IRj7Ccnukwc+a81qZ8J+S62FlcPTQoDPYUtpecQaq Y/JAWWCl2oHeQQoAMPG7wWVlSicH9oTZjHK6ZHZBKkKtS2CUCJ71+iUdPxABMnLV48dMopntFG1oD jhzdlMW00Tal+0Ihlzgb+AIdhmqH5vzQvjsv95xoJy0V4RW9Y9GkM/fFMLv7Q30aSwFLeycHjFNXA hQWac+IqQAMvenojzBDmhQT3o7hc7HsojGFhcUDip1G4kMH52An4iQu/9qLmjehUR6uf26aes0ZpD Y5Z3FxPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZmZ-000253-9m; Thu, 24 Jan 2019 07:50:39 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjT-0006Ah-6K for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:03 +0000 Received: by mail-pg1-x531.google.com with SMTP id z10so2305453pgp.7 for ; Wed, 23 Jan 2019 23:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4HB6Cwk6AJwP5grR9+SCKVMeYRPUpA2z56S3VlK0hCs=; b=EkZ3NA5ShDvh7kNeyaVQXFJdPYqROVxgC5pqncVz6n8QNJGWn9wno9/xs80HFzIR2A 72p9iUP8MRZqFqn8JgBV/jqrVjtYvL7JN7RKcXnzn2x77HQObYyDkLGzos1MtnK99O6c 5Jt/k00Ri/Rv+WIvXyuapc1K+haX0am7EaNDpexgNxTfZQgYpyTB3lWs97B1M/LWruXI T0OJW4zfQd8zbt+NNMSDSRTFnld+hujX2NG6hLt5EOAuXfJun52/LPwOcJZkcKWn+I7W 5e5773EI+bvtlTjmEtcyU84Gi2Az6+idIs7iZHHye4lcX500csfS6m9Wl6fSqaZPbBAT Wb0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4HB6Cwk6AJwP5grR9+SCKVMeYRPUpA2z56S3VlK0hCs=; b=DJ3PeAjiG41MC98tieSE98K5PB2Xcte3CHgDpWkd4bDRy08uYj1a4g+y/zd1ISqcD3 hcrPjwkPb7cGoDUsXdOL48bbAx3I8GHyd84xO7LH75fiBpQK1vNPxrjSiHCeTMRH1BPf XiYWK/r7aR9BdsEIQRJcWelTwkPa6z/LtPUnQKWzolh+KcpsOV5x028OBAxYgT/nFDcN 4tdr4iDwOyMbd4ThiAEsb+CTAqIgn98CeC+VRAh6bYRE7qkcuRARCxeuIFg1R44kHowD FYqrSZ2pNbaa/Hiqapy14haRUHD7MBkSaTe/ehsR2eBAcRGfRIFQ+qi06qzUZoTrMmA1 s5oQ== X-Gm-Message-State: AJcUukePE9jtG1uKXwmtxO9M55rY54i+XlXiMIC86XRp+8udVG/epIT1 nt5EPHcr3Lkq1jFL+nZDQijDeBHf X-Google-Smtp-Source: ALg8bN4dqHpY/vxc+Xhc+n9D2LvbnChjHBMVg0ULLROTVaobd4GN5tuTAcdEZIOQU/tnUACtgogiRg== X-Received: by 2002:a62:2fc3:: with SMTP id v186mr5480979pfv.82.1548316045880; Wed, 23 Jan 2019 23:47:25 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:25 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 24/50] tests: Modify eap_proto test sets for python3 Date: Thu, 24 Jan 2019 16:46:04 +0900 Message-Id: <20190124074630.4192-25-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234728_040429_D1830B17 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:531 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_eap_proto.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py index 46703f7c2..ed0feaad1 100644 --- a/tests/hwsim/test_eap_proto.py +++ b/tests/hwsim/test_eap_proto.py @@ -6830,7 +6830,7 @@ def test_eap_proto_fast_errors(dev, apdev): "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nI-ID=1\nEND\n", "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nA-ID-Info=1\nEND\n" ] for pac in tests: - blob = binascii.hexlify(pac) + blob = binascii.hexlify(pac.encode()).decode() dev[0].request("SET blob fast_pac_errors " + blob) dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412", eap="FAST", anonymous_identity="FAST", @@ -6849,7 +6849,7 @@ def test_eap_proto_fast_errors(dev, apdev): tests = [ "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nEND\n", "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nEND\nSTART\nEND\nSTART\nEND\n" ] for pac in tests: - blob = binascii.hexlify(pac) + blob = binascii.hexlify(pac.encode()).decode() dev[0].request("SET blob fast_pac_errors " + blob) dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412", eap="FAST", anonymous_identity="FAST", @@ -8306,8 +8306,8 @@ def test_eap_fast_proto_phase2(dev, apdev): struct.pack(">HHB", EAP_TLV_INTERMEDIATE_RESULT_TLV, 1, 0xff), True), ("EAP-FAST: More than one Crypto-Binding TLV in the message", - struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A' + - struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A', + struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A' + + struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A', True), ("EAP-FAST: Too short Crypto-Binding TLV", struct.pack(">HHB", EAP_TLV_CRYPTO_BINDING_TLV, 1, 0xff), @@ -8364,7 +8364,7 @@ def test_eap_fast_proto_phase2(dev, apdev): struct.pack(">HHHHHHHH", EAP_TLV_PAC_TLV, 4 + 4 + 4 + 32, PAC_TYPE_PAC_OPAQUE, 0, PAC_TYPE_PAC_INFO, 0, - PAC_TYPE_PAC_KEY, 32) + 32*'A', + PAC_TYPE_PAC_KEY, 32) + 32 * b'A', True), ("EAP-FAST: Invalid CRED_LIFETIME length, Ignored unknown PAC-Info type 0, and Invalid PAC-Type length 1", struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2, @@ -8373,7 +8373,7 @@ def test_eap_fast_proto_phase2(dev, apdev): PAC_TYPE_PAC_OPAQUE, 0, PAC_TYPE_PAC_INFO, 13, PAC_TYPE_CRED_LIFETIME, 0, 0, 0, PAC_TYPE_PAC_TYPE, 1, 0, - PAC_TYPE_PAC_KEY, 32) + 32*'A', + PAC_TYPE_PAC_KEY, 32) + 32 * b'A', True), ("EAP-FAST: Unsupported PAC-Type 0", struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2, @@ -8381,7 +8381,7 @@ def test_eap_fast_proto_phase2(dev, apdev): struct.pack(">HHHHHHHHHHH", EAP_TLV_PAC_TLV, 4 + 4 + 6 + 4 + 32, PAC_TYPE_PAC_OPAQUE, 0, PAC_TYPE_PAC_INFO, 6, PAC_TYPE_PAC_TYPE, 2, 0, - PAC_TYPE_PAC_KEY, 32) + 32*'A', + PAC_TYPE_PAC_KEY, 32) + 32 * b'A', True), ("EAP-FAST: PAC-Info overrun (type=0 len=2 left=1)", struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2, @@ -8389,7 +8389,7 @@ def test_eap_fast_proto_phase2(dev, apdev): struct.pack(">HHHHHHHHBHH", EAP_TLV_PAC_TLV, 4 + 4 + 5 + 4 + 32, PAC_TYPE_PAC_OPAQUE, 0, PAC_TYPE_PAC_INFO, 5, 0, 2, 1, - PAC_TYPE_PAC_KEY, 32) + 32*'A', + PAC_TYPE_PAC_KEY, 32) + 32 * b'A', True), ("EAP-FAST: Valid PAC", struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2, @@ -8399,10 +8399,10 @@ def test_eap_fast_proto_phase2(dev, apdev): PAC_TYPE_PAC_OPAQUE, 0, PAC_TYPE_PAC_INFO, 10, PAC_TYPE_A_ID, 1, 0x41, PAC_TYPE_A_ID_INFO, 1, 0x42, - PAC_TYPE_PAC_KEY, 32) + 32*'A', + PAC_TYPE_PAC_KEY, 32) + 32 * b'A', True), ("EAP-FAST: Invalid version/subtype in Crypto-Binding TLV", - struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A', + struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A', True) ] for title, payload, failure in tests: logger.info("Phase 2 test: " + title) From patchwork Thu Jan 24 07:46:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oz76Z7M2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Oq8ezsIS"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ8g2Yhnz9s9h for ; Thu, 24 Jan 2019 18:50:59 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=F4EIfiOI3CWmjiqobLyEWPtOjaJB1WSQk3Gf+J1QX3U=; b=oz76Z7M2oUxk3OE9/XUS4HSD1L tKEh+iG6iRwr9zTsSnEXzdcA/WUtSfmP28HgKQhdUKE8dfQPLxHwPZWx+dPcxOtkkTWb/Yx5mmGid wqgnjtUk/ibKV2qgjRqnYoTnXNfnpJZOWv4Ku5J5KVEpxaC0IQ7WX9VyFX+6GEqvS9ULql2y8D3tM b9qoS1kw1AXXI1GFM9EQUZe9PnVbWms75RjdYriByvf8GC7zTRhQdkVE/w+fjZTiqEb8syfdrzthC 4UCr+0Ej5Ow83mM/Te/HzEP2J6Kk3xIaVzFObEuIhoKK7l2l/HlgUDRenTbXPNDhBjXoQg1dRoOND 66zhGwOg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZmj-0002FC-Ks; Thu, 24 Jan 2019 07:50:49 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjU-0006CL-DH for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:08 +0000 Received: by mail-pl1-x62a.google.com with SMTP id t13so2491139ply.13 for ; Wed, 23 Jan 2019 23:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CYN1cascPOU0i1VpVaJzEgc3gxNIhIvBWGpYbNVb4Gs=; b=Oq8ezsISnk6oZiVWpxNgAz7pB//3jJBawWEjp2yXP0V+xdaYEmVCAPulKAVhuyH3fQ 6Tx99Ybw4e5mKmcRvZZSpyZQUDZyLpFlW+hFUgBIBJxbnAWoaXQU84v6mVfF2xt3gz/k 64fdMRYMItvznqSib+KcsI/hCxFffWE6fy1KxLv7GtCc2WXyl8c+9eWkW6R6glINZ/Xz m80hNYMcdsag27/nPkZ3GUMSzp3g1ivLGOQ89LvjzyaKFii5fDMUULsGvq7uTUEVa/E6 BK8z4m6ZaQDDo9WlFZH2FdXHXLhVUR6Yj3wwiiVd6aXrEj6HoNxkG/18QPh8Twex9xqh 4gWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CYN1cascPOU0i1VpVaJzEgc3gxNIhIvBWGpYbNVb4Gs=; b=HkUS5DAOVmJFh49iqTpiGo6dXzplSytW4xATV7OBISTaCpcqNKdixNcIzDxQzzar42 FhmniRc2/YmGbLpi8fZD3s7xSOXHkaKxvWLBzLy5BbZJMDKysJkttrWmhd4hBf8D9C89 aXsvs4i5AYu5pRrMOhabju8d+01zuXe2Y5zvhGtpjty0BHaFCwJzrp4sui0fU33E7qie F7CtOPL6W3iK9HJU76FeWbYYpfH0XE+83odO+RI8JnNIdYTOqyHLbb54t0HO8QT1IxlY l1HvdzbH4Bn7HitRbvVY0MxaNWxjPyhkeHAWM084HoPbnFJNIeRrh/HzrVAvB2t46Lym b8Iw== X-Gm-Message-State: AJcUukfhfLnW4he4KAvCRm6oJjwLOtQg+ZEdNLrEp90oiuiARfqIWoLZ 7bEIs1Odp42ArUOZsCHXHd5tnwFK X-Google-Smtp-Source: ALg8bN4QTn/d0QR910SqF3f3hYYgIfHAjA2RLkttFlcJghSwD7KvJTEtCzedFI799MOe+CxNeBzzMA== X-Received: by 2002:a17:902:6e0f:: with SMTP id u15mr5487718plk.175.1548316047556; Wed, 23 Jan 2019 23:47:27 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:26 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 25/50] tests: Modify erp test sets for python3 Date: Thu, 24 Jan 2019 16:46:05 +0900 Message-Id: <20190124074630.4192-26-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234728_938652_2F7D4ACE X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_psk.py | 2 +- tests/hwsim/test_erp.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 3078658c1..58cca68d3 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -2281,7 +2281,7 @@ def verify_not_present(buf, key, fname, keyname): return prefix = 2048 if pos > 2048 else pos - with open(fname + keyname, 'w') as f: + with open(fname + keyname, 'wb') as f: f.write(buf[pos - prefix:pos + 2048]) raise Exception(keyname + " found after disassociation") diff --git a/tests/hwsim/test_erp.py b/tests/hwsim/test_erp.py index 866dea4aa..0f16919a4 100644 --- a/tests/hwsim/test_erp.py +++ b/tests/hwsim/test_erp.py @@ -331,7 +331,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params): get_key_locations(buf, emsk, "EMSK") get_key_locations(buf, rRK, "rRK") get_key_locations(buf, rIK, "rIK") - if password not in buf: + if password.encode() not in buf: raise HwsimSkip("Password not found while associated") if pmk not in buf: raise HwsimSkip("PMK not found while associated") @@ -423,7 +423,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params): get_key_locations(buf, emsk, "EMSK") get_key_locations(buf, rRK, "rRK") get_key_locations(buf, rIK, "rIK") - verify_not_present(buf, password, fname, "password") + verify_not_present(buf, binascii.unhexlify(password), fname, "password") verify_not_present(buf, pmk, fname, "PMK") verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") @@ -515,7 +515,7 @@ def test_erp_home_realm_oom(dev, apdev): ca_cert="auth_serv/ca.pem", phase2="auth=PAP", erp="1", scan_freq="2412", wait_connect=False) dev[0].wait_connected(timeout=10) - if range > 1: + if count > 1: continue with alloc_fail(dev[0], count, "eap_get_realm"): dev[0].request("DISCONNECT") From patchwork Thu Jan 24 07:46:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gFVQ/EZ/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="D8bS3Su7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dq0Wjb9u"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZcc2mX2z9s4s for ; Thu, 24 Jan 2019 19:11:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Wi9+nAlJlcp/LTb0dlXUCzbhJBqABAF3z0FaRROactI=; b=gFVQ/EZ/l3w5OSgWMjeExjcPGA ywntuIgLvt/S/92WdxZ4ibI0eKYRrb7aLU38u9G/2vy9rnP7qv5TS0ng2lisLjk+TuxGhUH8r8Hkx sPn6g9lr3e5BdlPfTHdZQ70gKfXJMcUiUHhsz7yLInrBjC0IAKsqBdpBbPf1fAX9apVEZpUHj693V Lh07jL7SoZBwwcmhpKet9MfdaAMgWLze7mkn70/3rKPoAxUE6fEvfmhGv88Wnfr7wEKmhBu9YNLEp mSyDDg6hbAQ0f5DD98oWVVEGAPG3jVbs7S/qSTaYsj+WghiLL1G5RefTUOxd2JXr8pk47/0FJHi6U Yv+mXewA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma6m-00075D-Mg; Thu, 24 Jan 2019 08:11:32 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma66-0006Ht-Ts for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MMcaCuciqKkBjVFNfky5Vd1hYUsNH9/w3Rl8w4VaMhI=; b=D8bS3Su72MXk4DlYsmCc1obSr MvX6z4LkXNCF6Kq5PSmJEE5K/KKFtBZG8XIVfdg9Ch/qBJeEJXPMtLeUbWdewqUny3DaUja5h3arI qdoQ2/06iKaxfYRsARCXQOFUdCmpr84iEpmNaryh9S+JlWy72xZoqsRGNQFQWqEWNEcyAOqy2P+hD OM7wpfF5zIvMTvNrOLl4mtfzyR1rIkCUVNsL5c49Fmnp2i0JnICGMWGMsOzaCiZgoBnWMrfkrVXPW 7vhtQ9WPseRevOx/OyraMKghcCf0f1NDaW/G2YGwP1USJJARlEMBWwovKcNcc7h1Ql8BYatL+jLfq HQgzsfnfg==; Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjY-0006cC-HY for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:34 +0000 Received: by mail-pf1-x42d.google.com with SMTP id 64so2577624pfr.9 for ; Wed, 23 Jan 2019 23:47:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MMcaCuciqKkBjVFNfky5Vd1hYUsNH9/w3Rl8w4VaMhI=; b=dq0Wjb9uf3BK2MqlciUuGpWbNY04VYny40u7bHIHod5DO3KxQpX3tO4uljUgvKgrhA Ea6kfPAdJayzxQPQx5guaXi4YXa2xhEJyX5xhG0yzhFe6j+VqVDnpUuvFYO4uuSdEfgq SljR9QSX8gbHMEzfWxD03PZtbRzHCpHSY02w+ThC/QVz2QzoyLpJ/dR2OqY6+VKjmDDU cZi4JLI4xlB+TaW5DzkXJouk6angHXopHoti7pcMsYLcWt5edjChUNFbOTVtenoeUBeQ RGxv6GfQt58ZmR1dpVOvjQ36/HwXpQWXC37pTft9Kf496m5WlhgifotGwL4Gt99WE5z0 uQOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MMcaCuciqKkBjVFNfky5Vd1hYUsNH9/w3Rl8w4VaMhI=; b=JPiuDq3VgswEawNNZXGmzZf9RtGe4z/mf0/eg92qZegBGevl173jW0j/0M2fXnhN+u z+TLzj9pl1PzsIp469H8ZzA9L22MfiHjWj53SQUZHRwQZTopUEkIKS3MYFH3mNpE0Ekg XeBCWkZmQp0gbohNdbpe1KEREhGwqyDRFsmLfH31TfgWTXNFNdn51xWe3gGCygkDMttw DShRZwhcsfXMIMrTD4bGVnoDbbEwMJTB9GZlWcEI+aw4jJRCOx8X/H3LKDH3Iu92UlOU 9AcwuZoW21H8Ve+757FhasTuLM8dUp4gotH7z/x0R53jbmy3Q1ihxXl0FBBpBgRUAOBY 7Azw== X-Gm-Message-State: AJcUukcCBLZThanphtasxVzp7AaFDOCnlPsR5fHJ53sdpwT8e0C0r69y CenOc2ZfwOvsC9ZJAPMaa4OKp+zO X-Google-Smtp-Source: ALg8bN6ozhcsG+n9vFnY6y2aPT0IspYDdCaUWE0CmtvSB8ikb34cerHbZYy0fLIWZ67oWUUFkvfOKQ== X-Received: by 2002:a62:8d4f:: with SMTP id z76mr5620004pfd.2.1548316049237; Wed, 23 Jan 2019 23:47:29 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:28 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 26/50] tests: Modify fils test sets for python3 Date: Thu, 24 Jan 2019 16:46:06 +0900 Message-Id: <20190124074630.4192-27-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024732_619230_1C76AC78 X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_fils.py | 138 +++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index f4c5af2a9..bec855160 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -600,25 +600,25 @@ def test_fils_sk_multiple_realms(dev, apdev, params): if 'fils_realms' not in bss: raise Exception("FILS Realm Identifiers missing") - expected = '' + expected = bytes() count = 0 for realm in fils_realms: - hash = hashlib.sha256(realm.lower()).digest() + hash = hashlib.sha256(realm.lower().encode()).digest() expected += binascii.hexlify(hash[0:2]) count += 1 if count == 7: break - if bss['fils_realms'] != expected: + if bss['fils_realms'].encode() != expected: raise Exception("Unexpected FILS Realm Identifiers: " + bss['fils_realms']) if 'anqp_fils_realm_info' not in bss: raise Exception("FILS Realm Information ANQP-element not seen") - info = bss['anqp_fils_realm_info']; - expected = '' + info = bss['anqp_fils_realm_info'] + expected = bytes() for realm in fils_realms: - hash = hashlib.sha256(realm.lower()).digest() + hash = hashlib.sha256(realm.lower().encode()).digest() expected += binascii.hexlify(hash[0:2]) - if info != expected: + if info.encode() != expected: raise Exception("Unexpected FILS Realm Info ANQP-element: " + info) dev[0].request("ERP_FLUSH") @@ -665,15 +665,15 @@ def build_dhcp(req, dhcp_msg, chaddr, giaddr="0.0.0.0", ip_src="0.0.0.0", ip_dst="255.255.255.255", rapid_commit=True, override_op=None, magic_override=None, opt_end=True, extra_op=None): - proto = '\x08\x00' # IPv4 + proto = b'\x08\x00' # IPv4 _ip_src = socket.inet_pton(socket.AF_INET, ip_src) _ip_dst = socket.inet_pton(socket.AF_INET, ip_dst) - _ciaddr = '\x00\x00\x00\x00' - _yiaddr = '\x00\x00\x00\x00' - _siaddr = '\x00\x00\x00\x00' + _ciaddr = b'\x00\x00\x00\x00' + _yiaddr = b'\x00\x00\x00\x00' + _siaddr = b'\x00\x00\x00\x00' _giaddr = socket.inet_pton(socket.AF_INET, giaddr) - _chaddr = binascii.unhexlify(chaddr.replace(':','')) + 10*'\x00' + _chaddr = binascii.unhexlify(chaddr.replace(':','')) + 10 * b'\x00' htype = 1 # Hardware address type; 1 = Ethernet hlen = 6 # Hardware address length hops = 0 @@ -691,14 +691,14 @@ def build_dhcp(req, dhcp_msg, chaddr, giaddr="0.0.0.0", if override_op is not None: op = override_op payload = struct.pack('>BBBBLHH', op, htype, hlen, hops, xid, secs, flags) - sname = 64*'\x00' - file = 128*'\x00' + sname = 64 * b'\x00' + file = 128 * b'\x00' payload += _ciaddr + _yiaddr + _siaddr + _giaddr + _chaddr + sname + file # magic - DHCP if magic_override is not None: payload += magic_override else: - payload += '\x63\x82\x53\x63' + payload += b'\x63\x82\x53\x63' # Option: DHCP Message Type if dhcp_msg is not None: payload += struct.pack('BBB', OPT_DHCP_MESSAGE_TYPE, 1, dhcp_msg) @@ -716,7 +716,7 @@ def build_dhcp(req, dhcp_msg, chaddr, giaddr="0.0.0.0", tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) ipv4 = start + csum + _ip_src + _ip_dst @@ -776,7 +776,7 @@ def run_fils_sk_hlp(dev, apdev, rapid_commit_server, params): tests = [ "ff:ff:ff:ff:ff:ff aabb", "ff:ff:ff:ff:ff:ff " + 255*'cc', hapd.own_addr() + " ddee010203040506070809", - "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc) ] + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode() ] for t in tests: if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + t): raise Exception("FILS_HLP_REQ_ADD failed: " + t) @@ -817,7 +817,7 @@ def run_fils_sk_hlp(dev, apdev, rapid_commit_server, params): raise Exception("Unexpected ethertype in HLP response: %d" % proto) frame = frame[2:] ip = frame[0:20] - if ip_checksum(ip) != '\x00\x00': + if ip_checksum(ip) != b'\x00\x00': raise Exception("IP header checksum mismatch in HLP response") frame = frame[20:] udp = frame[0:8] @@ -835,7 +835,7 @@ def run_fils_sk_hlp(dev, apdev, rapid_commit_server, params): file = frame[0:128] frame = frame[128:] options = frame - if options[0:4] != '\x63\x82\x53\x63': + if options[0:4] != b'\x63\x82\x53\x63': raise Exception("No DHCP magic seen in HLP response") options = options[4:] # TODO: fully parse and validate DHCPACK options @@ -868,7 +868,7 @@ def test_fils_sk_hlp_timeout(dev, apdev, params): raise Exception("Failed to flush pending FILS HLP requests") dhcpdisc = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr()) - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc)): + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode()): raise Exception("FILS_HLP_REQ_ADD failed") id = dev[0].connect("fils", key_mgmt="FILS-SHA256", eap="PSK", identity="psk.user@example.com", @@ -912,7 +912,7 @@ def test_fils_sk_hlp_oom(dev, apdev, params): raise Exception("Failed to flush pending FILS HLP requests") dhcpdisc = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr()) - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc)): + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode()): raise Exception("FILS_HLP_REQ_ADD failed") id = dev[0].connect("fils", key_mgmt="FILS-SHA256", eap="PSK", identity="psk.user@example.com", @@ -999,21 +999,21 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): tot_len = 20 + 1 start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - _ip_src = '\x00\x00\x00\x00' - _ip_dst = '\x00\x00\x00\x00' - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + _ip_src = b'\x00\x00\x00\x00' + _ip_dst = b'\x00\x00\x00\x00' + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) ipv4_overflow = start + csum + _ip_src + _ip_dst tot_len = 20 start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 123) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) ipv4_unknown_proto = start + csum + _ip_src + _ip_dst tot_len = 20 start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) ipv4_missing_udp_hdr = start + csum + _ip_src + _ip_dst @@ -1022,14 +1022,14 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): udp = struct.pack('>HHHH', src_port, dst_port, 8 + 1, 0) tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) udp_overflow = start + csum + _ip_src + _ip_dst + udp udp = struct.pack('>HHHH', src_port, dst_port, 7, 0) tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) udp_underflow = start + csum + _ip_src + _ip_dst + udp @@ -1038,7 +1038,7 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): udp = struct.pack('>HHHH', src_port, dst_port, 8, 0) tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) udp_unknown_port = start + csum + _ip_src + _ip_dst + udp @@ -1047,40 +1047,40 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): udp = struct.pack('>HHHH', src_port, dst_port, 8, 0) tot_len = 20 + len(udp) start = struct.pack('>BBHHBBBB', 0x45, 0, tot_len, 0, 0, 0, 128, 17) - ipv4 = start + '\x00\x00' + _ip_src + _ip_dst + ipv4 = start + b'\x00\x00' + _ip_src + _ip_dst csum = ip_checksum(ipv4) dhcp_missing_data = start + csum + _ip_src + _ip_dst + udp dhcp_not_req = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr(), override_op=BOOTREPLY) dhcp_no_magic = build_dhcp(req=True, dhcp_msg=None, - chaddr=dev[0].own_addr(), magic_override='', + chaddr=dev[0].own_addr(), magic_override=bytes(), rapid_commit=False, opt_end=False) dhcp_unknown_magic = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr(), - magic_override='\x00\x00\x00\x00') + magic_override=b'\x00\x00\x00\x00') dhcp_opts = build_dhcp(req=True, dhcp_msg=DHCPNAK, chaddr=dev[0].own_addr(), - extra_op='\x00\x11', opt_end=False) + extra_op=b'\x00\x11', opt_end=False) dhcp_opts2 = build_dhcp(req=True, dhcp_msg=DHCPNAK, chaddr=dev[0].own_addr(), - extra_op='\x11\x01', opt_end=False) + extra_op=b'\x11\x01', opt_end=False) dhcp_valid = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr()) tests = [ "ff", "0800", "0800" + 20*"00", - "0800" + binascii.hexlify(ipv4_overflow), - "0800" + binascii.hexlify(ipv4_unknown_proto), - "0800" + binascii.hexlify(ipv4_missing_udp_hdr), - "0800" + binascii.hexlify(udp_overflow), - "0800" + binascii.hexlify(udp_underflow), - "0800" + binascii.hexlify(udp_unknown_port), - "0800" + binascii.hexlify(dhcp_missing_data), - binascii.hexlify(dhcp_not_req), - binascii.hexlify(dhcp_no_magic), - binascii.hexlify(dhcp_unknown_magic) ] + "0800" + binascii.hexlify(ipv4_overflow).decode(), + "0800" + binascii.hexlify(ipv4_unknown_proto).decode(), + "0800" + binascii.hexlify(ipv4_missing_udp_hdr).decode(), + "0800" + binascii.hexlify(udp_overflow).decode(), + "0800" + binascii.hexlify(udp_underflow).decode(), + "0800" + binascii.hexlify(udp_unknown_port).decode(), + "0800" + binascii.hexlify(dhcp_missing_data).decode(), + binascii.hexlify(dhcp_not_req).decode(), + binascii.hexlify(dhcp_no_magic).decode(), + binascii.hexlify(dhcp_unknown_magic).decode() ] for t in tests: if "OK" not in dev[0].request("FILS_HLP_REQ_ADD ff:ff:ff:ff:ff:ff " + t): raise Exception("FILS_HLP_REQ_ADD failed: " + t) @@ -1099,8 +1099,8 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): dev[0].wait_disconnected() dev[0].request("FILS_HLP_REQ_FLUSH") - tests = [ binascii.hexlify(dhcp_opts), - binascii.hexlify(dhcp_opts2) ] + tests = [ binascii.hexlify(dhcp_opts).decode(), + binascii.hexlify(dhcp_opts2).decode() ] for t in tests: if "OK" not in dev[0].request("FILS_HLP_REQ_ADD ff:ff:ff:ff:ff:ff " + t): raise Exception("FILS_HLP_REQ_ADD failed: " + t) @@ -1112,7 +1112,7 @@ def test_fils_sk_hlp_req_parsing(dev, apdev, params): dev[0].wait_disconnected() dev[0].request("FILS_HLP_REQ_FLUSH") - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcp_valid)): + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcp_valid).decode()): raise Exception("FILS_HLP_REQ_ADD failed") hapd.set("own_ip_addr", "0.0.0.0") dev[0].select_network(id, freq=2412) @@ -1173,7 +1173,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): raise Exception("Failed to flush pending FILS HLP requests") dhcpdisc = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr()) - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc)): + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode()): raise Exception("FILS_HLP_REQ_ADD failed") id = dev[0].connect("fils", key_mgmt="FILS-SHA256", eap="PSK", identity="psk.user@example.com", @@ -1197,16 +1197,16 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): dhcpdisc = build_dhcp(req=False, dhcp_msg=DHCPACK, chaddr=dev[0].own_addr(), giaddr="127.0.0.3") #sock.sendto(dhcpdisc[2+20+8:], addr) - chaddr = binascii.unhexlify(dev[0].own_addr().replace(':','')) + 10*'\x00' - tests = [ "\x00", - "\x02" + 500 * "\x00", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + 500 * "\x00", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + 16*"\x00" + 64*"\x00" + 128*"\x00" + "\x63\x82\x53\x63", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + 16*"\x00" + 64*"\x00" + 128*"\x00" + "\x63\x82\x53\x63" + "\x00\x11", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + 16*"\x00" + 64*"\x00" + 128*"\x00" + "\x63\x82\x53\x63" + "\x11\x01", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + chaddr + 64*"\x00" + 128*"\x00" + "\x63\x82\x53\x63" + "\x35\x00\xff", - "\x02\x00\x00\x00" + 20*"\x00" + "\x7f\x00\x00\x03" + chaddr + 64*"\x00" + 128*"\x00" + "\x63\x82\x53\x63" + "\x35\x01\x00\xff", - 1501 * "\x00" ] + chaddr = binascii.unhexlify(dev[0].own_addr().replace(':','')) + 10 * b'\x00' + tests = [ b"\x00", + b"\x02" + 500 * b"\x00", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + 500 * b"\x00", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + 16 * b"\x00" + 64 * b"\x00" + 128 * b"\x00" + b"\x63\x82\x53\x63", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + 16 * b"\x00" + 64 * b"\x00" + 128 * b"\x00" + b"\x63\x82\x53\x63" + b"\x00\x11", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + 16 * b"\x00" + 64 * b"\x00" + 128 * b"\x00" + b"\x63\x82\x53\x63" + b"\x11\x01", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + chaddr + 64 * b"\x00" + 128 * b"\x00" + b"\x63\x82\x53\x63" + b"\x35\x00\xff", + b"\x02\x00\x00\x00" + 20 * b"\x00" + b"\x7f\x00\x00\x03" + chaddr + 64 * b"\x00" + 128 * b"\x00" + b"\x63\x82\x53\x63" + b"\x35\x01\x00\xff", + 1501 * b"\x00" ] for t in tests: sock.sendto(t, addr) dev[0].wait_connected() @@ -1234,7 +1234,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): logger.debug("Received DHCP message from %s" % str(addr)) dhcpoffer = build_dhcp(req=False, dhcp_msg=DHCPOFFER, rapid_commit=False, chaddr=dev[0].own_addr(), giaddr="127.0.0.3", - extra_op="\x00\x11", opt_end=False) + extra_op=b"\x00\x11", opt_end=False) sock.sendto(dhcpoffer[2+20+8:], addr) (msg,addr) = sock.recvfrom(1000) logger.debug("Received DHCP message from %s" % str(addr)) @@ -1249,7 +1249,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): logger.debug("Received DHCP message from %s" % str(addr)) dhcpoffer = build_dhcp(req=False, dhcp_msg=DHCPOFFER, rapid_commit=False, chaddr=dev[0].own_addr(), giaddr="127.0.0.3", - extra_op="\x11\x01", opt_end=False) + extra_op=b"\x11\x01", opt_end=False) sock.sendto(dhcpoffer[2+20+8:], addr) (msg,addr) = sock.recvfrom(1000) logger.debug("Received DHCP message from %s" % str(addr)) @@ -1264,7 +1264,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): logger.debug("Received DHCP message from %s" % str(addr)) dhcpoffer = build_dhcp(req=False, dhcp_msg=DHCPOFFER, rapid_commit=False, chaddr=dev[0].own_addr(), giaddr="127.0.0.3", - extra_op="\x36\x01\x30") + extra_op=b"\x36\x01\x30") sock.sendto(dhcpoffer[2+20+8:], addr) (msg,addr) = sock.recvfrom(1000) logger.debug("Received DHCP message from %s" % str(addr)) @@ -1276,8 +1276,8 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): dev[0].request("FILS_HLP_REQ_FLUSH") dhcpdisc = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr(), - extra_op="\x00\x11", opt_end=False) - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc)): + extra_op=b"\x00\x11", opt_end=False) + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode()): raise Exception("FILS_HLP_REQ_ADD failed") dev[0].dump_monitor() dev[0].select_network(id, freq=2412) @@ -1285,7 +1285,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): logger.debug("Received DHCP message from %s" % str(addr)) dhcpoffer = build_dhcp(req=False, dhcp_msg=DHCPOFFER, rapid_commit=False, chaddr=dev[0].own_addr(), giaddr="127.0.0.3", - extra_op="\x36\x01\x30") + extra_op=b"\x36\x01\x30") sock.sendto(dhcpoffer[2+20+8:], addr) dev[0].wait_connected() dev[0].request("DISCONNECT") @@ -1295,8 +1295,8 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): dev[0].request("FILS_HLP_REQ_FLUSH") dhcpdisc = build_dhcp(req=True, dhcp_msg=DHCPDISCOVER, chaddr=dev[0].own_addr(), - extra_op="\x11\x01", opt_end=False) - if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc)): + extra_op=b"\x11\x01", opt_end=False) + if "OK" not in dev[0].request("FILS_HLP_REQ_ADD " + "ff:ff:ff:ff:ff:ff " + binascii.hexlify(dhcpdisc).decode()): raise Exception("FILS_HLP_REQ_ADD failed") dev[0].dump_monitor() dev[0].select_network(id, freq=2412) @@ -1304,7 +1304,7 @@ def test_fils_sk_hlp_dhcp_parsing(dev, apdev, params): logger.debug("Received DHCP message from %s" % str(addr)) dhcpoffer = build_dhcp(req=False, dhcp_msg=DHCPOFFER, rapid_commit=False, chaddr=dev[0].own_addr(), giaddr="127.0.0.3", - extra_op="\x36\x01\x30") + extra_op=b"\x36\x01\x30") sock.sendto(dhcpoffer[2+20+8:], addr) dev[0].wait_connected() dev[0].request("DISCONNECT") @@ -1967,7 +1967,7 @@ def test_fils_assoc_replay(dev, apdev, params): req = hapd.mgmt_rx() count += 1 hapd.dump_monitor() - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) if req['subtype'] == 0: assocreq = req ev = hapd.wait_event(["MGMT-TX-STATUS"], timeout=5) @@ -1989,7 +1989,7 @@ def test_fils_assoc_replay(dev, apdev, params): logger.info("Replay the last Association Request frame") hapd.dump_monitor() hapd.set("ext_mgmt_frame_handling", "1") - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame'])) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) ev = hapd.wait_event(["MGMT-TX-STATUS"], timeout=5) if ev is None: raise Exception("No TX status seen") From patchwork Thu Jan 24 07:46:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mQ+jbHah"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="ET0dBVMv"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DOX4XNvJ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZSr0CjDz9s4s for ; Thu, 24 Jan 2019 19:05:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8VcfjSyNAGwmsdlLW63dIKumjnQmy26P00f6tyLKJSo=; b=mQ+jbHahiZaQ+Met11fx2RWTNN Tm0z2GcUUnNzZiY580gfPtPqkIW7qmGcAO285K4FExTbA6LuMfZ+jEF4NsTa93FG8qSxqTsTvBxOn Wi6l5e0R3d2LYl2cRtUQoQ1S8ARI7dWlXTFCTNxNg5HhtM26QY44CBnHR+cqt5iXwDihlDf3bq2Ex cklHhGJvVcYTO4czmlzFvKvjWvKMHzkznkrToci5o3nCiK1ICEYAPtlKr3Af7sTYITN2hgQYoD1H3 B2KNfzDCwKiGTO5UtE5gusbgLy7L74bPPtqzbyc13UK9KqZhngFKXPzDoYIABvq6O6UDYEM4LnWlx qTSmW2SQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzn-0002fK-S4; Thu, 24 Jan 2019 08:04:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyb-0001E8-6f for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:03:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PxLbfM3NMr+kw5N8F25lhIqeHpkqvGA/NLiPlUzczBo=; b=ET0dBVMvWGzdXQA6jbQFok4tW Lfsf7xHyISguldl+U1HqlJvKDbwOR6uHEo/QXNjh5bInpq+cwg6SYW70BIYTzNeON6SbKbrlLXVEF IElqfQIngvwqTp70amxfVyy56fFZ5iGu0+x+VQstygPzmdqwPdAQd39eTEG/LD4ymkLBylEEX2YtY kTb/Q4f45vfcwi1vRfxuyWdF5xl9Ea8oipPIlnbjuuEBvfuBZq2EDjL5UFM5leHpate2/YyrS9rWB lRn/jgNqxNmPUmISFLGX/7QNp1TBr+cfQefsN6NDnOFBDm49ckde2PVbcilb4VID41YTS2WMEcfCs FR0utNcxg==; Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjZ-0001tE-50 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:34 +0000 Received: by mail-pg1-x52b.google.com with SMTP id t13so2294832pgr.11 for ; Wed, 23 Jan 2019 23:47:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PxLbfM3NMr+kw5N8F25lhIqeHpkqvGA/NLiPlUzczBo=; b=DOX4XNvJCXHbB+p/uG3Zlis/NNooPAZ9T6AXxlN8VbKgYgmW0mZVXQY3sORbIZuIns QWQa/lCl65Aql3BBVIuuUnEZcPYsz4/W9CrenamMbS2rAbVopfyver0D/TA+sBjmerhR YHQqVcipS+E3PXa7ox0hHD9gElkYgwZXA6e33zTvjooJvPjorFBabVCjxOU5DBqsk96E sn+eUKoAfl+6Bexaeu/0UUNrN1s2h1z9DgpLRbbHI78HR5jVDh5Ddf5DRmOO47Qr4xsI aofCqk7gLoC6PX/+EUl0JkZedRYW6PmlHlwnsfN5IH/pzc0R4A33oB0qHDKyfeUjGryL mE5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PxLbfM3NMr+kw5N8F25lhIqeHpkqvGA/NLiPlUzczBo=; b=cT+9j3XyrTSXVNDhD0aWJ+eOpgGIzfQ3Em+LuY35kt3lNWrrb7RpNWks4SkMkqf5sO zbSMqFAMxS1KHbYRDlKfsgVaz6Rs5nXE6sXq5L5T3+hVd+SY9ZTNk9zSQiEhj1KNDFO4 RH8glQ9nxT4GwZLQ4JwwOqj4/u2Sf01mPKWP7PIh5rWtLuaOR46kCHjHs0cP/ahJ2bQk 97NnawL6VCpduN1BbPY5bYPjdeX7fJGQFLNz+VEuciL9maX+CapXQ845gOU07vCjqj/d mHw6wofjGA4oPb3fMt60aa2HIHLl2V64OP9HLwuu6bGitNWIQY0joI6Q/YCYea4a3TXj UiHg== X-Gm-Message-State: AJcUukfBh7ox12aXzOxUFAgoc5ip+Efmd21fow3XhTE9b/eti7GGZRA/ jIUYBUkgcS9vLX4KJY2z8KmtphTN X-Google-Smtp-Source: ALg8bN44+S7FvAS7RkCMh8Z9qsUDsagRHibex6hgeEw9J3PqXDkAHJzH0q/X5k7EFpdOAoUV4M6O1A== X-Received: by 2002:a63:1408:: with SMTP id u8mr4994911pgl.271.1548316051061; Wed, 23 Jan 2019 23:47:31 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:30 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 27/50] tests: Modify fst_config test sets for python3 Date: Thu, 24 Jan 2019 16:46:07 +0900 Message-Id: <20190124074630.4192-28-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074733_205126_1C5C35CC X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/fst_test_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/fst_test_common.py b/tests/hwsim/fst_test_common.py index c0255ce31..8fbd71fc5 100644 --- a/tests/hwsim/fst_test_common.py +++ b/tests/hwsim/fst_test_common.py @@ -90,7 +90,7 @@ class HapdRegCtrl: def fst_clear_regdom(): cmd = subprocess.Popen([ "iw", "reg", "get" ], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() if "country 00:" not in res: subprocess.call(['iw', 'reg', 'set', '00']) From patchwork Thu Jan 24 07:46:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QotX3CtF"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mjcQ1rlN"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ9C19Nnz9s9h for ; Thu, 24 Jan 2019 18:51:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=V2TEobEDaS3kmpb23mwJn/ISieBtcr00XWrstZG2r7s=; b=QotX3CtFQG5FWrArCDsMkBs9bK CIlA4h2YWdsXn2Yqp8Y0+tkSI6HunptHf6vxMnzVoNcEdIyGV8o385V6Apm/duVtUmqiHTxOxuuHG xzt1Yy6r8XWzmOwjExqzsX/Z7GK283nV4AogZRZeQK5TD/n6J4qpHoDVLI0kgMby6lwWxpa+/snpH McKGuORKyGxetdrZStfl0nQC0NnUqt3WvIjSvLiooppDUOL8FtwXkGoKIOsNsfwITwFcZdvK++8kI yjo0JTEVg6ROi135IAmWEh5WTjxzclagWOq83F3EeSDSm3pzjZSYhVqYBG3ueJj0joe6xT719kq/k ZyADuK2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZnC-0002hX-7o; Thu, 24 Jan 2019 07:51:18 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZja-0006HV-76 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:19 +0000 Received: by mail-pf1-x430.google.com with SMTP id c123so2606988pfb.0 for ; Wed, 23 Jan 2019 23:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wN0TYkVNYiWRCaaBx24ovrPIUlhCr4OKCuLAwApPtbw=; b=mjcQ1rlNYwyy51hGe2lMPNo09oTs1ICrKc7bSJYeNhJTqDHyvWOp1pD+cTe08KgWM1 qcuBpyIobb1oJ474ovy+WMThXQUE/PBroNFRPF/gXNnoNvCt/0cXEzmQtk/1tVavvSF0 PoNb01sGbkTnTtUzvCSuShKgwoY1SQlL3/9S2ywotKGRivIJytO4fkjJ0PvUR++6UQNx J26oN+m//2HUDW3crlJmooxuR5TgGKmuOVpKl4fK8VDPIk5AUXTBYZyA6riFMckr3PW5 XgsDd9ZpZYHeXXXZbqM6+Xgj/79safkp38zYrdrgjUtQ0TKRAnTyENw4ru6uZRDo+YCX x4kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wN0TYkVNYiWRCaaBx24ovrPIUlhCr4OKCuLAwApPtbw=; b=WFnASgqDBMiWAHh9J5mglG0Ti21EWnEzpNNkxMhh98/0EPSQlNLYKr8YQC32E5xyRH rjabURGbwUX//co5eFFc3CETjJ+wusNcIJaoXGeztOh78qshBI6o2s8bZf9knUkGL7sn ayj6hA/tsk/nh3hO+vTyjWFnyr8KGwNzYg814LZpQSakTq3Ddt6xdeahu0ZutkAx3iGY g1KL5jRmqI0mvppUlCQ5PSlgOePYsNnA3pRiHYIPBek0VMI3AMdXHrfpxE0FZ6rRRpP9 JQnQBu1kLCR32ol01mGHkCMVko/StPzpb/cJj+eRYhpnjKs8DiR7X8CFac24QUdk2vn4 6nlg== X-Gm-Message-State: AJcUukdXid+5ZppBWXFGAz/bTSI31iA+Gsb6mhdKDulfinNMm8IXy9Py ulNvo4pVN/qJukxMj6xwWz3YZqvM X-Google-Smtp-Source: ALg8bN7sq98vQpJ0C94BJaehjEZ+EMzk5COcH/iDI3gNhRZNN7RyPIDnpbtteNB4nC6pP4zCjwy1FQ== X-Received: by 2002:a65:60c2:: with SMTP id r2mr5028356pgv.393.1548316052919; Wed, 23 Jan 2019 23:47:32 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:32 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 28/50] tests: Modify gas test sets for python3 Date: Thu, 24 Jan 2019 16:46:08 +0900 Message-Id: <20190124074630.4192-29-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234735_189614_EC2587FB X-CRM114-Status: GOOD ( 11.42 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:430 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_gas.py | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index a6f0a7fd6..e70c72229 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -1004,7 +1004,7 @@ def test_gas_max_pending(dev, apdev): for dialog_token in range(1, 10): msg = struct.pack(' X-Patchwork-Id: 1030317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lNgxFe/V"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SykfV0G4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ8r1klDz9s9h for ; Thu, 24 Jan 2019 18:51:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vaMDYER49NlM49ZpeFjKtTDDD39P1La9BkrjftS142Y=; b=lNgxFe/V96MIVfSBOdviX7yJ4c vqwa+8Ky0mLM+d6jFe7Hi7id+xu6uE/jADBjGMFJdO7G654+pDrWjVHYu7kWBfGB0ekx7Rs9389ww FgXWw+vhiMdNJO1Kk1VdFjXmoCgePZxlzO6KrLTy+yO+jjnz69TS+1PQdVLTzi5RiO5InBRNmb76r EbaWXuH2LyaU5DxA9n1DLjrkV2i1wkinabnGSamGIP9ilu3OGIfagsV1fRuk1UMtvj0zZTUr/XdpX 7Ey7lkj06ct3MWCppof53TjkFxtlytrX/53MPc9RtVV3UIfvkzSBWSdmyqWRwqeBZ6DZ6PPaArhU4 g7ruFiWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZmt-0002OS-IT; Thu, 24 Jan 2019 07:50:59 +0000 Received: from mail-pf1-f172.google.com ([209.85.210.172]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjc-0006JP-9Z for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:14 +0000 Received: by mail-pf1-f172.google.com with SMTP id q1so2587972pfi.5 for ; Wed, 23 Jan 2019 23:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CkDlDiWqW6HCcZ915DI8+lhaXjSiKG6lDTW2AO8U8Ic=; b=SykfV0G4e8AWHEZeKLb+mr35ZeZ5ohmpQQRicTucPRdLPHFt2fgQt0e2Y+SpF7jsnC E0RVT+xSaY5SQoHeaUxvLdhibkRKgawJrdElX8KJAHDURe4cZ+/jdbtDzD0KjvNbVyd/ Gq/9C2IuKvxlQ6xgy1chNcHktCzScgP6y7BedTVH+aYGUC0ivG2peAEu6W7cCAk7YS81 i/NoGOppmroIH4wJxH07GEezEXU62oPbfuqGIhY9V+jXzueBNA/WxiwUxcEjgKKoS0aj M3AoQZuf3PnGV1L6d9HLdVjl819gJuGaY+etmmkPaobzVG1dkKDvc2ncEro9i1NFIWew mB5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CkDlDiWqW6HCcZ915DI8+lhaXjSiKG6lDTW2AO8U8Ic=; b=UgghDMzaE1eojujatJmXIX3LGdtYk+1X7runHdz0ymBFSM41CVVOGQeBXneAeUDl94 ZMUzLfAt2RikfxAE7RSKfJ6HFteklnPFpqMDctwIr7wQmtjCEGoICphdWJI5TYZR2ooo 6H2JgdETVNuXAbLvbn15Y4LxF6pQQUpKTgEbvMoBEUfHNVcky6kpU7DEn+wuLpLiKFWC ACogbUHJEfpzmqMfTwjv5e9i7WvJU1FqthIgYkG+epY1cZohfRXZArSxw/gS0/nnlrjp IW/JIMBKY4V2NPybCKIIT9+HuJ0dBgCV6Y1ytuawTdGdihRqRZCb59Lggg+ZZ8Z/Apbx Ub9g== X-Gm-Message-State: AJcUukd18XDLR3UfVK6uQ1GxZsvouaqSo4HFuyNH5vax5HfgFZlFzIgw gMsWtb/Xh1It90IS3PZstNY2TFXa X-Google-Smtp-Source: ALg8bN4d1O4GxEw+Aq/Dg3PFTEH4A5N+SgdtvyXLwXR3B+1FDtj4NA3DvxJSFYfF+mACnMo39D9BBg== X-Received: by 2002:a63:2586:: with SMTP id l128mr5115606pgl.104.1548316054586; Wed, 23 Jan 2019 23:47:34 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:33 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 29/50] tests: Modify hs20_filter test sets for python3 Date: Thu, 24 Jan 2019 16:46:09 +0900 Message-Id: <20190124074630.4192-30-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234737_018975_BD2775A2 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_hs20_filter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_hs20_filter.py b/tests/hwsim/test_hs20_filter.py index 0a7db628e..545751c59 100644 --- a/tests/hwsim/test_hs20_filter.py +++ b/tests/hwsim/test_hs20_filter.py @@ -162,7 +162,7 @@ def test_ip4_drop_gratuitous_arp(devs, apdevs, params): ap_addr = hapd.own_addr() cl_addr = dev.own_addr() pkt = build_arp(cl_addr, ap_addr, 2, ap_addr, '10.0.0.1', ap_addr, '10.0.0.1') - pkt = binascii.hexlify(pkt) + pkt = binascii.hexlify(pkt).decode() if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt): raise Exception("DATA_TEST_FRAME failed") @@ -188,7 +188,7 @@ def test_ip6_drop_unsolicited_na(devs, apdevs, params): cl_addr = dev.own_addr() pkt = build_na(ap_addr, 'fdaa::2', 'ff02::1', 'fdaa::2', flags=0x20, opt=binascii.unhexlify('0201' + ap_addr.replace(':', ''))) - pkt = binascii.hexlify(pkt) + pkt = binascii.hexlify(pkt).decode() if "OK" not in hapd.request('DATA_TEST_FRAME ' + pkt): raise Exception("DATA_TEST_FRAME failed") From patchwork Thu Jan 24 07:46:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BGodGy09"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="fVzYfOz2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C5TtJmR2"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZSk2Fsgz9s4s for ; Thu, 24 Jan 2019 19:04:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xBcnO2+ruILRMWS+xlMIfJ4QPNI8rAEWoZIeMizZEh0=; b=BGodGy09E51CxVqtcx5pGwJajl rEeFyz0Psau2PJygyn5s5lM43HLXhRBcNiO+xrjklteSwDGw5UetQYFcnsIL4P9mgT15v1m2JUxjJ Gv5BWCHFrJTUk8BDuL96hJHVDdC6WKz0eXrKl2ySvt1kXxIBeplTin3obAgNel9yd6+xlpPWp4StP nfBk4+kAjExN/sygiGLxCYMWgHoU2vPTRlIqyRFHYMIqJ39wecX5b7j4Y0m+YaOqxFYipeJ6U0W6w Lf/wKYVZFMFEDtzXblW3/2yvr0H2x8n9hX8BtMumaOETW0pIFftb7k5bDTF0TGJQeoar83HXEtwZ+ LZBsojlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzd-0002Vn-Ja; Thu, 24 Jan 2019 08:04:09 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyZ-0001E8-Tx for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:03:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nYtyijQgWTu6bHqR3oG/2aS1cSmwac9tYJYYuQO/y5s=; b=fVzYfOz2yyifEGXkVt4HS6OQI BcmkRYat49RETfnF5fYO8ksPnKfuUO6zuYY70FL7GoS6HMlIVeSocRJIu2N/fHlqkiof5hPLCckZy s69HJJbFr1z8NGkZT1B7h1U1AcaoUh/RG2RVkRsPPO0jqvH+XFDBmchCouZgPGJ5jXyeWK+IDyjeB RzADUdjeSCFCh9nReMwTarYwS8Gw2G+15oE3/a5WxhmxB+NOr8K56XAgYdtxDObiI/4in8MNmAEBv Tyue6NAHivPqt3zgD+TzN7urIY2ggLOCNJMilLW6Jq/00dxBbWkzNixwlxInbGj2nZB6mmGMX+k1v 2z6EwjnIw==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZje-0001ti-EK for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:40 +0000 Received: by mail-pg1-x52d.google.com with SMTP id n2so2316410pgm.3 for ; Wed, 23 Jan 2019 23:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nYtyijQgWTu6bHqR3oG/2aS1cSmwac9tYJYYuQO/y5s=; b=C5TtJmR2dfNv1Px85km8wNyGM1RMIFxG/GPPK2r7TH+po0GwBYDTZTO3RTQvDN+TMw mt4tUhgydnld0cNQEE1l0Hwn1+aWeAi3qEGtK1rXEzO/6JqjyM0v4ltLeP2oK5eWub8C ahdFQ5Fqg63cqUPWQw/6OtCTE3esrWx4DrF8b7i6J5pAjbmU2Rky8n362Vg90J/KKjaC VmqY1a8sB/HXRoLl4SvTkRExdeKVygOAfyJtj+7LQ8VnmrlXf8rAJkyUwaK3x15k1wvs A/BVpleM67rRZfXvpvu0NALntyAssEqP1UQphnNwnzeKeqM6/Rhz3Kf0XM2lIElRREti hBOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nYtyijQgWTu6bHqR3oG/2aS1cSmwac9tYJYYuQO/y5s=; b=N2rP2ZXQBYwIRGmNE303OgBUpwkTlDHhnJVPSNO8sB7eEU/CIpWL1ewsih6GDdXxbP C/xXiqA9p1TYjcUR44GGq9Q7/3fksyHVfhunZ27OkM6RQbMwQHZeNr6HseRp/UdKUMBL h3kDd4lhvh/LifV8gTm66f7th49sUPosv9GU8GXSfBgfQD7JFVZiMOLuSMsaI4rkoM/v 6J/4vewOC7cX5r8lhwrdcBZXv/AOs3d0RtKlirk07fEkTStbOBh1mtMQ5VjJJfD9S2do 5Rta+Egfe86ASyyiCve6FK0uUYpd4xuvKyM+k3aO+K1oEAsVHkLyDJBcCq4MN1A+Twh/ Igsg== X-Gm-Message-State: AJcUukdstF3UEp6R2LI8CWFz+DnFe8jPHodDDjs40KhkCN5EWKHK9wbV bZZNDuJVCnw7YxamTDW982oWXUud X-Google-Smtp-Source: ALg8bN7YVBleAxh95Ru23bAQQCKHg4md6545GdwGcI1rZ/5Nx0JncgjbkqVeNyFzwm3goeR/OlSx7Q== X-Received: by 2002:a62:44d8:: with SMTP id m85mr5506427pfi.164.1548316056273; Wed, 23 Jan 2019 23:47:36 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:35 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 30/50] tests: Modify ieee8021x test sets for python3 Date: Thu, 24 Jan 2019 16:46:10 +0900 Message-Id: <20190124074630.4192-31-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074738_486216_43D0C383 X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52d listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ieee8021x.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_ieee8021x.py b/tests/hwsim/test_ieee8021x.py index 43ff234e1..7856a97d7 100644 --- a/tests/hwsim/test_ieee8021x.py +++ b/tests/hwsim/test_ieee8021x.py @@ -247,7 +247,7 @@ def send_eapol_key(dev, bssid, signkey, frame_start, frame_end): hmac_obj = hmac.new(binascii.unhexlify(signkey)) hmac_obj.update(binascii.unhexlify(frame)) sign = hmac_obj.digest() - frame = frame_start + binascii.hexlify(sign) + frame_end + frame = frame_start + binascii.hexlify(sign).decode() + frame_end dev.request("EAPOL_RX " + bssid + " " + frame) def test_ieee8021x_eapol_key(dev, apdev): From patchwork Thu Jan 24 07:46:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030337 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AWx7X+1Q"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="KBmYMElG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="icdautGO"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZSn6yqKz9s4s for ; Thu, 24 Jan 2019 19:04:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=lsqN2bmpPR7hvQvtCsUdIzr8RRZ0marne8WY2gPqAHk=; b=AWx7X+1QE04LQItOej4p4PSEbM Akq+17OP9PF6RD+IXByzkU8rswONMYNLJ7oF4n04nXgbGcgLP1it0oy4ZZNTO1A3fJ5+N6uBG0t7L D9tksQiJgXSrBM0xHiJaOtgT+o14XT6uBnjnk8OmmmoQSxMi25P9o3a8buaZC2NMwvI8RfkUzTgIe lx3eajLTQw6EtTqUY+Hp4sbBCs1TbaPCl761vJZXxKIcdE3d2FYAmXrATd4oVkJNRFzvym96zPInZ +bBfmJ57xD46+bK3AtU549iCw2Z6BFg7FDGrzZrHQBwG4AmF4LidJUyXtiwgGpZgCte4HSNtAovMJ ZEUQ+JdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzi-0002ab-J8; Thu, 24 Jan 2019 08:04:14 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyY-0001E8-JP for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:03:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R3ewbBuR5Z2gTj1LfasbIF/WIBtMPIdOQ0fji1u+X0o=; b=KBmYMElGtKgi1jUWer/HM483F eUPp8UEZJDcfG/84v5seA/E4vFewQKcHyTkE/vDgy/fANAyutg6SyMngXii157EH5hskGT0wVHBrw Npe1yNEo/ngVwLLBBGK5U8yCaSrfLGj8/EVnbHpBdJOrT4MCSjnomnZBikSk3zmaYtkau6xyzM45b 1MZTQoQgH5OMcvXEg4URO7WnVN6ikBAw+qyAO8v+D2L6nG7F5/GIFiOm0+4hZ1zI1V54rl31eZXPT +B62vZ4jypt4XiCYu4dUfbTNLHNoBukhOu/Cm6WpunAkK6mciHFIZ/5aGdWEsSbOIIhqoy42Ped5j a9QvHbfBA==; Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjg-0001tw-8g for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:41 +0000 Received: by mail-pg1-x52c.google.com with SMTP id m1so2303171pgq.8 for ; Wed, 23 Jan 2019 23:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R3ewbBuR5Z2gTj1LfasbIF/WIBtMPIdOQ0fji1u+X0o=; b=icdautGOn87MI5vnIPtpUzVrxeTe+mYAK3w4OIWlOJd1qviDUfy/mJkeqZr4noPZI8 B3fUcGIAHGh88swsPrZf/mkd6pddYn9Mv55inbRgsGa6JxFK71+EGJBEhZtKGeGwr9J/ ke8QWBYBzV9cgtE0ZrEX4cdHedEwEauLO7PJVe0cwCx0MaY3M2Yfd3ZnVVrtMu5WlbD3 rICEjqzdlslBEVMn/m3mpq0t8Mb6bFTuWydrGCZe6eiQCF3o3YWThy9NV9m/uq9awryo +xO82tvgxV4bOVHm+XVitsCEHgxB8rcpOoSRIv8bXrLsGkQO1IekF1SrBNRCowNM8yjs cNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R3ewbBuR5Z2gTj1LfasbIF/WIBtMPIdOQ0fji1u+X0o=; b=m5W8mbIiQ4tPBL4YAyW3MIQ5p7j+KODH7pG5UbDDP+L6VdK+hpN1y4XHxokQb0Ivg7 uiIceYD2lLUM5PnjiQ0TOcXGo5UPlUMn9gPAXcM39hFkYcFgKHHcfC83Dj5Wdy9BeacK 2D5Y9RJcaE6j47q9Ifl0qhWxgeRrCoWbyoMmP4HCi5k/QPhK5JzJt6QUQJYn7XuNrbpu FmdVbJ/JjtURKYlLh8zU9ScfOsCBoPxUUew6ybXzHuUOJ1lEquThtkXetQKh2KktAus+ SfhSXl3BmlZnaA+mIT8Pa70dZOPJiUJbolDzw+rAh3OBPLbaoBiqcgxoHX3S3RK+kMes XvHQ== X-Gm-Message-State: AJcUukeWoxtGc3Uo51t9jSOSUdPLiT+VgmKHIs9M4p++H0tJizYJi1PY H45ARqw6ZB2//aq5hq10tCm2829x X-Google-Smtp-Source: ALg8bN4LdPnBqlZaTB/jQFO6fTqB3fz5cMVKAhCZ372aNaAwRp5/TAbXYOO494VYVItup5B1mcjLsA== X-Received: by 2002:a63:fc05:: with SMTP id j5mr5097893pgi.434.1548316057973; Wed, 23 Jan 2019 23:47:37 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:37 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 31/50] tests: Modify kernel test sets for python3 Date: Thu, 24 Jan 2019 16:46:11 +0900 Message-Id: <20190124074630.4192-32-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074740_310291_636D45BB X-CRM114-Status: GOOD ( 10.53 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52c listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_kernel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_kernel.py b/tests/hwsim/test_kernel.py index f2b072300..0427b73bc 100644 --- a/tests/hwsim/test_kernel.py +++ b/tests/hwsim/test_kernel.py @@ -34,12 +34,12 @@ def _test_kernel_bss_leak(dev, apdev, deauth): 'sa': pkt['da'], 'da': pkt['sa'], 'bssid': pkt['bssid'], - 'payload': '\x01\x00', + 'payload': b'\x01\x00', }) break else: hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=%s" % ( - binascii.hexlify(pkt['frame']), )) + binascii.hexlify(pkt['frame']).decode(), )) hapd.set("ext_mgmt_frame_handling", "0") hapd.request("STOP_AP") From patchwork Thu Jan 24 07:46:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030318 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kRBqy+SR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X2TDxDAy"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ926hmfz9s9h for ; Thu, 24 Jan 2019 18:51:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RJ0KIc/1Sieiv4i6n4gmb5HU1rJiPX6T8nKH71sgCpI=; b=kRBqy+SRVZvCoWlwotuCXqxsrN 5UuVGxYjxQCukhFG+sadockqsAyEoyM++HNT6ACmTwo2UfQuFd9UIUuS+EPQlZ4G2dl/EgAuy/XN4 /WEVB/IR598frQJoX8JNdbj96OLl9c5Cmd97xwGKMCzZfi40ohkvCIK0tzcYZ2x16sz6ugldI5Qed ZNeVICBSqNffGwQn/h92Dmem9GCAaIAee87eTZBq6b5PrPUZYq/VLQSgqjlw+MJLPj0evmHLZyBz3 wN8LWRE6MLeZ9RKJ4W1CjH9NIHCSd3E1DKD2KSPCU+5/EJadlSDPZb17niX62gXCqfgX5YmfaOAu4 kCcF8SyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZn3-0002Yc-PM; Thu, 24 Jan 2019 07:51:09 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjh-0006OB-0x for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:18 +0000 Received: by mail-pg1-x52f.google.com with SMTP id t13so2294952pgr.11 for ; Wed, 23 Jan 2019 23:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EshW0qmv8OZ+BdCN1t496xcaPLJdTATF1/MNPBsh0xs=; b=X2TDxDAyXOTRNRxqRh4KVmP1BVs9bjAdWkonVxEvKhdUNHO7l4b5lf3pyyU6NozyIt zva/Ca8nWpb8LHNzfN/Sjlzu2dGCBSc8Qk+b4uOp1b4sZGQ+8oqFRNPEJHj9XaS/XBzA L7PLEMsXeVg3LsS+Hjdp+zBDWDPT0XadQa8LuZ1LAm/Q9PI9ESh8YvYojFNkeNP/otXH 4XYdSLco5jLspd8bFCUSZhFN2j39RhskSw0FuKjeyrbRHacCozkIH2qp7zrfbDj730DS sfxZxTDohPFmsjSoPl/6tIhY8GpkJc7qTLgwRgNww8+Z9sC7QOtJ9Jqad9VhJD4geeOB rvdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EshW0qmv8OZ+BdCN1t496xcaPLJdTATF1/MNPBsh0xs=; b=rTxTY5wbQUSGNaV5NyGF6wdZD/3WSNdA3zlEIbv2cm6Ptt1GIwnwwb5E68amDf5/33 YpuZVlKWyiICbbvven1sSZodiyJkPFnwJo1xmEycDnsEauKA5v/JD5dZSqWS+Ej20VdP sfaceVW3HIsBYgNjXr4xynVkgE+0OhQ+YeqrfY0eTNtevlxHm3ZLozjff6Emz8DvxRnm nKPWrksiwQOWNIT8im+ib78C1rXZB2VDw1HaZjjlDi+iHwajc/ZxSBc/RWVJDJGzc5Fk jE3Mmwu+0bYryUWnzVOJiCaDkmHWjbZv/WHWn1e8Iqb1xSDYTy4nYubnaDc6rZM0wVgr Uvbg== X-Gm-Message-State: AJcUukef9v1Odxu/DejnBWPmz9cYZNj2e0/VKMV7WVO9SIZhjCb5ZyxD /yqD899Vc+SQcjbjNbnF/Ei+bhHG X-Google-Smtp-Source: ALg8bN4g3BG8u5DclmKJawtu1FArj+QgiPWElywgmRjvevxRgws7brz0BYmlWr5ryFxWsjjbEhnHwA== X-Received: by 2002:a62:220d:: with SMTP id i13mr5426648pfi.162.1548316059663; Wed, 23 Jan 2019 23:47:39 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:39 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 32/50] tests: Modify macsec test sets for python3 Date: Thu, 24 Jan 2019 16:46:12 +0900 Message-Id: <20190124074630.4192-33-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234741_714147_5FDF0E35 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_macsec.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_macsec.py b/tests/hwsim/test_macsec.py index 871e465ac..ee9761657 100644 --- a/tests/hwsim/test_macsec.py +++ b/tests/hwsim/test_macsec.py @@ -146,7 +146,7 @@ def log_ip_macsec(): def log_ip_link(): cmd = subprocess.Popen([ "ip", "link", "show" ], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ip link:\n" + res) @@ -482,7 +482,7 @@ def log_ip_macsec_ns(): def log_ip_link_ns(): cmd = subprocess.Popen([ "ip", "link", "show" ], stdout=subprocess.PIPE) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ip link:\n" + res) @@ -490,7 +490,7 @@ def log_ip_link_ns(): "ip", "link", "show" ], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ip link show (ns0):\n" + res) @@ -498,7 +498,7 @@ def log_ip_link_ns(): "ip", "link", "show" ], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) - res = cmd.stdout.read() + res = cmd.stdout.read().decode() cmd.stdout.close() logger.info("ip link show (ns1):\n" + res) From patchwork Thu Jan 24 07:46:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QMsRFr10"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="uMj570Wg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RFNs4A71"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZTH21K1z9s4s for ; Thu, 24 Jan 2019 19:05:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pmrYvA/xdm4EUO5TyWuL7E2u+KeIU+BCWhtObi/Fbb8=; b=QMsRFr10cT9pbRh2bWJ8DnO633 VZiwB9zezsVnVxUA+IInd5A0FgZyKDjeOByeofoM1etWYjqDkkNHCTuMFHZG3IXdGTDoEhQ2OqC6b e8tWdLK6m5AU5oSYNhrLnIST5jRSVaa3hrrdeG49o9KgU9tJA1mZbTQF06x3Viaa/kv3BDm59MpBi j687Kvm1pwoEXZTd8QgMZiIbmbd6UsoycxMQWUb9Ck0A61OQogtb1ZyVR9W4RnEKYE9Y7tIJeVw6y UZoq+DzLX1MLQmX1j0tuNnpoBdLRH43Gbh2c5Ub2FoSuVLdFuXVgXHOSW2mtifwtqY9AgVkYTUE2C LNRCohxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzY-0002R4-7U; Thu, 24 Jan 2019 08:04:04 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyX-0001E8-G2 for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:03:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5FPg4qYQCTTorsDBu32kLNATO69PJtEb/ZIy+JYm/d8=; b=uMj570WgwOyN3kd8wGKvVIR7Z 14mDPOP0BMTSHnd9UujfDOPynZBwqsHmptdW4SCJl32DhYb8/ElMJjXbO4WHaFbLA11GfYu/pTNKc Gfbt59vglbcCsP5HGVjOZk1SefpcsLQsGYVkz/mQRJ7Z+fP5phtiMPnDmiLzvg+MMXKFD6/SvyDLk AZzsVmsOjd86kKpX06IIZTU0otuOAlZN0vE2B1fe2BJ7ZDsDabsSOY1ZEPH2q0hIzzcgI/G3U9sLD 88YPeaVtyiTJ2L+G+GXqhik2HU+tWCScjxb4J4BKtfc/+kjNIdgwnS8AZ4I4AcF2CN+EuOrjSD5pr eSRy1DbJA==; Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjj-0001uG-Go for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:45 +0000 Received: by mail-pg1-x529.google.com with SMTP id g189so2311284pgc.5 for ; Wed, 23 Jan 2019 23:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5FPg4qYQCTTorsDBu32kLNATO69PJtEb/ZIy+JYm/d8=; b=RFNs4A716EmCWD2IQ1NmZ/CBphRKxa43UT6mFSguiCgTOxabShx3B5GITX5XUFFb2A E2KGli9OZEQieiJUfE/RBXhnMn2juohlca+CIzbwCg5fs7j2BrfDH9NV+Jl4PC1441KM gG3zNif45/vYyZG6mip4MobX4PiYba1FrXN2CCGnEGJrZEVSuJ4zWZm331fduSNWcyVz Q09RLbIKBgyPQMbpLLM/N9MUOUVZcX8NvgwomD8bNkNfs8be/tS9nCbwfsAehufxBdhi WWJrEZFdGnaNib+TvWkjsMUFPREYPqeyPgrht9TiKCeW+rSGOoUy1REhSgxzBaLJ16z+ OgGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5FPg4qYQCTTorsDBu32kLNATO69PJtEb/ZIy+JYm/d8=; b=BcOvx9BPyRq3zkq+eqzSo0axIKGoSHmI4lCmajbW5iciuHzb411YF6t+54Jh5eRXb+ 35Yxt1ot/wOsP8lfSfeZMz1Cckw+jWL98vyoKexrH6jo/bvH18fMCTWWJ1/jkS9XaSLn vlN08tp+SGUCkjVxwUoBDC/oFeAuxbI3xyoT1m82pXiVcYKlswJeBgvQ8+PB8vCZ0uUe A7KfzkjiLg+yjc4joo/XTWwdwBbHngzLePRBNLOvQeZVO2hJA1MZUjUUKmqVysIF94Ww FeUsmVNR5TOOGaV66JPnu82Assd7QnPDbGvUgeWCDJWDqAq73P9DtCoMh89mDSfXCzCU F2/A== X-Gm-Message-State: AJcUukft0G0nrYlSP80/ntpwT7Q1MFRgL2hN8zXq+TPVN6X+7J5f9B5t Ojl3nt4tSextZ0DJnW1oo2W9yXG+ X-Google-Smtp-Source: ALg8bN5RdwHiAGUURQFqHU5QQ1Op7Z4TDPpdNgvSrkcX2pWdC34dSuvoWS4Azs4Kawt70LJDT7WQhg== X-Received: by 2002:a63:34c3:: with SMTP id b186mr4859468pga.184.1548316061380; Wed, 23 Jan 2019 23:47:41 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:40 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 33/50] tests: Modify mbo test sets for python3 Date: Thu, 24 Jan 2019 16:46:13 +0900 Message-Id: <20190124074630.4192-34-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074743_569814_E6E65B21 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:529 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_mbo.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/hwsim/test_mbo.py b/tests/hwsim/test_mbo.py index a36aee2ba..586d1d53c 100644 --- a/tests/hwsim/test_mbo.py +++ b/tests/hwsim/test_mbo.py @@ -11,6 +11,7 @@ logger = logging.getLogger() import hostapd import os import time +import sys import hostapd from tshark import run_tshark @@ -212,8 +213,12 @@ def test_mbo_assoc_disallow(dev, apdev, params): out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"), "wlan.fc.type == 0 && wlan.fc.type_subtype == 0x00", wait=False) - if "Destination address: " + hapd1.own_addr() in out: - raise Exception("Association request sent to disallowed AP") + if sys.version_info[0] > 2: + if "Destination address: " + hapd1.own_addr() in out: + raise Exception("Association request sent to disallowed AP") + else: + if ("Destination address: " + hapd1.own_addr()).encode() in out: + raise Exception("Association request sent to disallowed AP") timestamp = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"), "wlan.fc.type_subtype == 0x00", @@ -449,7 +454,10 @@ def test_mbo_sta_supp_op_classes(dev, apdev): logger.debug("STA: " + str(sta)) if 'supp_op_classes' not in sta: raise Exception("No supp_op_classes") - supp = bytearray(sta['supp_op_classes'].decode("hex")) + if sys.version_info[0] > 2: + supp = binascii.unhexlify(sta['supp_op_classes']) + else: + supp = bytearray(sta['supp_op_classes'].decode("hex")) if supp[0] != 81: raise Exception("Unexpected current operating class %d" % supp[0]) if 115 not in supp: From patchwork Thu Jan 24 07:46:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QqYlCRED"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MWr6+Yy+"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ9N4Tfdz9s9h for ; Thu, 24 Jan 2019 18:51:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EY0Qoj1v3x+h0L69f3ADOC92BKtYaw8UynyhfxWaCXU=; b=QqYlCREDLATiHKIgnI4ifTlVI3 LuU5ATfNHavfv9wJIabuL6RsjU7DJs/mBvWVLgWVNt+Fv2CijKN3Abc7ztTHDOwEC0j1AWMBWjKk/ oLLZ5Qw9ltsldn4EoRVMNth76Tc8FvnLWqDdGn+JM/bK3OOL6omMW9zWiOtqhwvVbtkICUIIhdBzv LvwyBi0Eyz9TP0PwrzkOlXtNYdKS45Kwc/TUDRmPl78sq1ElVNlWf63VRYGSTSY2DF/qbH0SwigdN 0c7UxqhNjBGZ0WBJKZmrCS4Zs4jSf8833bkCuDHsNEuZpaXINgW0DVQrIqr+Ip2gqUrWJL287XC1Y pv5Qb2cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZnM-0002sG-7r; Thu, 24 Jan 2019 07:51:28 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjk-0006RU-8t for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:24 +0000 Received: by mail-pg1-x534.google.com with SMTP id d72so2300876pga.9 for ; Wed, 23 Jan 2019 23:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OCw09HJ+xvDpAeSk5MTpAjp3EV4HJL1jBIdknlW8ZYY=; b=MWr6+Yy+Dha1cIgfupfckSe2gccubw263j0tjz193lQXExAImlRfLJ8PI2VzWcFQd0 IyWRghcA+snlD7T3TsuIz1f+aodditu2E+ADNJk44btqDdT4CfwUTGFAYYaleRnqJ+on fVNLpIEVFTGtOQccJFdbdkez52H/Z33tgGghZhA9wDFWFVG5wue0G3OIxqiE1uOVwqqM 4kTz3MlEmnvkoL7UHlukqdVQPpm5q7YVqDDoh6QsfBC2ac3/4N4WoKWEKkz5efZEO72L fJRzmOSeEmvvYv3pE0vEHqkplQ1q1qc1/XG6dyItTuBcRONOFu2p783FtjO6ig4CLlgT BH3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OCw09HJ+xvDpAeSk5MTpAjp3EV4HJL1jBIdknlW8ZYY=; b=L1zb+NrboKugYw1TE31wv60/31qBOHhSZbTHNX7a+c67bjLanIv/zVjYj1wFC//U2i 8/lhcHLflUUnxCxGRV72TsarOU/nPp0eM2WkauIjytLxwbA58pIxz5Vm/ttnJqgGi9E/ 6UUtpy0/AAWKdVsgcoUrvVv+xKZYaZ83i4y7NFhOYAzVN9xEr8Ouh1kPRF0I0vKdwXDw qcEqE++5UmE7t00GVUIZ+Br31i0EKglDKWscdGTC7IGK5yisTggbKOlbNbev5x7Hohlz MI7wXjdYahbG1fNIxNEyYxmFXDsDUjyT969IxtkBtfyCQFfY3HKyNilvbrYwlrUmYgQo he/g== X-Gm-Message-State: AJcUukfIHG/POITH1wGiWmvZ9pvCIxlcZrkYV9b1/q85tsMxDlausd4Z axLUgvikkqzGiIfHduDoycXWLLW9 X-Google-Smtp-Source: ALg8bN5SNKVhTAHfAd/lXxC+u4W47ZUF1IRtySBYx89IN/DYytOfL5+/Yw8WSKvfkQCy8wTkTx18Rg== X-Received: by 2002:a63:1904:: with SMTP id z4mr4899716pgl.135.1548316063163; Wed, 23 Jan 2019 23:47:43 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:42 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 34/50] tests: Modify nfc_wps test sets for python3 Date: Thu, 24 Jan 2019 16:46:14 +0900 Message-Id: <20190124074630.4192-35-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234744_412487_A2431B89 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:534 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_nfc_wps.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_nfc_wps.py b/tests/hwsim/test_nfc_wps.py index be30a99e4..81d952563 100644 --- a/tests/hwsim/test_nfc_wps.py +++ b/tests/hwsim/test_nfc_wps.py @@ -8,6 +8,7 @@ from remotehost import remote_compatible import time import subprocess import logging +import binascii logger = logging.getLogger() import hwsim_utils @@ -154,7 +155,9 @@ def test_nfc_wps_password_token_ap(dev, apdev): dev[0].dump_monitor() new_ssid = "test-wps-nfc-pw-token-new-ssid" new_passphrase = "1234567890" - res = dev[0].request("WPS_REG " + apdev[0]['bssid'] + " nfc-pw " + new_ssid.encode("hex") + " WPA2PSK CCMP " + new_passphrase.encode("hex")) + res = dev[0].request("WPS_REG " + apdev[0]['bssid'] + " nfc-pw " + + binascii.hexlify(new_ssid.encode()).decode() + " WPA2PSK CCMP " + + binascii.hexlify(new_passphrase.encode()).decode()) if "FAIL" in res: raise Exception("Failed to start Registrar using NFC password token") dev[0].wait_connected(timeout=30) From patchwork Thu Jan 24 07:46:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PfAjbCc/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="GhWDAqZt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="no0HmCEi"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZSk52kJz9sBn for ; Thu, 24 Jan 2019 19:04:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=28Nv533b+uwvCzVeBz6Zbqo4yERNRCipd19SwqDC3ls=; b=PfAjbCc/vcJeAFnc1GacfGtMXM m62Am0/u8Defn9KlSq3llCdpZyup0HUzFcL536qYI5lxCnCyZ+XAMgEoZUv7zImLRpMkAMMCouIwM kxUJ3GDBhLWV76z7vwIyuxe/ildwbEUICgYwGV8R/2KZ7rLdVN8NVb4pQ+xzDVaof9h/zUEcULAZV OzeQD7Q/AJF4PSzfxmQQFRQDNT7yqde5k8QnmtSKpR2mfYuXhWu8Kxyz5geiMer7mgiBO/Yai41WQ 2twPmaj5UstwTqEav9tnLgds5ajWPXU3KCHTXLoBmW7eHhmFi22SZqXU1du+3MGJKEx4gjEHc+caq zZ6AxFtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzO-0002HF-GP; Thu, 24 Jan 2019 08:03:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyV-0001E8-0d for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2LyzVOM8LEb0wPqOwZBPnPYppBEvrRs1KANmyZ8FTng=; b=GhWDAqZtvSdasE7KYWM31EwD3 AieWbgd4el9Awx9vK39pfsPXgrYcGCqc8RuwRGpJ1Ijd/MIje9SFeFUy+Sw92jp3k2LhNR08VBY8z CkZpdvXbcv9outF6fb5EFZ/7UTFOCFO3nRYKqqJjeUTEuzHZ9zFB6lLEo+yTG/UNxUntU25JSy8ey xW00ym/wtMw/wacUnFaoWTgBtYU0RpDrR9d0UfNPeNKcmTE8sSdh+XOR2mhLrCBJ0aKK05dWmLZW4 lXryc7YEg5I0wdvOYybkuoXaAKfqvLVkVnmMnLyoA1CQcbvCuMH5PT7n+oiDMhaiWFKe5hhZeXKV0 q/5pPRP7w==; Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjn-0001ue-5R for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:48 +0000 Received: by mail-pl1-x629.google.com with SMTP id y1so2503095plp.9 for ; Wed, 23 Jan 2019 23:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2LyzVOM8LEb0wPqOwZBPnPYppBEvrRs1KANmyZ8FTng=; b=no0HmCEiYnh2O/1/Q2gRoEZ/3DZ0DH/AFqI10zOGw9GXsoe6QYkeJeKaDz958hs+BK OSAUmEjyzReGxESENo8vxpAAQ78lw2IjcUXh4Ab6b9o3VTWZ2ErxSPQTO/WnBdSF4SLp YvtrjLIO6+PnUTHldz91ypnxEVElkCEhy7UC9h3cEmUtGCdUCv1eoVYayVCOy8WFKF1o tfTxOgtPAjdY81SZJvBiCwDfsdq2baQOBdXbLRCIJFXXpIOFl4pk4WxQjw0U4Q/elEZR TwJYE83txXgvZK0Cds3JGMh+P2MNyE4Q02om6oMcLDis+EeswQdBiH2VcUjZRp4v5bjy qDng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2LyzVOM8LEb0wPqOwZBPnPYppBEvrRs1KANmyZ8FTng=; b=pNElSMzgIhQx7aRQs1reghv8zShy7tWwXyuu3EH3qPO9NLBZUz5I3TKds+6QY8Urvb AyAlGIxTJCuE1HDpGVYmY6QA+g0xYFzskPfH+iBuUKKEZIODsnYL67nX86zJKkjhE/vb f/VJtPxkGP62bp+u05P4qOAvjFzU2yfB9mTKR/K+NxIg3mDMnBZqSWvSZM/qYgujusr2 QK5yMsmRKlrfRbHgfbTLkj7armp70VzCVX5JnY/I5ZeWJkBHlfJjT5vztGWj5n6er6wj AnKFHGMI9HxziGnuKrN6BhALOyEUXxMonVfLENQVBScNkVLOkkORp1Y8QbpgYCnjtCTr j9tA== X-Gm-Message-State: AJcUukc/4lJd/4PRKeV3LsZTVDvKIZV8rqs6/3RmY0CLFgHmAUfXYzR6 BwWyRzsFWhN3N+sQ/8rZQmpGRU13 X-Google-Smtp-Source: ALg8bN5v0QJXVfRHyODXW0Yndf/gUQRFGNkFeosrjimmBksMWbJVixsRov4ktvC+9sPGEYDMKBPu4A== X-Received: by 2002:a17:902:20b:: with SMTP id 11mr5584023plc.57.1548316064833; Wed, 23 Jan 2019 23:47:44 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:44 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 35/50] tests: Modify ocv test sets for python3 Date: Thu, 24 Jan 2019 16:46:15 +0900 Message-Id: <20190124074630.4192-36-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074747_214471_A37A2A2D X-CRM114-Status: GOOD ( 11.08 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:629 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ocv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hwsim/test_ocv.py b/tests/hwsim/test_ocv.py index 49fb8f0b5..08e681331 100644 --- a/tests/hwsim/test_ocv.py +++ b/tests/hwsim/test_ocv.py @@ -22,7 +22,7 @@ from test_ap_psk import parse_eapol, build_eapol, pmk_to_ptk, eapol_key_mic, rec def make_ocikde(op_class, channel, seg1_idx): WLAN_EID_VENDOR_SPECIFIC = 221 - RSN_KEY_DATA_OCI = "\x00\x0f\xac\x0d" + RSN_KEY_DATA_OCI = b"\x00\x0f\xac\x0d" data = RSN_KEY_DATA_OCI + struct.pack(" X-Patchwork-Id: 1030343 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UEuTncam"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="uJi80CsI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kRYD9avF"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZbg2mSVz9sBn for ; Thu, 24 Jan 2019 19:10:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9XjCT/WfHmwie+xygOG5kOR5Wc/BPh79ZXJFIvdApes=; b=UEuTncamqcnGoQTA/uJTNvVv8O sYOyUiYkp3eXdENQjQfHtHFiGIaejndIFrYLb6CPQP+wiIsdE2pRjWYRjopD1/HWNc6pNWkdTcHXy J48nshOeblHRKU3ztwLeRGwqeB4yiWpMfpVcvKYtzP0r2yKfzLE/xX1LiV9dmh4ncQqkDHjGv5OBx KIEwhm3Gn385MpUCLULo1/Rjixys8p9J/fFyxKz72AJDpxgFEXoL4QJIA87/GJ/7ykjvJ3W7fFfVV DAXcqvUXaa1Z/n2SXaLCqwY73BBTqnrhjHVUUJPqE7yEJ6EbE17SM+MnGcBv0CwAvsBKT09EOlTJF 1b1qRqYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma61-0006IC-Rf; Thu, 24 Jan 2019 08:10:45 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma5z-0006Ht-Cy for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ykw71j/uXaIaNjon3xMdwu7v0uptWCi1wBCyPl9CXJc=; b=uJi80CsIY5NBuaLveUiFuZehk gS6NG2tT1PkqmpFb4iIMKp93ZoC+INraujMXs94D8ZZSNVRK7mvw4fSuThHsc4dh9buTT+A2cfc3W AcWA0SOJsDnIXCD6ajwyhwM7ZS/PObNrBd0DHAFUdNRVxUoCAIlXT6ha2G7GjkJDdACZm7eJDc8Kr oF1iKDIgWx5ZqA4mt6aQqfkBLqAvjo362tNyagOPVzv81PXc2DApLbomVjay7uz86GeWUzOEKOUY6 OrSPiun3gDEqrSdSzPH2gCJRxsar9nlcIeknm8Ch97RP7Mt4Udei39tBr0OZooJ/kL0saeCBcUNlq EDZp9Sy8Q==; Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjp-0006de-Ma for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:50 +0000 Received: by mail-pl1-x62d.google.com with SMTP id p8so2521807plo.2 for ; Wed, 23 Jan 2019 23:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ykw71j/uXaIaNjon3xMdwu7v0uptWCi1wBCyPl9CXJc=; b=kRYD9avFA+gfZ+CQ3/Oi9iW5nuI9btrn8i5fCl0eEtBlIpT6/yvJ3dE9KrF6nYG6w+ VhwSU0aLgurVaaydZfjJZB+hSR2B6Muc2Z99WCvdg8RYe0vvS/po9rQmlmjfVyEaSG0x z4Ezh4OA/+tsxm2FHHFrLVd21DECE0+aqTtOo0KvaPpu1B8l8pw4c06JScPoM/sWkfL9 u7Ah8Ezmt6skD23Jegk66PGJcoL+MixA5/8tVbEYGrcz94E8RXFIzO2NLebbcfDuHGeS DLTvDNOzwIgK8Zhe8E57SIGw3u1u/yNkqtbLiLvDlh4JDnqTes38/cYmfV2JOU0TIX1y gcog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ykw71j/uXaIaNjon3xMdwu7v0uptWCi1wBCyPl9CXJc=; b=tV2YvhvtMy8SsuPXWg5ZM/ezNBLxrdfOGYtrPvx4TMSr1Dp1QRmdBH+zeRwhlPF223 lpUPfcY1TPIaajhgJ8gM6CnNCv2ik0CVdmsqJODJyJFrJCbvwovCPgNylQlvBvN/eh2A 4q0Lchrz/mz0uA4tEM9bzprqZB/HdNjypKqt09PENtZFn17GFJXyA3pJ2vtfw/V8VGCt g2xPJR9OTWQewMaHoHqHXJlWRLS/zqib+p5hqp24yQz9iulm+k88R3oXdemrYBQOZGTR jyr6mTDc1HKyMnzTm3C+s6QDNRPBxRtLGgkkrlxA3HSJSH8UH1BoxNDvnT6K7Iv5qd8g FQlQ== X-Gm-Message-State: AJcUukc9xUukgWC5bH5NKZSiQ6dpYathuYG0JSmDQx8tSY1pWEWIruod aRnx0ngxGH4+nFLEoisnGnA5i2ne X-Google-Smtp-Source: ALg8bN5BQ+JTIX2kIrcpuh1RVJKmg+x7UdUpFIoEbE/S7sBFCP3/d0F/MpIwNKH/FpbMw3TW433w3w== X-Received: by 2002:a17:902:3181:: with SMTP id x1mr5512330plb.58.1548316066602; Wed, 23 Jan 2019 23:47:46 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:45 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 36/50] tests: Modify p2p_channel test sets for python3 Date: Thu, 24 Jan 2019 16:46:16 +0900 Message-Id: <20190124074630.4192-37-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024749_808835_1D0BE9A1 X-CRM114-Status: GOOD ( 11.36 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/p2p_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/p2p_utils.py b/tests/hwsim/p2p_utils.py index 6c8a3cc4b..3abc00a62 100644 --- a/tests/hwsim/p2p_utils.py +++ b/tests/hwsim/p2p_utils.py @@ -241,7 +241,7 @@ def go_neg_pin(i_dev, r_dev, i_intent=None, r_intent=None, i_method='enter', r_m pin = r_dev.wps_read_pin() logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname) r_dev.dump_monitor() - res = queue.Queue() + res = Queue() t = threading.Thread(target=go_neg_init, args=(i_dev, r_dev, pin, i_method, i_intent, res)) t.start() logger.debug("Wait for GO Negotiation Request on r_dev") @@ -321,7 +321,7 @@ def go_neg_pbc(i_dev, r_dev, i_intent=None, r_intent=None, i_freq=None, r_freq=N i_dev.p2p_find(social=True) logger.info("Start GO negotiation " + i_dev.ifname + " -> " + r_dev.ifname) r_dev.dump_monitor() - res = queue.Queue() + res = Queue() t = threading.Thread(target=go_neg_init_pbc, args=(i_dev, r_dev, i_intent, res, i_freq, provdisc)) t.start() logger.debug("Wait for GO Negotiation Request on r_dev") From patchwork Thu Jan 24 07:46:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pl0WDzK1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="AyBKGllE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DYJzbSB1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZRY5QZfz9s4s for ; Thu, 24 Jan 2019 19:03:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MCtWvI+0v75lyy1iO3lvyi4ugw98PEcFNFBpbtmNUfI=; b=Pl0WDzK1nMqY/F+W9ZkNv1UOJ0 qkZeucBSsWima1sHjFjr1iFwtJ5hTEGbYCXVSGH4loHdHY2XrUq7yY5uBLuZrKGVO6uyajtCkgLVZ gccdqAmRcSdQJ0RzI+Zup3m6KSXuXiiUckxe4Nm08pXGWreap39JFQzhw9Dpf85faVUzsnxEQ78HH LqBT5Q4IoQnva43f9ilMvpVY6HTJyR6859W2UYRdfs28jv3KpuZi9rzA3USrwp0iY2Ah8XLqd1m0F HhDePXH6WfgmCj5aklvYvXMqfuwANg0/tth+npq9D09nVECBOJDMhbARkhf3lcMihVyK8m9fdcgBh qsS12Kew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZzD-00024i-1B; Thu, 24 Jan 2019 08:03:43 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyT-0001E8-Vy for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4yEAMDP6xQW57PJgqRvCzLidfPLBxgKmZGDlnujJAOY=; b=AyBKGllES9GOdZcLCeKpHtyt0 wKq9uapvtrl3hWvBDHqLSGbNSQGNnpm0vrTqEYV8LGH+0dVLnU6IVfwhitbSc9lOSxInHNO5rhmK6 hUGYTWEXDmaHuUH/uVeYkHyIF9mGSPID99tX58j1pnxucLMVS1Ihx9KEQgVZY6rIpyCJrh0rLlRoK oklcHqi3SYvr3plDeBWdu8X15CprlikDxWAm2FWoCIIqBFWvqwEpLJfz608tNd6xucjkDR1xblmlH 6V+gdX7KorF362rgmSTNPADFJXp9dDEB2oXljIsURUiqb4RSwF8jYqu06HYxDisLeSXg0d4wX0t4K Am+MH+pFw==; Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjq-0001vH-Qn for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:52 +0000 Received: by mail-pf1-x436.google.com with SMTP id 64so2577964pfr.9 for ; Wed, 23 Jan 2019 23:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4yEAMDP6xQW57PJgqRvCzLidfPLBxgKmZGDlnujJAOY=; b=DYJzbSB1Tmvx70Oos9Wu8AgLNplo0ny96H8xz0wTJbQG+x1kG1eF48iAN+YWuOjsgi FDislgxqmPJiZ71CCxZSTjkZC7RRBB2UcvnTTgmXgPc8an2SZTOBggeMrxs/pPVDyWw6 3zpwxDGo7lps3q0zGm9BeRO4mckqlF0e0LUhTpK/jfIUDgsJKnrAdCd8lKcZNmrtwr2G KupMSan5gNw0HWeOUfCtp8oxIgSxHMTL2mDK43pWfwSDlwguapMf0PEmFxXiv04ddKqc OUd/5yWmrjuvOomIIwGl7WNTCwKf3sE4BgZ+E34x3HUxn6AQHrjC/hqacBt1HEe6gMw9 GGzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4yEAMDP6xQW57PJgqRvCzLidfPLBxgKmZGDlnujJAOY=; b=AvBOKDhbdmn9lADg26aQcT9QrNeAtAmTrqrgVfpJ34aQsm/DyLy7CqtQc7JdwVR2hX iDN9VHN54i4lwOtLR4hJx/0Y4AF/pFj/vO8AdsIfqi2mdvHL46RMUnxxeg97coeB4aDl R4Q3DA8hGfpu315GvKkDbTQaOMnqTjpenXief9C0da73AqBH+0dD/6T4tCsoHr1TBxYe hRnTPCAP7wCK4q6WBSG6z8ALxpRp8EXrOERc3fBlaUHvZ7Pzct+RM+TY/B8o6FvZTi22 m4AoT/IxXHyRX02dCfFdTmYBqm2MGbVH0M3E9lg13HVZY/N5HO4M3mkPkI5p2Jc5aVWT ufsA== X-Gm-Message-State: AJcUukdAszeGX44N2t/I/K5ZhAVbe4tJw94QXw7S3ecej3Jf8rYrpfdE TQRDH7ZWl7+Vzn+a27doWTVdGT/o X-Google-Smtp-Source: ALg8bN4zBz3T4SG4SWs+J5NwV+QlbEd876hFPVdf8ZSlBxylN9inZ0gAh7j/qkX2YdYtGImBIanEsw== X-Received: by 2002:a63:1444:: with SMTP id 4mr5062587pgu.430.1548316068279; Wed, 23 Jan 2019 23:47:48 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:47 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 37/50] tests: Modify p2p_grpform test sets for python3 Date: Thu, 24 Jan 2019 16:46:17 +0900 Message-Id: <20190124074630.4192-38-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074750_874091_3B0C515E X-CRM114-Status: GOOD ( 11.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:436 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- 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("H", config_methods) + struct.pack("8BB", *t2) + struct.pack('>HH', 0x1011, len(name)) +name + return 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(':',''))) From patchwork Thu Jan 24 07:46:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kf8+F/xv"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="ayCnMAtj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JSYyRzsv"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZRK5vGGz9s4s for ; Thu, 24 Jan 2019 19:03:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=g48PvvJUBOOSfdQ1Z30mODAKYLuinVXSawPh6wpsDU4=; b=kf8+F/xvA46pE/DXOsrK0YImmd R4V5+nnoBFYY6lE7KRwWvtqzwzCxFKG/937a+6XAP0pE5hPTtFffKevwOYA9v4ATSUB5ykWhKTViQ 4MEvCcyFzGMHe1VrVQQ0tU6gMyWo5ucC+V/GUAsivT8jGyr76+NDoCbECCMYfKyWOFJ7cFlevJ7tP tsk/vA4JTN5zHERFg1MEe9YzDUm4EU6Tep5+mQ/Ay/7G7toXIG0JPbJ472c/pUAN4pTbhVbVl5Xp3 InMjHkM+m0KfVPOi75YCR7OosXy96muM3j1QDUDk5ra9PWG3lrKi/U4IGbP1g0OIJt5/0BYom2YC7 7soYjQQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZz3-0001v7-6M; Thu, 24 Jan 2019 08:03:33 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyS-0001E8-LI for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2wSOs6kQLTaDB7gN4dmQdTN5HWDNf69n5g3lmjxD8j8=; b=ayCnMAtjq+483v3y26p2tF5DY e3YH5FbmAfnCgCQf2L3v878nE/J1PBuK4ShMqrushF+CY9FUvJu+KAMZCcVcacDPvdMp4oomMIHEW vSfItvej4VjNF6moAQ8wN0PohbJy0SvXveIFr3pVEEQQhqfIl6gAQY0ntwq8aP6Te4MUhx83Do9ZX xjrTfQGDXVvfqUN4y/LVawk8fsZGBHeJ+tdsVFGUNqZWyPtxad0sQPAI7H0ATvYZLf8pvJ4b0atoN CZpf9bZvSaFoEoM65wUvtWBHiReTOvM2A7C+iX6zp0I4Rg6p4NFwewc+c9U9454/IYlaKvNsyZmYT ZfrWGukPw==; Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjs-0001vV-8V for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:54 +0000 Received: by mail-pg1-x52b.google.com with SMTP id d72so2300970pga.9 for ; Wed, 23 Jan 2019 23:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2wSOs6kQLTaDB7gN4dmQdTN5HWDNf69n5g3lmjxD8j8=; b=JSYyRzsv2Z+N49D5NK+ovfkXWn/poUn86B09bVJikVZKr2IQ+GeJ+bfwBgDw9bhWmU M9uTYaH7+UXr34LtnEQDrWrT6j/iQuqV5mVQCOhdrjryrSPxd/v2nWboPo8XbF02HhKZ 9HCpgYJH2DMFCb9qmRbmqNvKVca4jz4xTOwDx0uYGw2cyzIMFSdRQavu8tt/Ji6dTvWm ioyCT9T0Hkpfq6lG/hh4z1dvEwVB/Rswz7e021ve/O7/1MlMOjleSPCtwzlV2OjnrSck rUTkqftqzLpTrynIfwJ/nAsz0pa0tFxtVOo16Ccdr744vz+aeqFPEI/+hcyNOMEGjLtZ oLIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2wSOs6kQLTaDB7gN4dmQdTN5HWDNf69n5g3lmjxD8j8=; b=Zx13cEq+uagPGnNUJ4bKcaYhP66eLWpBZgJZGOcpAafpUe9EpGe+HxOWcPwEL1MtI/ DAQK8D3jUBEoRHl/E9wLxMFXOxcf9AVIUo7ZQWLiii17+f1ebzzKUw0NWkmIrYo+VB3u +7I0ohI7oBNtJ33OGFgtd7bM7VfqRhQPFnYKenRPpyat2XlSsdhXs0wyWbe99/pCswpI iD/kkgEZICq1BIWvspjgRiehW7JNEIIoNwCCXw2IQYwDJynUh51ZW5fID9JSCuU0VkUU 6oMhsTNaOPYBQrjzmDn+e9CPKAchlZsqn/VhHOvhkASdEc45NN7S3eZ/sEWsbfGaDy/o 0TFA== X-Gm-Message-State: AJcUukesdNdPFlDtLFwh1dxE+L8b3WVaj4G+7GSkUXsqzhfyHAy5aMMg 6PMBy6qxH4O0n/+mES0ozNSviayi X-Google-Smtp-Source: ALg8bN6FLh83WuRRdu211rGdnorsLuh3l+xqAiTO/8wdgJXsVinHoWKFHXNt7zxm2Ds6F3r7Sz+BRA== X-Received: by 2002:a62:5ec5:: with SMTP id s188mr5331662pfb.145.1548316070011; Wed, 23 Jan 2019 23:47:50 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:49 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 38/50] tests: Modify p2p_messages test sets for python3 Date: Thu, 24 Jan 2019 16:46:18 +0900 Message-Id: <20190124074630.4192-39-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074752_476507_D695DC9D X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_p2p_messages.py | 93 ++++++++++++++++++++------------ 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/tests/hwsim/test_p2p_messages.py b/tests/hwsim/test_p2p_messages.py index 710522a30..e2d64d294 100644 --- a/tests/hwsim/test_p2p_messages.py +++ b/tests/hwsim/test_p2p_messages.py @@ -16,7 +16,7 @@ from p2p_utils import * from test_gas import anqp_adv_proto def ie_ssid(ssid): - return struct.pack(" X-Patchwork-Id: 1030347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ddkqtQkF"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="V6VpnbDz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K7lVWSaM"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZcK2xJ3z9s4s for ; Thu, 24 Jan 2019 19:11:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iLrrtQuI1ILPGNf0pO++ovjBLwR6zpBaBaz2uMZKjB0=; b=ddkqtQkFaQCnYa/iqcAnvyVi4M dHP6+/p6LxhZqxPPMyU1LRdZzb1FxLDDwGztTUWZt2mmjZuRvPE8SqSoNAHR0IoTSRAQ+jibUd7b8 ZuLducm2+zk2/BaIqQgH3e5f7VQkO+wQsvzzIapX1T2MXwiPx+5+PtSOYVCkuhzQHERNCtyZjYTLc d0WPAsUyeAUZ8N4/0/G9eHaDFGNiXAcPusGA1GcinICCbCtJiiMB41zS8VLfb4TC1EupxOhBWPdPN SqhLfP26XQaDXeX5cnwzAyy55lVMuj54H77N5RHQTivscjjwEPh6SH0bImgQIwgpUQrxLNsRn+hgD oNU5cetw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma6Z-0006rU-4B; Thu, 24 Jan 2019 08:11:19 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma65-0006Ht-GF for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uCnID4jO54Lj9M26ggQIOeyBnn6a7WWD4FNgKGNaoSA=; b=V6VpnbDz6g6cpX4QZoBz4xkLM OywrEHarYNmJDFSz8A++RzUc/mmnqk4lv7PlEg9b3ES8/vj4JsiGKuvBJ1dlocN06nePDFekkVX0D 1CCPwmBZm5pkKNg1FePpRrF1kDipL+pbznrG/J8xU2WVQWljzFLSVv8FfK2Kv933OVs6qtWe3s7te TZPglVWu0t1aCabvIHAlj7U4/7deUVsmsGUkwoK8fGi0x8ENpVvrjVdePNaJQiK5xjPv3240WQaA6 4ZZvQdKHC+1LPzQsMUi/HuuTCSLiFNK6qCkZBn3R1CkSz3SAyQf+YlA4tBJjaovb3uKh5y0rfX/7I 8BCWfCNcg==; Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZju-0006e1-Mt for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:47:57 +0000 Received: by mail-pf1-x444.google.com with SMTP id w73so2574815pfk.10 for ; Wed, 23 Jan 2019 23:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uCnID4jO54Lj9M26ggQIOeyBnn6a7WWD4FNgKGNaoSA=; b=K7lVWSaMilqagIf7de0K23Po/TDoGEytAJe6Wgfm9FdzLJv80+Kd3JsqKOTCFoERoQ 6zu7e0J4K/qZ4I5H3sQtZJ0py0s3x8pstBZMuHpFThgA884kftaENdCYddvy8W88orha c+5aaSMJIvioHE9kszCpKTcU8pXx0KnPowphggk2EP0O3Fju0DiZMN3xmFnElOfMrHxH vqBoAOtXrA0gVN3hUzDF2Okp+ftDRiduNI+74OwatnzSRmeCBf/jaKV0pTcseVEygp/Y GTG/YBwn98wcGfvgAfvZxyAGPira85K8yNayKw58zKTn4nL3hUnYP4nynSvYIaxIEyEu GHrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uCnID4jO54Lj9M26ggQIOeyBnn6a7WWD4FNgKGNaoSA=; b=qxu65C37xjbyoHiqSLcqP+ZkME9WutiOe2LM5arVLamCayKm+ZQ9kzhHKizHdh8Q/N +R7ZsGUZUNdhwRiatTMU57ndT5pSTFNyzSE4Rbq/bcEVV3HqJPbVQ9cWcLzCf7/zikQq +ZjUxRv/FjA2QoTglW1zHKBY8kW+Qm3hzBIXsgNm1sYlPJqCnslgK+rX9DDgCv+mlAwr wbufmQ0Xqx70fR7l9Na7jGcGrsdtZ6gEaDhIrRcXmmYC1KgUraAy5sNp1DVhOXAZrlbj vLNv9et+AqP/cbiwKwoGSq/If6qPszrVFcPTGb9PZZoHlzqqgepgctQ5DcghVbzx6Ou0 5IQQ== X-Gm-Message-State: AJcUukcSB0KU1OHCmFTlaf4mzITeMsPGY7/qYySOzcnzGp5pjksMJrB5 +VQEt7hhnzBkwr+INFlV9UjiV/Wy X-Google-Smtp-Source: ALg8bN4XOi9yYIiEMZ7nIJad29qA8lCy+GvqV5ZEssNSXK8pUmYnbqsLKwrO51KW039FUJyl1RqJKg== X-Received: by 2002:a62:cf02:: with SMTP id b2mr5622224pfg.183.1548316071778; Wed, 23 Jan 2019 23:47:51 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:51 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 39/50] tests: Modify pmksa_cache test sets for python3 Date: Thu, 24 Jan 2019 16:46:19 +0900 Message-Id: <20190124074630.4192-40-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024754_834194_27E882A9 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_pmksa_cache.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py index 9353ae1dd..5e46c1176 100644 --- a/tests/hwsim/test_pmksa_cache.py +++ b/tests/hwsim/test_pmksa_cache.py @@ -1038,8 +1038,8 @@ def test_rsn_preauth_processing(dev, apdev): socket.htons(0x88c7)) sock.bind(("lo", socket.htons(0x88c7))) - foreign = "\x02\x03\x04\x05\x06\x07" - proto = "\x88\xc7" + foreign = b"\x02\x03\x04\x05\x06\x07" + proto = b"\x88\xc7" tests = [] # RSN: too short pre-auth packet (len=14) tests += [ _bssid + foreign + proto ] @@ -1077,9 +1077,9 @@ def test_rsn_preauth_local_errors(dev, apdev): socket.htons(0x88c7)) sock.bind(("lo", socket.htons(0x88c7))) - foreign = "\x02\x03\x04\x05\x06\x07" - foreign2 = "\x02\x03\x04\x05\x06\x08" - proto = "\x88\xc7" + foreign = b"\x02\x03\x04\x05\x06\x07" + foreign2 = b"\x02\x03\x04\x05\x06\x08" + proto = b"\x88\xc7" with alloc_fail(hapd, 1, "ap_sta_add;rsn_preauth_receive"): sock.send(_bssid + foreign + proto + struct.pack('>BBH', 2, 1, 0)) From patchwork Thu Jan 24 07:46:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QtD2Q0n1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SS12bBTe"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ9Z55Wpz9s9h for ; Thu, 24 Jan 2019 18:51:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QC4rVs4/qOpH6ZR6q9vrA3HablwYkt2zsDEn+Hg0pl8=; b=QtD2Q0n1p3qN7QOcrxfR/KLcnN rk8hlhqRz6yUpr5T53VrJ2Fno4Wofgtsme2elnoFJwrOficCvlSEgAYIbf/J+9nYtokRKCEeQEidO nJsRKMuWjFLUR8eukH2Ro45EjMlEtkN7QH1ap9RvoIPtNBzOPQmh/VZCEEWVoT42UAK+8ERBUg6yZ SlWcDgpnf4NVCA1HS7fkyg6ocuC/PWNLinAPTwcElNyzXfOlSR5ay9fw4zwbQiweQWoWOHjN0F/WI gTqaPoUOo6DVn7+EXyRQxCH8stqDbxG2b/3BWA1I431Uk+emyTBfissahk1pLDI1z96SXMWFxRAId LYHDt3Xw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZnV-000326-Dn; Thu, 24 Jan 2019 07:51:37 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZju-0006bZ-R3 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:30 +0000 Received: by mail-pf1-x442.google.com with SMTP id b85so2596616pfc.3 for ; Wed, 23 Jan 2019 23:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sto7pdB3I1LgW1+TnBM172NvHZlSjqKqANFHu0ZeMQA=; b=SS12bBTeEA7BbqziWQ5zV7A0ozAxUsYbUlU9mYkze5qr3Hwf3POjYov5C4/Il0DlCK ouw1pY3o0dZPOksf9yg2vS9eB/6IGKc3R1v5MmTSurAItTq7irJy0WihCtNpkva5zm5z RmsnMOPSSkFPw4bnwG5VPHYFBWRoAftnYHtCdJU0ywavX19/rGWoBcP3x8KOhHUhl8zD uKayPhbWlzoXgib/OF7oWm5RJlA5vgCmWL+kik7GVqzZnnmctrgFSezVJPm6Rf2cH3uk hvvEItwk6wl07bcW9sZLDiurNkPV40ULAd0+tSzN8jyrjLNTa60x0jxjO9nJFdD/1MnP qV/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sto7pdB3I1LgW1+TnBM172NvHZlSjqKqANFHu0ZeMQA=; b=H8fV/CeccmzjVKEpEICTVhaoe6pyNXIIWHzvPN/riRAVoreim1GGT/RGMYSa3XlOSl +6rlZ02ZLhJ5fWE7qYA8vLG1gMfrI/Hmu+LnVqRCBOxy86cGRuaraMW5XWfBB7okBf7Q BXurrkBSiJaeLY0iKrvMGhlEq3FXxWc6MBpI67q5HIqgNYPd9eDFfwgSV3BCGL7YylGY lrJbYpg0vawmEJItCsIlqEE5zKmk2pzCYcOp7mxFrVatw+pJuHKQoWElfBQiRoz1XTEf IKpC91hUjeBa70QdTMUMmZUY89APLhwWpjpvvvrveh6avTH97NwNwsm+jYO2dzkIhQqm Bv3A== X-Gm-Message-State: AJcUukcGj87Z3uu8J8wcGed25fSXnf4JyM0WGADsmRp/Xi/leZYFG80u QlQey0rvhxD1P2AR/wNDxGXgb5fr X-Google-Smtp-Source: ALg8bN7BM+JjDz4JRcyyMRsltbYi/4JyIGvwMLZYUjUBeckzWaf1IyHGz07ssO1U2Mi3WxQaDYwe7A== X-Received: by 2002:a62:3603:: with SMTP id d3mr5629215pfa.146.1548316073469; Wed, 23 Jan 2019 23:47:53 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:52 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 40/50] tests: Modify radius test sets for python3 Date: Thu, 24 Jan 2019 16:46:20 +0900 Message-Id: <20190124074630.4192-41-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234754_904798_009E909A X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_radius.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index 2f5bc95ed..8effbf83f 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -352,7 +352,7 @@ def _test_radius_acct_ipaddr(dev, apdev): pkt = build_dhcp_ack(dst_ll="ff:ff:ff:ff:ff:ff", src_ll=bssid, ip_src="192.168.1.1", ip_dst="255.255.255.255", yiaddr="192.168.1.123", chaddr=addr0) - if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt)): + if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") dev[0].request("DISCONNECT") From patchwork Thu Jan 24 07:46:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xy9uPFjU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ewqKQbXD"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZB12xpxz9s9h for ; Thu, 24 Jan 2019 18:52:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ydLNidpg3ICWp15gxOHqQsMsOags0C8pMthqKguAIBA=; b=Xy9uPFjUJ4dKREOFieZZ1ODxxB bLw4t2GJSJKYewnFegsSI1c4dlFZr52iSrwKeM0LNZpxWz6Pty/GK9H52L50ZaqMzEIfPX3EIVQyP 7ILcprhjCLmCebwkx2BNeZ/owzebitEY7qXoD7kJmjHOsJsYkx0aeAnPsZJtAb71znw/ji1FmoN3p XlzhPA9x0sKyTWoOPrnv3dChJcHxlLYwXP3McOv7EsSKIA2PQrSPMWwFEP6O/t5mT9K8fYWiwiLLC 7IssgoAcFt4EcoQEhh3YyQW0bTtn+vjIf/U2bb8WMqaI4AXJrZ84gmGZApkec/1YOfzxjl6Uvrzov jCsLVXOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZnr-0003V4-7S; Thu, 24 Jan 2019 07:51:59 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjw-0006dR-KS for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:34 +0000 Received: by mail-pl1-x62d.google.com with SMTP id y1so2503259plp.9 for ; Wed, 23 Jan 2019 23:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ncMTGMG+XNf4ur9dtGleK47OmO6nTU0b80vz0uaMVsI=; b=ewqKQbXDN5FJhDS1xc1jf/jEKQGzHrAJvfJN1KSyNxdkGdg3gL1j/zcNaEAL4xW9AX QuIheFVLXfXa9WVgrzLqCdZpida6egBybiHaqoOuKUtkemrCp0slNpQR3sgRuNVRlgXX 1XKAZ9gC6RvzsGJbVg7PPIK++XC2+jtX9QiuA+e6NjUDi0KmtnalaGjtDY9XSo3NPWTf fQA3RZFWRpCa73xgIeHhGoF4r5BjxfxgSImj0zlL+Y4+Wb4Qg1SGdJJv6IYx2czhQ5EO qRPteF6TF/NXv0MU25w//LPWfOG3ArGRiRNXqA86+ENTVfYfwsyPNm2I+FrrFTmHtdfY qASw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ncMTGMG+XNf4ur9dtGleK47OmO6nTU0b80vz0uaMVsI=; b=fWCtSzqATPq/FFJBQZbmq6Hhk3uZC2F20IupBI79Jf8Gg1dc1cQweGp5kK6W/cTKVM jEy8zlykH+R+wXU6+oeBNhLzser1W69+vcrfoO9//iC5HQQsMUmQB9F/v7yWO15gKyTr ziO6uxGC/KxKqN+XhVR+uYLy6ZMGgAMY1JidZOHWp9sGJS5KTV5uwwRHMnRzf3SqdgiS 2Ev0mFreialnLMTmR1DG2EVwSKCdXMu6tQ7OZVE261LP+QL6Z0Vcp9F/ZesxVMgbtj76 +7BWAN4Q+a6vjRFM9lEGzS7nIl1l9qCEbPbHiMcW6MQcm2ht0cD0uKsTEfAOcZ9uKGTd 51zA== X-Gm-Message-State: AJcUukeaRjQyJQk21YzpsjvSzGT/+P2osa77UQJyWufKNcNpeVKC8+m6 ieXYSKnaW7hIouCu9IMsxmjPNbqV X-Google-Smtp-Source: ALg8bN7EHPFvtEiwaJaMzO9zpeCagq91nPhwHHE253lZZaBmKA5hOI962lVvNNlQL/JqTQqrmJ2hPg== X-Received: by 2002:a17:902:4324:: with SMTP id i33mr5419207pld.227.1548316075212; Wed, 23 Jan 2019 23:47:55 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:54 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 41/50] tests: Modify rrm test sets for python3 Date: Thu, 24 Jan 2019 16:46:21 +0900 Message-Id: <20190124074630.4192-42-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234757_648822_DCBDEB4E X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_rrm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py index 35de1850c..f3b82ed3e 100644 --- a/tests/hwsim/test_rrm.py +++ b/tests/hwsim/test_rrm.py @@ -729,11 +729,11 @@ class BeaconReport: def __str__(self): txt = "opclass={} channel={} start={} duration={} frame_info={} rcpi={} rsni={} bssid={} antenna_id={} parent_tsf={}".format(self.opclass, self.channel, self.start, self.duration, self.frame_info, self.rcpi, self.rsni, self.bssid_str, self.antenna_id, self.parent_tsf) if self.frame_body: - txt += " frame_body=" + binascii.hexlify(self.frame_body) + txt += " frame_body=" + binascii.hexlify(self.frame_body).decode() if self.frame_body_fragment_id: - txt += " fragment_id=" + binascii.hexlify(self.frame_body_fragment_id) + txt += " fragment_id=" + binascii.hexlify(self.frame_body_fragment_id).decode() if self.last_indication: - txt += " last_indication=" + binascii.hexlify(self.last_indication) + txt += " last_indication=" + binascii.hexlify(self.last_indication).decode() return txt @@ -874,7 +874,7 @@ def test_rrm_beacon_req_last_frame_indication(dev, apdev): if not report.last_indication: raise Exception("Last Beacon Report Indication subelement missing") - last = binascii.hexlify(report.last_indication) + last = binascii.hexlify(report.last_indication).decode() if last != '01': raise Exception("last beacon report indication is not set on last frame") @@ -1083,7 +1083,7 @@ def test_rrm_beacon_req_table_ssid(dev, apdev): addr = dev[0].own_addr() bssid2 = hapd2.own_addr() - token = run_req_beacon(hapd, addr, "51000000000002ffffffffffff" + "0007" + "another".encode('hex')) + token = run_req_beacon(hapd, addr, "51000000000002ffffffffffff" + "0007" + binascii.hexlify("another".encode()).decode()) ev = hapd.wait_event(["BEACON-RESP-RX"], timeout=10) if ev is None: raise Exception("Beacon report response not received") From patchwork Thu Jan 24 07:46:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tvCYAWBU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AT5m/mL1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZ9m6XS0z9sBn for ; Thu, 24 Jan 2019 18:51:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EDf9snynvULvYxdaIgIixpRWe0LpkcZBzoy0tJqLAP8=; b=tvCYAWBUXOLJLQp2NtAHckCHn2 FQQW7Ez4RJmqkljhFySEy/yflPhTKCeUuOfat82adCCkSvWfGawcyLSXBtSLM3W1H93Su2mrW445Q FNT1GSmkXaBa3J5PntEk0xYt87SmYMAmXU4cMsuFQ6I1+uRlly+N8n2HK94iwU+Eq4e33olQ7L0P/ PjXPNjDbqP7+elRpwW8boToKdBa5r5SjZWSxS8Yv6ASTGRSM4iQg69S4JEIeh2i6dfII8ZqQzbyI1 K3W4D+6EBo9OQ45uKO+CXipjSzwQNaj/YQWxqaXLnb1sf1KNfHoS8h0R9SmdVWLwyoD+m/rasaxhB V+uCWyZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZnf-0003GE-UO; Thu, 24 Jan 2019 07:51:47 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZjy-0006er-FP for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:34 +0000 Received: by mail-pl1-x632.google.com with SMTP id gn14so2500362plb.10 for ; Wed, 23 Jan 2019 23:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4nNMmGlJcaCIWoLz1jiyydCETNn338ERDYtCltkdmrc=; b=AT5m/mL1hreAjDFOUsukwAVRAYn9DCvDSl3irqoLvtcBWXg/ZCXa8hQ2Kb44yc22Ud P8l7PGGQyltnfGSvK543AfIWaiESHHLFPh7x6ZZHz9yuBRqdXFH+/zDeYYHiYH+iFb3h HV477CyN93Q3HdC4aw8yyDFPBu4yY57mjxoSjmc7Y/GZDiPYk/gvQde+XF3Da2R1Z99l vOssSiUwQk3ujoNsX5X+9rhFXBQjmappGvJB1+4Tpe6zRSbOE3XWhrFHaOekFzOUVU+N BTozVIh6yfvBj5Ahb3wMg/eAjjgK/Zm187Aq8Y8CHqh2ybWoWxKakt5hcuU84uh8mEaD sXPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4nNMmGlJcaCIWoLz1jiyydCETNn338ERDYtCltkdmrc=; b=jgfnI3Dyfh90eWzLfokgJ1gGLD1Uh4tpAJy3OX7kVCsjjEWBpFw064izNbae1XDnfw rACODXqdMVFeaP/O/M77GmxJvzpYXThwSiZ+GK0+g57MNPQjv7GO2YVYoDA6iqsqL53l Te6Cneig8APJFn1TJ4Kz2dJKX1GUdeRSarGdDM/65LRrfdqnw+zdEMtcyx8DLxk01gU4 hFCzduMaNR3NKsYAMw77T2gXyWvJGOoDSPPjd13GOH4VGXM3EjCgKNlRod8HpKBK6ORA 6Ah5NoEcPLNrj8odiQa6EfEB3wG9wNe8WrEUkaObEVT1mzBqY7bAAoLkEPXGJaqIF61j 2gRQ== X-Gm-Message-State: AJcUuke3EtqRvT9UBQ0dB/RuONRooGPy0R7vr59CdCM9nUR73+O3iT9v PV/8QQZxLsPUwe0sP15MZpVfmiXM X-Google-Smtp-Source: ALg8bN73TFbYa5x717swAe4GYnh6oQsS/tlyfWHDAl/ajErna/1nmCrHcp1Ia47AVP93nivqqOzXTw== X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr5296447plb.6.1548316077028; Wed, 23 Jan 2019 23:47:57 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:56 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 42/50] tests: Modify sae test sets for python3 Date: Thu, 24 Jan 2019 16:46:22 +0900 Message-Id: <20190124074630.4192-43-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234759_644328_C2A18588 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ap_psk.py | 2 ++ tests/hwsim/test_sae.py | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 58cca68d3..e63c8df06 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -2269,6 +2269,8 @@ def read_process_memory(pid, key=None): continue converted_key = key if not type(key) == bytes: + if len(key) % 2 == 1: + key = '0' + key converted_key = binascii.unhexlify(key) if converted_key in data: logger.info("Key found in " + l) diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index 2a2b887a4..21eaaff21 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -408,8 +408,10 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params): logger.info("Checking keys in memory while associated") get_key_locations(buf, password, "Password") + if len(password) % 2 == 1: + password = '0' + password get_key_locations(buf, pmk, "PMK") - if password not in buf: + if binascii.unhexlify(password) not in buf: raise HwsimSkip("Password not found while associated") if pmk not in buf: raise HwsimSkip("PMK not found while associated") @@ -726,7 +728,7 @@ def test_sae_proto_confirm_replay(dev, apdev): hdr = "b0003a01" + bssid + addr + bssid + "1000" hapd.dump_monitor() - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + req['frame'].encode('hex')) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) logger.info("Confirm") for i in range(0, 10): @@ -740,10 +742,10 @@ def test_sae_proto_confirm_replay(dev, apdev): raise Exception("Authentication frame (confirm) not received") hapd.dump_monitor() - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + req['frame'].encode('hex')) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) logger.info("Replay Confirm") - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + req['frame'].encode('hex')) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) logger.info("Association Request") for i in range(0, 10): @@ -757,7 +759,7 @@ def test_sae_proto_confirm_replay(dev, apdev): raise Exception("Association Request frame not received") hapd.dump_monitor() - hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + req['frame'].encode('hex')) + hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode()) ev = hapd.wait_event(["MGMT-TX-STATUS"], timeout=5) if ev is None: raise Exception("Management frame TX status not reported (1)") From patchwork Thu Jan 24 07:46:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HXM5iPpC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="jySBMsUu"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pPQk1crN"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZRB5BnCz9sBn for ; Thu, 24 Jan 2019 19:03:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wTpIGmHpDFDcTvU6wHf+O45drYlwJ8fVdbcfSHVuLoQ=; b=HXM5iPpC7V/XJflPQF7DgejgQu ViX2p/1UYaMJu5mSTC81CB+ZiYUNbIHEYiS3nYmM6twYxez2zdIP4/YC3aBZqKQSFlWQq+pP3C+Zh lX9A9WXyiJ8fcRsu2eY1NZsV4joCTTguom7YNEaQOsUMSxjmOCnL7lB1rLv42El7+42GEjN8ilEB3 538cD/0OEHOp8wnIyTY8loqUmUYECkEw5YT65eMujOG2HK7UZX7C+pNc0u8XYfeJ5u/VbSu5DZSlW C4TEiRahH01Q00upKYI1NJXcRgr1tPDksYBGlfkP5NpG4cgj3eaZByvjVqNRgdm+vYsOozgy2k6WZ hLVy1D0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZys-0001lS-NM; Thu, 24 Jan 2019 08:03:22 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyR-0001E8-Jh for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3ClqY8qNUFHZAP9lcMlSknT7Q25z5Js0Lvb71aMHOdo=; b=jySBMsUutXhucJ/Zkhznc9Ul0 MMDnvE9gt19eWBbozrkrvs5URFzDfNMybVri6ERmofGgsog/B7/VC3qEocWK64W9OPzZiqWxVxTEK sVtgZT92MLpUF1qb4lUFHdWvY4eCqVSGzStJnxLFChqUIMy4Ft4qXcswb4Rpg3TKpzJHGiMmD5hI1 NCi6VvbFecH1jqZwg+Uu8mtHD6Pox7qBgtQ6vO0OV5FE+XUv1C2YrtZehaK1ubmRCba5S1Bgkp+dJ W5Se3xSTZ08i480knMVOvp+ycEhlYIKIlpbOhAyt0pMqKFKiMzcAqos8Xe4ssEhQ5vDw73+MHEyps TjTTZQv8w==; Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZk0-0001wA-W3 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:02 +0000 Received: by mail-pg1-x544.google.com with SMTP id n2so2316787pgm.3 for ; Wed, 23 Jan 2019 23:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3ClqY8qNUFHZAP9lcMlSknT7Q25z5Js0Lvb71aMHOdo=; b=pPQk1crN9ibMTxxToQM6po5aLl965f0w0o6wqfyge1qVh3zLSF2wQgKhezZ1nvGEws zs3zgpD4c/2Rz8d9aROAI+h30AKB575UbsM4rqOAAsCrk18WdgqlFBojZX4Zlyv3U+7m bhgrbNTFT/vj76fKolr3EsIsO/SjnGmBIRCfqZXi6UtKhi+flnLeCvEBOBjaX7/N42uP mrvw+TFnlEDPRzGds+AZNvlv9FMpFuxYcJoZqAmgxjlpTU156QDIjgJhQhJO3zeH4b0Z Llzxlh5uCQUMhSQX+m78lSZnKgMdIgxfAAPHHuyL6icp0JgX0dw4tw5Mumq+PAu3TQAU MG8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3ClqY8qNUFHZAP9lcMlSknT7Q25z5Js0Lvb71aMHOdo=; b=sEw0GnAw1QDDIXuMMA2qQ/k+Q+RNgTf/MgaSAGgZFlPSBpWhoG++nWhecKaMdC8Lpt FXq7hsKJ8W0b6K/qGSrRFv0PFEO6SpASeMjmitYXhH8UU+J0HuIwXGIh2Sduby9IMdXq Hnmg3vL5H+28ZgZtUfo7lmFXQORfvGdyFL6GjnKAhuuBKjZ1XKcp1BvKXTK0I/9LVykr 8zNwNI+BY/Gg5JvD+ZKCoRI9BkCLDvIRgebis9h2YrqjbRFXHqXK16ZEMBvqNdbDAlpH HBB4NjU2oQPJWp8jtr7NFJFg05XEUHLS8M/JDEcgvoD1Ab0lnwW6gIHOt1bEKwMyo7Bv wVqQ== X-Gm-Message-State: AJcUukfbWbuBpZi2Q4/F4Y1A8Elpnb1/tvJU3vQQBZ16i2szS7A8w6LJ 4w8Zs3i2yVA7ISYCDSFK9bvF2IC3 X-Google-Smtp-Source: ALg8bN6UsaxVdh0smm/UNZEfwDliacNP9u/v/dgBIlTtATIXnj9oninHd4HjNaepJ4/o3E7wBEKA5g== X-Received: by 2002:aa7:8802:: with SMTP id c2mr5424621pfo.20.1548316078693; Wed, 23 Jan 2019 23:47:58 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:58 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 43/50] tests: Add WPA-EAP-SUITE-B-192 support Date: Thu, 24 Jan 2019 16:46:23 +0900 Message-Id: <20190124074630.4192-44-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074801_034908_4F2AECFA X-CRM114-Status: GOOD ( 11.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Fix wpas_config_file_key_mgmt and sigma_dut_suite_b failure. Signed-off-by: Masashi Honma --- tests/hwsim/example-hostapd.config | 1 + tests/hwsim/example-wpa_supplicant.config | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config index 032465a9c..7024c65b8 100644 --- a/tests/hwsim/example-hostapd.config +++ b/tests/hwsim/example-hostapd.config @@ -82,6 +82,7 @@ CFLAGS += -DCONFIG_RADIUS_TEST CONFIG_MODULE_TESTS=y CONFIG_SUITEB=y +CONFIG_SUITEB192=y # AddressSanitizer (ASan) can be enabled by uncommenting the following lines. # This can be used as a more efficient memory error detector than valgrind diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config index b681e9f55..fc5d0ff93 100644 --- a/tests/hwsim/example-wpa_supplicant.config +++ b/tests/hwsim/example-wpa_supplicant.config @@ -129,6 +129,7 @@ CONFIG_TESTING_OPTIONS=y CONFIG_MODULE_TESTS=y CONFIG_SUITEB=y +CONFIG_SUITEB192=y # AddressSanitizer (ASan) can be enabled by uncommenting the following lines. # This can be used as a more efficient memory error detector than valgrind From patchwork Thu Jan 24 07:46:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sBJs2wof"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="HxWs+4A/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lQ4rP6bq"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZQw16zcz9s55 for ; Thu, 24 Jan 2019 19:03:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=B72f9b4jdieDbz3uL1CvKhIn0mhwdn84yuKyzAgxKrI=; b=sBJs2wof1oGxtbOotWijTOBslE ZSFURZZ3JiLwunJkWKaYdFytPSK5ov2uAd95jTFfZ95RFv5LDd4S5Q0LYodw2hxlDuMU5bDnHzot8 uri3df2fN1SRDteMz00OszzdvXM30WdbVfIZ1iXbAj41rXkQA8OVeioKUTD9GKqjj4P7OS80YvVD3 bmIqbMSJcy4q9KvN6fMjwj47/cZqnsM5yus8kI3JUCinoF+ydtFF0XMY140BpqW8hg1Pt2M4isqxd IoUniouYJNK+G/LzliDxZfwUa6CH2SIq6jJWZwxPqHI1cuFcucu+A81I//lgHgKLmyquh62IpZ4hf T1ac7/zA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyh-0001ZT-FX; Thu, 24 Jan 2019 08:03:11 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyQ-0001E8-EE for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+V3mHtaE9snd8c0kb6VDajhmuPFBDIm58jcF8t1oYVI=; b=HxWs+4A/Xf+1yPnFssZ4ywQGg YucD2asn8erKB8dtorAioVy6vOO2cTbu4yMMN3JHzdt/vtBVxzr8yKKbO4oPlatDR0vN7jOJDkA8Q pv9RBpl7HMsp/VNBx/O5cUvV3LVOPRmA6dyeagKubxv5FJyepU3j31fiYN46nTnYPY80buGzLG1J/ iOVYNdu5gx/1GJM8tp+OV0p7NYkvUpX8auGKHO0tcrtzrYZtAq29m/nU9eKjWWL2QaKnUJS3sJ2qU 3gZWf2dLI2w99gGjsjCIRNkfHoU1DaCTgfssMxfSGm7Waz6viT6xOZURnU8ut1oF1CGih7VpJ9Rwf GpIuLr1FQ==; Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZk2-0001wP-LT for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:04 +0000 Received: by mail-pl1-x631.google.com with SMTP id w4so2526826plz.1 for ; Wed, 23 Jan 2019 23:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+V3mHtaE9snd8c0kb6VDajhmuPFBDIm58jcF8t1oYVI=; b=lQ4rP6bqymDex1IEe/veBJVjBK7yzuM0SmEiWuNtoKTR0PjcxrNi8xcLHZQXLlV5X1 q8c/5AX2fTQ0QmxPfams4oqzLiWG/Dg2niCTalBukSMk4+VGMOJoo3Ylicpkedg6FI28 M4njTOwfKDbA87vDaBOw3+W4fOjVewcmnioso7nwpQs59YsZ0O4TP33LZMQakdR7KTGu pxYrjaGeFauf/2SE26a5pViga4chbP4CspGCT9c9Mresz67H83RLPj0xg58A80LEsw8M j/191zTVsJ3lvvGHKomRGsvfCJS5zBeTkvVHV0pqfAMRUYPAO/LS2QfH+3Gi8Ahn6sqh WRyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+V3mHtaE9snd8c0kb6VDajhmuPFBDIm58jcF8t1oYVI=; b=PzymoCkoYknTceaEZwk8/lLnl615xapuKSdyjLRNgM3+4e2WcPQgm0cy4IgddKxs1W 39xTWvoXR0pOS+UmPoFINbV+DD2reVu19Pt5zWeXnrTBvBKsQMpzcOy2kv4cXxwaOIF8 xso4Qg8S4E2BG/KhfQyPAs/2TEQNqoww8GINb/G0dTAo51iZhi1wKNN7sSP6o7j8P7NR Ig5mEVvTf0hEfkyKNdyqbSueePimqclP8EkkyKN4jIW4iHwlJYDIrGsl9TTgk6weBnDe 7ebO2DAM/u7nFtlnbhCiFXGsGu8jXWkgeJ2urKkXiOTWprAoaLpBWw+yqSoBZc9QEqe6 ahlQ== X-Gm-Message-State: AJcUukfOm6d1Ceh9qL0TfmqLRXl+vdoYiU6DeqTC4ndma5kC2y1abgj4 L5nk6XF3pzUrMwADa+I027aEt3Fy X-Google-Smtp-Source: ALg8bN4gJqyOfh+BzSq6fywiLVKeg8jSJg00VQRtDR4UDDVuvMavTEOUQPfdwKVYYIaqqR/FDPv7Rw== X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr5666000plp.180.1548316080449; Wed, 23 Jan 2019 23:48:00 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:47:59 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 44/50] tests: Modify sigma_dut test sets for python3 Date: Thu, 24 Jan 2019 16:46:24 +0900 Message-Id: <20190124074630.4192-45-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074802_765232_1BA9DCD8 X-CRM114-Status: GOOD ( 10.59 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_sigma_dut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py index 3641a9dcf..7f733ef6f 100644 --- a/tests/hwsim/test_sigma_dut.py +++ b/tests/hwsim/test_sigma_dut.py @@ -1607,7 +1607,7 @@ def test_sigma_dut_ap_dpp_qr(dev, apdev, params): def test_sigma_dut_ap_dpp_qr_legacy(dev, apdev, params): """sigma_dut controlled AP (legacy)""" run_sigma_dut_ap_dpp_qr(dev, apdev, params, "ap-psk", "sta-psk", - extra="pass=%s" % "qwertyuiop".encode("hex")) + extra="pass=%s" % binascii.hexlify("qwertyuiop".encode()).decode()) def test_sigma_dut_ap_dpp_qr_legacy_psk(dev, apdev, params): """sigma_dut controlled AP (legacy)""" From patchwork Thu Jan 24 07:46:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ONJk867t"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="J5Iym6DH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PASXD1fL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZc80hwwz9s4s for ; Thu, 24 Jan 2019 19:11:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FAoL5LSMXdMnMCrFNwvHlyF3+4TR3ioXMqpU+fAgr7c=; b=ONJk867tHq/Z62 tLQgQ4sxsRYU6nqKJHlqCK0y7uaxmH6g4r5DDVYAbO5LEqjUCXiApkIAq9nrjyf/BwOA3X53DSAt5 y4jjfu0qC9CaoQrfb1JhkEEWCXFPBxrR/nSDLrWpBv5h2953VQNb5gPM4Yu1uFIu+eJPYRSjFxOR8 bjbo75po4IDFo+IS9Mm+wq0r9JtgNRJObv5Rd26uOUxy0Wao91lnA9NXG+UE7eY5xGAcOHgajUc+p UXazLdn+J68+OLNprnN9e7UahF1CFtRIHfiq40afN5+hNmCV3k0xjjqEUkpFHj1YqQSzsdkLi/SPD 6eek9VP9eXkW6CTy7U4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma6P-0006hd-Hz; Thu, 24 Jan 2019 08:11:09 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma64-0006Ht-1O for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=30sldIyrc2JmJdP+9Ycy7PB3XosUwLesIPRt+rTUFX8=; b=J5Iym6DHpU2FyXRw30+1B8L1f9 QwYxP0XQ8j6LnAUBhbOx+jxk10liBkj/l540s1ZfEhF3azImuAI5I5kE4f0IqGi17FW8yOTi2pgNO v7QU9zHrsBgqs3LzxkS4ckMkmzuCtyWGOAZwxf472FLFK41PYbqEAgLh8DcOguxBbvRdt8Bv3q57u QuAhzNqB8vhKJ7BOvRqJAsoUBaQro/psp77BAf+RaVPwqJG5SJJuSnRz40wPjIpgvoSi/0FSR08Nt C6yvmahu3vdNuhFEqfv2GSnTxUMUm85myJTeeFKBWAELRuJWJTj7tR6eyj5bl2Tc/WvLXlBNEIJWK l+Z7/7zQ==; Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZk5-0006eh-A4 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:06 +0000 Received: by mail-pl1-x62f.google.com with SMTP id w4so2526888plz.1 for ; Wed, 23 Jan 2019 23:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=30sldIyrc2JmJdP+9Ycy7PB3XosUwLesIPRt+rTUFX8=; b=PASXD1fLaZKMFetb9gx+zvJGtHZcR9tff7ETMQFCyohhOXU79rucI3Wh70bunbisxf UC/C5OXYUmqmcVZl2RpOaKWH9OIamXoe7v8ISArHKpkXNfMO4x4ye2DyXvNBSvU19T4r PkNmCKOl+KY0H29oINSE09dCi7kqItmvDeLQq7cFJRKPJpVQ4w+nBhsitHlWdVcxR1P8 ieRVBnSDlGzX8huPOjN/wYk5258f2IgkrRY65VktwnDQX/3yBGbkytahG7G7r2q/YDEU eBSmJ+6Pxirr38WZMEiM5Xlu+ZaWc2y68saoz5JWo2GmXWd98f56PxGF9/Hhv0+pAace GynQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=30sldIyrc2JmJdP+9Ycy7PB3XosUwLesIPRt+rTUFX8=; b=nMVPVbwNRFF2EGUVBaLwRBdORGordM+59Zh4jSm8hR/q1KfZaOtrzqRqqV7ee1hjTQ 4YMZ0nrFeM/LxRzvwwY6LZQkH1Z4Kg02P0Z77O0HMUzUcUBD1fMvKI4WyzmUaMLW0uWM BOdGRZ2p1eed9Xz0HjYg2vK6dzYLBO8Xg20qCQd9q7n4pBYzM+c5a5Il+/PA3eWsnXpt WbyyaYzsJgCKgKf+4u/HIRVUUW5qXVl0kWhIgotf8f7jSE74PEKk7ZD4odYFqynbd4k8 8KLI8TT6XSAYMPsKiftm5gZ9u3R7X+I11Wko+TruKttxQoRzZHr3IKsXMZLgmfJgs/VC WuMg== X-Gm-Message-State: AJcUukdXFhnzWvUaqlMgXA1LVMpBtqkcjzQlYW1NH0RTbT8As0ts041r QZYSqCNODOdKfyNlCbJS2qsgjpUL X-Google-Smtp-Source: ALg8bN4/28l8AGwL8l2qi71nwVxfoBBjpvqXFp3mT9ZBNDwwlp4NnaJERiPed1zuKaPCvMSOFRJOqQ== X-Received: by 2002:a17:902:c5:: with SMTP id a63mr5615257pla.267.1548316082186; Wed, 23 Jan 2019 23:48:02 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:01 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 45/50] tests: Modify ssid test sets for python3 Date: Thu, 24 Jan 2019 16:46:25 +0900 Message-Id: <20190124074630.4192-46-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024805_704802_BEDD17C5 X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62f listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_ssid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_ssid.py b/tests/hwsim/test_ssid.py index 68034e2c9..5e9b790d4 100644 --- a/tests/hwsim/test_ssid.py +++ b/tests/hwsim/test_ssid.py @@ -55,9 +55,9 @@ def test_ssid_32_octets_nul_term(dev, apdev): @remote_compatible def test_ssid_utf8(dev, apdev): """SSID with UTF8 encoding""" - hapd = hostapd.add_ap(apdev[0], { "ssid": 'testi-åäöÅÄÖ-testi', + hapd = hostapd.add_ap(apdev[0], { "ssid": u'testi-åäöÅÄÖ-testi', "utf8_ssid": "1" }) - dev[0].connect("testi-åäöÅÄÖ-testi", key_mgmt="NONE", scan_freq="2412") + dev[0].connect(u"testi-åäöÅÄÖ-testi", key_mgmt="NONE", scan_freq="2412") dev[1].connect(ssid2="74657374692dc3a5c3a4c3b6c385c384c3962d7465737469", key_mgmt="NONE", scan_freq="2412") # verify ctrl_iface for coverage From patchwork Thu Jan 24 07:46:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030324 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mVdSBNh6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QMVJFibu"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZBC18Zlz9sBn for ; Thu, 24 Jan 2019 18:52:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uPb30p6EWqjBcMC4eVx8O+tpJ/HHGXWnA8HfIVVuNsA=; b=mVdSBNh6ticHYCJ4NBF+QePDsk dz/Bq8kGvbY7A/pKBWeqiD2sNd/hQ5Ti8EdMQigND8ixsC0J/dGL8hNVQQd57qsNxniVY9Bb8Hb1F r3W94hBPgiydSo7md64+isxnVtEmIvpdf61wWUm0bNk8jJsZ/VHWBi1cQB58kaKwpYrCAQnJSVh0p gZEJimlbQf3GP+5DySjADxMCrzTjewXIOFfrY+cK3RKusjd3ye4SrxnpfFH+G8awS3C0uUBji9V6D f2JT6AcWyxgm3DYko2exeTemV7bmk/j70qGEYKJaLorBdZrXxhLpSQnvz9NwHLm9rN7EJRNujgoW0 m3LzdhWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZo1-0003gP-9u; Thu, 24 Jan 2019 07:52:09 +0000 Received: from mail-pl1-f181.google.com ([209.85.214.181]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZk5-0006ma-Nh for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:37 +0000 Received: by mail-pl1-f181.google.com with SMTP id t13so2491752ply.13 for ; Wed, 23 Jan 2019 23:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tyr6aHIxeFcQf3DJoZro2LNC6UJk+Xy+tGu16UOZkjQ=; b=QMVJFibuDcz95e8+YhglreGMV/GzKKITRXA91HBnxrE2+nmgLl2WrfqmFl3OnMltYu nqXUOieZnuHIPAFsn07micRFrrJa8BBuOSrTX2uaS0kAjjdkVS4aOmcwJo4Ppz7G8BPZ FL3eyRlXgyfEVbFC5GH3511XydMiCpXBv9lueBOmSegn410qIel+pGUsbRGjKOwq3CXt TrqbOphZiKLpAmrr3d1bcxSx068URxxIoffvMXqPCEf39Y+hDvPIFA1qdj9+dbh9fh26 sgXud18jxV50bSYNnaVjHyfmXGBQb/4z6eFVgEbSWf6NsQJM7g+FC2CAopG0eLdXE/xK cwKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Tyr6aHIxeFcQf3DJoZro2LNC6UJk+Xy+tGu16UOZkjQ=; b=M5e6t2CC6uZcF0rRfrMvMGz/T9fmxgK4Atch5RQGVL/2BMLHdiEgdfOXwbOpc2q6Gj RRJkLxoqTp05j0OZJ2mbgMluCjeaqJXSL6hsar4JW7ri3Ome5bvy1ZWhYnwkjKRRisdW iRdajWfoJaHhNJrUJTIrVJtfnakDvymMsO3gP1HekGcX3v6tl3cud0cPUyxKidKrVOd8 BbjHko2GL0FuCli8oKertFD6O5yoBfNW27HToquhBJTFRDsb8+XLGUK6cDGcmYXBaXnc RG1RbukZicx4sAQqe1fYXG+ROQ+Q9UIYPQIVr0vgZODPhtmlAk0Snd1m6vhUcyzLRsgm vEZw== X-Gm-Message-State: AJcUukdFNeauoKzQCXU5kr1LpaCTzm04HRjGqrX2+6ZDQg9cAuwLdSud 33RooAF2W9cdorRMVcD4RUVe/7hL X-Google-Smtp-Source: ALg8bN5wkrrV0/w0IWMd50O6zwo9WDmbmAqGyXZ2Oo6thZBOYmVAltqDHm2E2T95dslW3Ku+GwKv+g== X-Received: by 2002:a17:902:7e44:: with SMTP id a4mr5551078pln.338.1548316083895; Wed, 23 Jan 2019 23:48:03 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:03 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 46/50] tests: Modify wmediumd test sets for python3 Date: Thu, 24 Jan 2019 16:46:26 +0900 Message-Id: <20190124074630.4192-47-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190123_234805_976380_DDB6D7FF X-CRM114-Status: GOOD ( 10.00 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.181 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_wmediumd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index 2d264cd59..68538acf3 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -108,7 +108,7 @@ def start_wmediumd(fn, params): logs = '' while True: - line = p.stdout.readline() + line = p.stdout.readline().decode() if not line: output_wmediumd_log(p, params, logs) raise Exception('wmediumd was terminated unexpectedly') @@ -121,7 +121,7 @@ def stop_wmediumd(p, params): p.terminate() p.wait() stdoutdata, stderrdata = p.communicate() - output_wmediumd_log(p, params, stdoutdata) + output_wmediumd_log(p, params, stdoutdata.decode()) def test_wmediumd_simple(dev, apdev, params): """test a simple wmediumd configuration""" From patchwork Thu Jan 24 07:46:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JzauxuZq"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="u6t2Kbah"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dJ5B2CKP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZby3KhLz9s4s for ; Thu, 24 Jan 2019 19:11:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TLIxJsciowOWhttN5GF+dV2qL/t0jb7U654nB0Z/xBQ=; b=JzauxuZqyKjrdLoyPMCLFs+yY3 aJaoc1tVySDS7dWtRpQbtaGWsRgA8SEQuvjYNyTOvJEZFNUHtst+SQukB5b1ScnLKNprwhVeUGcxF JajrHLA2wIbD16PWTZ0yk8on3vjr9dHg69vXZ2ObWMOV0Hl0aSeiTsqqycGAKv4AxRu6d3cdwOcAb By3JoOCJ7jEyOzr+wTuavRVT1GInrtXnhKPj6fgNLo+h62Snls49MH30timt5P7HepEGIopDIAYUB N53JJSAmfobM8GoRjs6/6TVzcDq0V/M1TQ4wQ6s9cxHknW09G+0XU5AlI8rTeYoShZ+G5P+bOj/7L 8WPJRXBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma6G-0006WC-1L; Thu, 24 Jan 2019 08:11:00 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma62-0006Ht-DQ for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=epCxfelmLgN1ljE+EgfcZIrPGoug0KHMf7LR0CQ4Iq4=; b=u6t2KbahCVp5uRrx8gtzS3JQZ rbBJbaLSCyq3o7QcUEg6lrGKyn9iTL1r+ul1iwptQtRy1LVN7EWjJGrdbCsb7GIxuKDwNU/5ItyyC 6rmf4Pixo/s+0u7eVVvChwKlvruyN8P9yMiv3jsKjVCJnrayWxErPLw1rvAoj/+t3p4rOxMG8RYIB TXgzeHJ4HJ58Q+ARJjinfW5cFovG/eZ8p01wvZot5sxso4WccN0AAfq2yG1ZmvvSyOOTNu72/5ywI OzuGxSvRD0f6wu7ZHX1Uri+8cnf6tJOq/xwVG5GzlqDNZYK6SFnwH4UuiIF96qpUdbb574yw1Sy6T eZ6s+sOtg==; Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZk8-0006fM-Fc for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:10 +0000 Received: by mail-pg1-x52b.google.com with SMTP id w7so2292515pgp.13 for ; Wed, 23 Jan 2019 23:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=epCxfelmLgN1ljE+EgfcZIrPGoug0KHMf7LR0CQ4Iq4=; b=dJ5B2CKP+BOxF+f5EFtn/EE+gXh0nL6/ENf35Mn03vuHvY7eFBO3GtZ/a8njuhfhOM 3K6Ewx5UnagV98+ybO0xKXW7jzVjJedPmU5Zz4Hzfyfh7KevXJpVV4q4ALN6fpYpxrMh /CbriZv1xuAKpZLfUjci3BTJ3noHUdPOHc5LiKkUfWsOsyTJ3Y593/j3W1gq9VDcs+LR 1spa3qNlN1gYifJC1FbqbfqCRfz6HgLEwpo2xdCs6BR3dUpME65LciU36l7TJ0q8TQPe U2vhboSrqgCDQossU0vXmedVU/VnQkoW9rxi5jWkpePs1ALtA8WNgpB2yrJ5DR4bsPsx lqEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=epCxfelmLgN1ljE+EgfcZIrPGoug0KHMf7LR0CQ4Iq4=; b=KhHTKCxSDT5X3wGAdl/wArd72OR+Scy15DV4OUBc+U9D6z2MpROToQmP6OlPR/lgKf drjbbG9Ur4INOe//KTJ6uw7iwofGhhrWw8feHw9BedWEyDUFZ8xixCC4/YbTJ6ZUlS9l 56rHq1CMK1nMGrXEuI/aFUVYxmfMq6ZGLcOP1qRBV+uOM9V3H+v/rXPhqMQC8MtD9G5y 7YhAY75wlgsoqGaIm7dFLEAwuN1q0XE7YsP3R8K9IjMafCwjYIrNq1XIlmyGtdp2N7Qm UfwqknEj0syYm5zfiDJCfuze5ZOhF+CoIZYYPcUjoSttisEmRlsxT10pnt2x6D3Tfgri O0aA== X-Gm-Message-State: AJcUuke/rDxU/5+FtQXxBaayXOnjLxHAdDgNLbImSrVs76/Fx8ZD4qsZ 6rrG1v8UX4aLCh1YAI7NqUMthDpt X-Google-Smtp-Source: ALg8bN7Mo7jdaCV6MKyukm9PtJP2qN/6To/VcsksQQVHqtYPXffHhxS5gSKr2B0r/MUxHLw9AErbsw== X-Received: by 2002:a65:60c2:: with SMTP id r2mr5029490pgv.393.1548316085598; Wed, 23 Jan 2019 23:48:05 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:04 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 47/50] tests: Modify wnm test sets for python3 Date: Thu, 24 Jan 2019 16:46:27 +0900 Message-Id: <20190124074630.4192-48-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024808_582247_0F601D1A X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- 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(" X-Patchwork-Id: 1030344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ADYfRQPh"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="2xzBS5hT"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y9tbLtWV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZbq5xjxz9s4s for ; Thu, 24 Jan 2019 19:11:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fh6k7dGezxIkPEVDd9fUudkCqDjH8ZFH4INLk+oBUsE=; b=ADYfRQPhxlEyPFNaNxrwrTmJHo 4pOX7jLG0GiuSf2JsbaoJg1AxqYY93TWulcpTowkTNx50Qya8uBfZdKGYwrl0/0GMNRV6Nx7fIN0F CHUyEZyPM6/DKoiDqpkMMe6NwziofHkPBin8wD/g8WOFZHWnuPjd7fk4wlsdyy4Ym3QbASl5gpLSx 5wV5CLPWPVJOSX6ljr3EvNKrkbB+PDfRzJAO1ZE25AVbIlohlaX3yzs651BN+rlE8ZjYQOD45qkfB khtILp9be0B1SvV6hFcXIaR7CwUTlsGX39VZAZnYUJxGsj5IuEhlA823rLetSHOqTsHy9O3vECiua aRW/x8yw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma69-0006OH-10; Thu, 24 Jan 2019 08:10:53 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gma60-0006Ht-Qm for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:10:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TZJOw8M6KIJOer63ewm9PvqmfI4ScxmpHZ+caLD++z4=; b=2xzBS5hTKvQ7FiI9EIhE2v/PH zKVGr16tfrj2B6RyGM5r4PoBtKHubYPJpWaorgT1Df7XTX/Q9wzZe1si3Kj3nSozlQP+3HBu9jZKd hp4fEkX+ISMlT3+7vPF2p8OLNuM0WbjytFbxtS/UxaRA+THqYBhclkMO9+nP+BGo9vYEhSgoR80mA wX1Gt7om+IJZS2quAqH1s2VoJe+FpMctB259jHDSMeWMmHEkix8qkDoJ7aPKEJ7wuSG5ROudSQoVK wKR4zxkXJ93JlfKfKoYaWhRNlJhnlLbjGzszeTavMDS0By2lvt5FSeYLvp/DUrHQSSwi7TB+3MhDn XHUgMjR2w==; Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkA-0006g0-9D for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:10 +0000 Received: by mail-pl1-x635.google.com with SMTP id b5so2512851plr.4 for ; Wed, 23 Jan 2019 23:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TZJOw8M6KIJOer63ewm9PvqmfI4ScxmpHZ+caLD++z4=; b=Y9tbLtWV8VCvIynYTzWDrETW46Q4/DuEmDhCL2FXqi1f+d3kiQTOHjXOe3xmxF7GuW UAYKmdl4pW+YeHm+oBGf+sh8p9oZxWX5DxkWNtB14taxzXGjNrAfpPQoUymsi8tcyGjG YPKlj+jiKRm1CG4z2vVBxgJ4nh2cUpoZlzY/gL8tG4YOEB1I6BFN4LesPpvSH4zZ6pdQ jtWSVXWbAhIsovuFzeK2HhZAiQ6UvwLU93txqL4+kfXfz0QWBjPoM55w4C2ZTbgcUxpP MiWOjmNOrCmvfI4dNvqmesxuPswDwwFKV61QiQNZEWQyLlfQH2zCC99r/JUlG7QQwfE7 eElg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TZJOw8M6KIJOer63ewm9PvqmfI4ScxmpHZ+caLD++z4=; b=rijkHFAupdlW+RlKR3QZe/ybmfEZBsVwDCKMl4Ak0hnGQIO3izaTSrjaD6E11ukizi xf9h32ImxkpG8zr1SOnWbcmHaH+F4AnMfZcz7od4CDanOniTQr4kNuij1+SJOQVbaZxQ Zv4EqeXvF5YKOPfpsjMLGddLcH1rgZPUymrh6ljB80i0h3/XW5wAnt+IMMg1sAh7wi1Q u6Bbiu7P2nrLezeYLGJzY+Gmz5lHWbi9nVuCQum2XCUAfqXHswdDr3WxUDYMmLL7hX/3 Ez7VYxXQMN7j+JURJOcHtkfhj/KKtcixChWgyoAn/5RyMljeRLT/xdpdVOzlT1Urx2PV zsjw== X-Gm-Message-State: AJcUukdIeyi26rqia9qk0tTPpRFmndrVVO6Pjy8R43BPGkfslJDk/PQJ B/nxEabv5clGl+XF5l63CjPpvqHu X-Google-Smtp-Source: ALg8bN5lLQtMR/T/rCFYB6lG1gmAKnvHtEKxtEl8CUK1mephrbK7DcRwrGYvICrkefMRfrjpao3luQ== X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr5610581plg.319.1548316087381; Wed, 23 Jan 2019 23:48:07 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:06 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 48/50] tests: Modify wpas_ctrl test sets for python3 Date: Thu, 24 Jan 2019 16:46:28 +0900 Message-Id: <20190124074630.4192-49-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_024810_405200_8AF0D167 X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:635 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- 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") From patchwork Thu Jan 24 07:46:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Q2jhTIsI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="ipRs9nxi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GCdFPyd/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZQh6z5Zz9s55 for ; Thu, 24 Jan 2019 19:03:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aZrQG4nUWZWDP1c1IP5HxhfxCioWzCA9Pxm6hVpHF80=; b=Q2jhTIsIqtX90AWUzxbGoylhLr Yy9DS646ptb4Y3QYPCaCz864ddA/rSDk6qWQbVvVQAV+c0ueemPuf8HIAGn7/FkaGNNBnNP/OSmZi JxSpielLzmFVTq3+Unfx1+qd1Vushcb6jykmK4EjMuxDnUKbnHuCjXyIU8PjNUvbdzDseyZ9HhzPk eJlizt0hj93VgOrP/v1ZakQYdRCQ3Kk2RoBRdwuW/WKhhO06KJqpf3aCWXbRpE+gR4L/00gaTs+4w XKaVQ9nqkcQbhMvViMwOLnysMMf4uSMp0EEHHzR8x6pof3KT4Jg4eXbOB+FMc7blp91qhwwQ3oTe6 nDYQwihQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyU-0001M1-Q6; Thu, 24 Jan 2019 08:02:58 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyP-0001E8-2D for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yMMG342o3Efl5hxC/QourGd4JfAfiWKL6oiWGG/Juok=; b=ipRs9nxiiRTXjs/33+w1pNGAf lDm1ITqpo7QB9EjgIpEoEq6TH50XnSbD2g1caumLtVq71AcvAZUmSB7PheSVwnMGuCAb1YEprDQhk gszT8Ol7OLBSirWb4zzkJU7W87GlTjzAyy9OjKMPWwZawjbY3vCtc4sM0tWwHzekWjt6f6k/WH6VS fSdFncK7ZZarXglk+lsXK6/EYD6kw2C5PR2/BkrCQcoSsSEKh8lql1mATs1L9YRBsEhzWEtVlVV+q g+1rtu6XZPkohASbAjqXV7q3+2ZpizX5LBQSR0j9e9s5S11RyvO2thZSJbU3pMRF4ZSgr2c1Dya1Y gOC4NIeTg==; Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkB-0001x0-Dp for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:13 +0000 Received: by mail-pf1-x429.google.com with SMTP id 64so2578310pfr.9 for ; Wed, 23 Jan 2019 23:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yMMG342o3Efl5hxC/QourGd4JfAfiWKL6oiWGG/Juok=; b=GCdFPyd/X406DNA8ycwlWbmL0ySSKPSTy5Ffh+u5RYgu6+M0NiRuFJ8v49wg9Pe01Z KiEYHsapyV1qtQ9Y0tEuzV6VgZtMNUvLQ/FG4g3Q4R87E6WnrHAm424gWhbDXaDSvwBK HyQOnE/eS7buDY8YLge9BiDy5eLlQGF3pEEN8MrYR2he0lQWgdApSupoDceVJDhbEurs 1t0Gj34DiarnmnYZhY7wxndoa0jvE0gyUjiVC2pqcA3c6Sm3wqQ+lwAOeFjEqZkhyNnM D/1L4zl+Lqz5Boh7u0VKomXfaHrrYUtTCR7FECRAJ6odXH9SwCOJpErv1sXIZHTSMQ1e 6rbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yMMG342o3Efl5hxC/QourGd4JfAfiWKL6oiWGG/Juok=; b=rRSaMwhLuFMNxH+6OIUpb+J2HwOQTPcG3s7h0XC+qVaGezGODb8t42afsmTS/Oj0k+ GgDATyf1A59OM0YfwJm/7GYv2de3PTMmBqW3jpKFvk9kyTI3F4qrWgaMugB7VmrdAmX6 bDIjEtl9EfAwN/XrcywFMoZLS/U1q0tD4bTWvGAo/jL5sjkz+lVmhri5jALG8sJ8vCQc Cgn0fk3OgBUnJooEzfsTCTuQF3S15gtuI93YK8Vmlp2SvPkZrHTuRIx13wZtyXrcbJ8R es+CRNn6SPg5H+SWgfrTgkJYI38b6n9kddPQQZlI5JfHxSyPdMaEHRFXSXPewoZuW+J3 kNJg== X-Gm-Message-State: AJcUukfjCAO9vJ+6w4qw+W8nMJ55FdjRjwoQzFz19OyfKIQU7y0Fse0r HiN5hNgAyMPJh7edi2vBCcQdsucM X-Google-Smtp-Source: ALg8bN4qumOUxCZGVJXiB7e7ghifB/Gttsltvve84fZGKpV5bssInQZih3HiTAC6V4TMtV0lQBOskg== X-Received: by 2002:a63:fa58:: with SMTP id g24mr4898278pgk.390.1548316089121; Wed, 23 Jan 2019 23:48:09 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:08 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 49/50] tests: Modify wpas_mesh test sets for python3 Date: Thu, 24 Jan 2019 16:46:29 +0900 Message-Id: <20190124074630.4192-50-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074811_504039_8B752801 X-CRM114-Status: GOOD ( 12.21 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:429 listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_wpas_mesh.py | 47 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index 45317d0d3..a44d393d4 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -11,6 +11,7 @@ import struct import subprocess import time import json +import binascii import hwsim_utils import hostapd @@ -272,7 +273,7 @@ def _test_mesh_open_rssi_threshold(dev, apdev, value, expected): cmd = subprocess.Popen([ "iw", "dev", dev[0].ifname, "get", "mesh_param", "mesh_rssi_threshold" ], stdout=subprocess.PIPE) - mesh_rssi_threshold = int(cmd.stdout.read().split(" ")[0]) + mesh_rssi_threshold = int(cmd.stdout.read().decode().split(" ")[0]) dev[0].mesh_group_remove() check_mesh_group_removed(dev[0]) @@ -666,7 +667,8 @@ def test_wpas_mesh_secure_dropped_frame(dev, apdev): if rx_msg['subtype'] == 13: logger.info("Drop the first Action frame") break - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], rx_msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], binascii.hexlify(rx_msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") dev[0].request("SET ext_mgmt_frame_handling 0") @@ -1181,6 +1183,7 @@ def _test_mesh_open_vht_160(dev, apdev): reg = cmd.stdout.read() found = False for entry in reg.splitlines(): + entry = entry.decode() if "@ 160)" in entry and "DFS" not in entry: found = True break @@ -1980,14 +1983,15 @@ def test_mesh_missing_mic(dev, apdev): (categ, action) = struct.unpack('BB', payload[0:2]) if categ == 15 and action == 1 and remove_mic: # Mesh Peering Open - pos = frame.find('\x8c\x10') + pos = frame.find(b'\x8c\x10') if not pos: raise Exception("Could not find MIC element") logger.info("Found MIC at %d" % pos) # Remove MIC rx_msg['frame'] = frame[0:pos] remove_mic = False - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], rx_msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], binascii.hexlify(rx_msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") ev = dev[1].wait_event(["MESH-PEER-CONNECTED"], timeout=0.01) if ev: @@ -2048,15 +2052,16 @@ def test_mesh_pmkid_mismatch(dev, apdev): (categ, action) = struct.unpack('BB', payload[0:2]) if categ == 15 and action == 1 and break_pmkid: # Mesh Peering Open - pos = frame.find('\x75\x14') + pos = frame.find(b'\x75\x14') if not pos: raise Exception("Could not find Mesh Peering Management element") logger.info("Found Mesh Peering Management element at %d" % pos) # Break PMKID to hit "Mesh RSN: Invalid PMKID (Chosen PMK did # not match calculated PMKID)" - rx_msg['frame'] = frame[0:pos + 6] + '\x00\x00\x00\x00' + frame[pos + 10:] + rx_msg['frame'] = frame[0:pos + 6] + b'\x00\x00\x00\x00' + frame[pos + 10:] break_pmkid = False - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], rx_msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], binascii.hexlify(rx_msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") ev = dev[1].wait_event(["MESH-PEER-CONNECTED"], timeout=0.01) if ev: @@ -2088,7 +2093,7 @@ def test_mesh_peering_proto(dev, apdev): (categ, action) = struct.unpack('BB', payload[0:2]) if categ == 15 and action == 1 and test == 1: # Mesh Peering Open - pos = frame.find('\x75\x04') + pos = frame.find(b'\x75\x04') if not pos: raise Exception("Could not find Mesh Peering Management element") logger.info("Found Mesh Peering Management element at %d" % pos) @@ -2098,7 +2103,7 @@ def test_mesh_peering_proto(dev, apdev): test += 1 elif categ == 15 and action == 1 and test == 2: # Mesh Peering Open - pos = frame.find('\x72\x0e') + pos = frame.find(b'\x72\x0e') if not pos: raise Exception("Could not find Mesh ID element") logger.info("Found Mesh ID element at %d" % pos) @@ -2108,13 +2113,13 @@ def test_mesh_peering_proto(dev, apdev): test += 1 elif categ == 15 and action == 1 and test == 3: # Mesh Peering Open - pos = frame.find('\x72\x0e') + pos = frame.find(b'\x72\x0e') if not pos: raise Exception("Could not find Mesh ID element") logger.info("Found Mesh ID element at %d" % pos) # Replace Mesh ID to hit "MPM: Mesh ID or Mesh Configuration # element do not match local MBSS" - rx_msg['frame'] = frame[0:pos] + '\x72\x0etest-test-test' + frame[pos + 16:] + rx_msg['frame'] = frame[0:pos] + b'\x72\x0etest-test-test' + frame[pos + 16:] test += 1 elif categ == 15 and action == 1 and test == 4: # Mesh Peering Open @@ -2130,16 +2135,17 @@ def test_mesh_peering_proto(dev, apdev): test += 1 elif categ == 15 and action == 1 and test == 6: # Mesh Peering Open - pos = frame.find('\x75\x04') + pos = frame.find(b'\x75\x04') if not pos: raise Exception("Could not find Mesh Peering Management element") logger.info("Found Mesh Peering Management element at %d" % pos) # Truncate the element to hit # "MPM: Invalid peer mgmt ie" and # "MPM: Mesh parsing rejected frame" - rx_msg['frame'] = frame[0:pos] + '\x75\x00\x00\x00' + frame[pos + 6:] + rx_msg['frame'] = frame[0:pos] + b'\x75\x00\x00\x00' + frame[pos + 6:] test += 1 - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], rx_msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], binascii.hexlify(rx_msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") ev = dev[1].wait_event(["MESH-PEER-CONNECTED"], timeout=0.01) if ev: @@ -2253,8 +2259,8 @@ def test_mesh_holding(dev, apdev): if categ != 0x0f or action != 0x03: raise Exception("Did not see Mesh Peering Close") - peer_lid = payload[-6:-4].encode("hex") - my_lid = payload[-4:-2].encode("hex") + peer_lid = binascii.hexlify(payload[-6:-4]).decode() + my_lid = binascii.hexlify(payload[-4:-2]).decode() # Drop Mesh Peering Close and instead, process an unexpected Mesh Peering # Open to trigger transmission of another Mesh Peering Close in the HOLDING @@ -2296,12 +2302,13 @@ def test_mesh_cnf_rcvd_event_cls_acpt(dev, apdev): rx_msg = dev[0].mgmt_rx() # Allow Mesh Peering Confirm to go through - if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format(rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], rx_msg['frame'].encode('hex'))): + if "OK" not in dev[0].request("MGMT_RX_PROCESS freq={} datarate={} ssi_signal={} frame={}".format( + rx_msg['freq'], rx_msg['datarate'], rx_msg['ssi_signal'], binascii.hexlify(rx_msg['frame']).decode())): raise Exception("MGMT_RX_PROCESS failed") payload = rx_msg['payload'] - peer_lid = payload[51:53].encode("hex") - my_lid = payload[53:55].encode("hex") + peer_lid = binascii.hexlify(payload[51:53]).decode() + my_lid = binascii.hexlify(payload[53:55]).decode() dst = addr0.replace(':', '') src = addr1.replace(':', '') @@ -2338,7 +2345,7 @@ def test_mesh_opn_snt_event_cls_acpt(dev, apdev): payload = rx_msg['payload'] peer_lid = "0000" - my_lid = payload[53:55].encode("hex") + my_lid = binascii.hexlify(payload[53:55]).decode() dst = addr0.replace(':', '') src = addr1.replace(':', '') From patchwork Thu Jan 24 07:46:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 1030329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FPY5FLwn"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="KKrx/KpC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HVU3XXBq"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43lZQb0ttDz9s55 for ; Thu, 24 Jan 2019 19:03:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YD9z2qzQ1hDd8z2A48vVXF19u7soz0Gohcmp4+MRESE=; b=FPY5FLwngm+18zjXil7lp2cguI VV8QefiSXhNwVMi17QxlzsQ457CD4yex9/GCIeU0am0/7RM9+qMzGq+0eQ1Xu3rYCdEqy09QZAdLm JMagm+dkQXiTCf1qk/FnmYl4Wgj9WGHBPcnHJ/A/854NMT6LO2CfLnGsVOUq+jhe2zkXw+Hz3xezJ WKxCd8diSwD5dyGu4NtTZ6SGLFQE5VStDEc7HwrVj1/bhMeD6BfIsrGYeKjlJblEQQ+fGxVXpzkWP 2cQRv5HUxdnSNCf9J+zYrwoLaqe0gCTv3QhquXc0WEnNYqSQuesq9jWCNN0nUYDn0lJVr/AxO9XyX hMsxWHEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyP-0001Hr-Es; Thu, 24 Jan 2019 08:02:53 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZyN-0001E8-RB for hostap@bombadil.infradead.org; Thu, 24 Jan 2019 08:02:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gqsfsJQkWeFMuPVH4y8Jnumi7/21DHgvoZIMHDnn7sg=; b=KKrx/KpCgONK5gxRWS3/fs7L/ T/PRxnPyWss77NSm5lTWunJpkmSuJqLHkr4U/V21ZdGSz4ZXDqo+9yamlmbAsVnjjjAPvwa2PP+Vk pnzGQ8QUK5cdesj+7HYA5SxR+vcpxGmLEVEQlP8Zw1vplWyoOQzdSH/M2V4Nbtp7ePy9IIxPCILjO j5erusebc67hs3SZcohgeAbrmtpobnqqdt2oPecDl2YsDtstfh2yjzpB7XsYXr+ij1YTzTi2aLXxo ujroZ/+W/ojyFeSUgEOnJJ8e48om4FqfGPFHDwqEoD86zOfFqV9YZynWSXbKetjdSya8I/JilnWd2 IZRyC2QoQ==; Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmZkD-0001xX-11 for hostap@lists.infradead.org; Thu, 24 Jan 2019 07:48:14 +0000 Received: by mail-pf1-x42d.google.com with SMTP id g62so2570953pfd.12 for ; Wed, 23 Jan 2019 23:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gqsfsJQkWeFMuPVH4y8Jnumi7/21DHgvoZIMHDnn7sg=; b=HVU3XXBq/UpFxdU43TeVGJ2sU4C++sZmGzfBicrMUIpOcQg5HTxIv+trjjI5LQqttm qzNIJ9k96bNANn7vUDI/aED4E/p0RIefjO7/CQPWnzQhd19m3oajD6Uxdjo5RyPWi5IK 8BdOPO2nGJWV9Lzi+UqwokK+sJm0QYyVqO60iAMNZWC6d50pOtrZk2UT5h9yvxDkPJ/2 c2vjJpiw7T8Wx66nI2EB+RXH0xmoUfDBwXsnNFb7GGxaEUDFi/1u4lOlRDPEOEkbryKt j9ZZo3uyE2xxiq60KimGFDaZUIAiECw7ITgXxBBmT/oAav+rHFj0aX4iRnyXbvCp09QK J9OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gqsfsJQkWeFMuPVH4y8Jnumi7/21DHgvoZIMHDnn7sg=; b=Q2ebj++FG36rToeFf2w2Aw8PYZK0hlAFsMTArJ8bYyf57VzEV9+cJjAzfV5b5ZM71+ 5CRydQC6S2HsAT/FL9DM/OZXpnXdrT6TRLgVU0H5iyb+bRmu6tssXhyf4KoHnQG8eT9N 7Lok9vQaVqCeq/jkvp7SzvKrwUWj6TqmAB0sh3OXcEwAPdfV8gJVgo9gSpNz3xj+0agm ARxsMxl+2BIlLIVxkFWNcugmywIbsAh2RmyTCCI07YDz2kiOAoPLutP7dhw3D+l7sAdR 8Xjtz3TYBIsNBnlA7kpw/rK8qJmYtvgBvu+Q6xDGgOq3xE2m+hW97v2awaGsUL4/XBbT 4Ruw== X-Gm-Message-State: AJcUukdgqIvDz8LB0kRBYBW5WO/LQUn+t5cDONat2LLftkncL0mIwgP0 j1M4qGSRSMvUboNUEwNAGmHC+WsB X-Google-Smtp-Source: ALg8bN47+FRnzumPa7nemvBonJp1QP3/k4Yrn/ziKxUZjQv4eXOAGBvOnLXhI/rzTiFBA2UtAvm1Eg== X-Received: by 2002:a62:c613:: with SMTP id m19mr5442833pfg.207.1548316090841; Wed, 23 Jan 2019 23:48:10 -0800 (PST) Received: from gtx740.flets-east.jp ([2409:11:321:2100:c5e5:17d6:d698:81bb]) by smtp.gmail.com with ESMTPSA id i193sm73264227pgc.22.2019.01.23.23.48.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 23:48:10 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 50/50] tests: Modify wpas_wmm_ac test sets for python3 Date: Thu, 24 Jan 2019 16:46:30 +0900 Message-Id: <20190124074630.4192-51-masashi.honma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124074630.4192-1-masashi.honma@gmail.com> References: <20190124074630.4192-1-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_074813_071999_CB5CCC34 X-CRM114-Status: GOOD ( 10.58 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42d listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- tests/hwsim/test_wpas_wmm_ac.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_wpas_wmm_ac.py b/tests/hwsim/test_wpas_wmm_ac.py index f81588a18..3bf6c6715 100644 --- a/tests/hwsim/test_wpas_wmm_ac.py +++ b/tests/hwsim/test_wpas_wmm_ac.py @@ -8,6 +8,7 @@ from remotehost import remote_compatible import logging logger = logging.getLogger() import struct +import sys import hwsim_utils import hostapd @@ -171,7 +172,7 @@ def test_tspec_protocol(dev, apdev): hapd.mgmt_tx(msg) # too short WMM element - msg['payload'] = struct.pack('BBBB', 17, 1, dialog, 0) + payload[4:] + '\xdd\x06\x00\x50\xf2\x02\x02\x01' + msg['payload'] = struct.pack('BBBB', 17, 1, dialog, 0) + payload[4:] + b'\xdd\x06\x00\x50\xf2\x02\x02\x01' hapd.mgmt_tx(msg) # DELTS @@ -201,7 +202,10 @@ def test_tspec_protocol(dev, apdev): msg['sa'] = apdev[0]['bssid'] # modified parameters - msg['payload'] = struct.pack('BBBB', 17, 1, dialog, 1) + payload[4:12] + struct.pack('B', ord(payload[12]) & ~0x60) + payload[13:] + if sys.version_info[0] > 2: + msg['payload'] = struct.pack('BBBB', 17, 1, dialog, 1) + payload[4:12] + struct.pack('B', (payload[12]) & ~0x60) + payload[13:] + else: + msg['payload'] = struct.pack('BBBB', 17, 1, dialog, 1) + payload[4:12] + struct.pack('B', ord(payload[12]) & ~0x60) + payload[13:] hapd.mgmt_tx(msg) # reject request