From patchwork Mon Sep 25 07:20:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1838931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zbr9ac2n; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=pcWC7/iy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvDrD24Khz26jZ for ; Mon, 25 Sep 2023 17:23:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0sYX4xMAAf108a+iMyX7NWSCYE06K/7jBBxYNCV6BOw=; b=zbr9ac2ntbe/Gl 8tR+TqBOckvykbUID9h3MzXwpMmcwJiv5CJGCe/Xr6m1pxL7K5Y8iVzw50u6Q7CAd9Bq5wforjeUc tlQEbney3LtQWuHEOW/TQ2CuU3PcBiw+gXvgNwjvthqU3zynJbfPL5Zlio0qYTSW2bqpHxh4bVgqz 10GJ6lCEwwTHUR7YrrUNI6qpNRWqbXMeA88A//ItaPT5/cHxwNym09Yvjdc5md8xDC4MuUhChG65H BvBprSlJxaE8yIGLGrZbz5bvPuF95gE+WYNW09PaWpIhC9U52oPkxTNpNQfcB2eQMurdOseDKVLvt +WLfMevkPbJBSifB0kEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qkfvY-00DYGE-0f; Mon, 25 Sep 2023 07:22:44 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qkfvS-00DYCU-0Y for hostap@lists.infradead.org; Mon, 25 Sep 2023 07:22:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=axeonhGaFAZgsSWeXSPrZuyrGcFuj5C10CEWj/PmmAQ=; t=1695626558; x=1696836158; b=pcWC7/iyzyHDjFHRAQtH6SEWPmT6UHaVBdnrUpRayck6wV0 MG6jVaR7YTTzS6tNIblF8vh1uRECKwyYFAh9PX2jnz9v3RCuj87WeKX4zYMyQgXDlXi8IEwcR6hdU nYFxoRSa+Gc7m8QgCg7AKAwhxXBVcO2v8m/MSm0+druRHPBsaToMzafdib4xDuao8ycXs87CbgD1l S5zPZ7KdBLgQ2eP4VyxS037DXpTOEZEEORF7T68JtDe7ZHrfOz+EWOmes9LgzE3P1noNlBCn8VTLR azqBFEAnZXgS7RW8dz92FtlLlS0tzAYlCyKxV9aVeXvVV7WAotCh8/1qcbUTZAtw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qkfvQ-003GNz-0U; Mon, 25 Sep 2023 09:22:36 +0200 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 05/17] tests: rrm: wait for AP STA before requests to AP Date: Mon, 25 Sep 2023 09:20:45 +0200 Message-ID: <20230925092039.610d5d15bc03.Id3f27b2ef62775282a6458284275ab0b6c941eb6@changeid> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230925072039.49987-18-johannes@sipsolutions.net> References: <20230925072039.49987-18-johannes@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_002238_367648_93F11AFC X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg Before requesting anything about the specific STA from the AP wait for it to show up, so that things don't fail if the hostapd process didn't yet get time to process things. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Before requesting anything about the specific STA from the AP wait for it to show up, so that things don't fail if the hostapd process didn't yet get time to process things. Signed-off-by: Johannes Berg --- tests/hwsim/test_rrm.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py index 86cde92936b4..7dc2359d8144 100644 --- a/tests/hwsim/test_rrm.py +++ b/tests/hwsim/test_rrm.py @@ -859,6 +859,7 @@ def test_rrm_beacon_req_table(dev, apdev): dev[0].scan_for_bss(apdev[1]['bssid'], freq=2412) dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req) @@ -899,6 +900,7 @@ def test_rrm_beacon_req_frame_body_fragmentation(dev, apdev): dev[0].flush_scan_cache() dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req) @@ -941,6 +943,7 @@ def test_rrm_beacon_req_last_frame_indication(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() # The request contains the last beacon report indication subelement req = build_beacon_request(mode=2) @@ -998,6 +1001,7 @@ def test_rrm_beacon_req_table_detail(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() logger.info("Reporting Detail 0") req = build_beacon_request(mode=2) @@ -1063,6 +1067,7 @@ def test_rrm_beacon_req_table_request(dev, apdev): dev[0].flush_scan_cache() dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req + "020101" + "0a03000106") @@ -1107,6 +1112,7 @@ def test_rrm_beacon_req_table_request_oom(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) with alloc_fail(dev[0], 1, @@ -1152,6 +1158,7 @@ def test_rrm_beacon_req_table_bssid(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() bssid2 = hapd2.own_addr() req = build_beacon_request(mode=2, bssid=bssid2) @@ -1177,6 +1184,7 @@ def test_rrm_beacon_req_table_ssid(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() bssid2 = hapd2.own_addr() req = build_beacon_request(mode=2) @@ -1220,6 +1228,7 @@ def test_rrm_beacon_req_table_info(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() logger.info("Unsupported reporting information 1") req = build_beacon_request(mode=2) @@ -1248,6 +1257,7 @@ def test_rrm_beacon_req_table_unknown_subelem(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req + "330101" + "fe00") @@ -1266,6 +1276,7 @@ def test_rrm_beacon_req_table_truncated_subelem(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req + "0001") @@ -1283,6 +1294,7 @@ def test_rrm_beacon_req_table_rsne(dev, apdev): dev[0].connect("rrm-rsn", psk="12345678", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=2) token = run_req_beacon(hapd, addr, req + "020101" + "0a0130") @@ -1333,6 +1345,7 @@ def test_rrm_beacon_req_table_vht(dev, apdev): dev[0].connect("rrm-vht", key_mgmt="NONE", scan_freq="5180") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(opclass=240, mode=2) token = run_req_beacon(hapd, addr, req) @@ -1369,6 +1382,7 @@ def test_rrm_beacon_req_active(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(duration=100, mode=1) token = run_req_beacon(hapd, addr, req) @@ -1399,6 +1413,7 @@ def test_rrm_beacon_req_active_ignore_old_result(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=1, duration=100, mode=1) token = run_req_beacon(hapd, addr, req) @@ -1447,6 +1462,7 @@ def test_rrm_beacon_req_active_many(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() ok = False for j in range(3): @@ -1476,6 +1492,7 @@ def test_rrm_beacon_req_active_ap_channels(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=255, duration=100, mode=1) token = run_req_beacon(hapd, addr, req + "dd0111" + "330351010b" + "dd0111") @@ -1502,6 +1519,7 @@ def test_rrm_beacon_req_active_no_ir(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(opclass=118, chan=52, duration=100, mode=1) token = run_req_beacon(hapd, addr, req) @@ -1526,6 +1544,7 @@ def test_rrm_beacon_req_passive_ap_channels(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=255, duration=100) token = run_req_beacon(hapd, addr, req + "330351010b" + "3300" + "dd00") @@ -1553,6 +1572,7 @@ def test_rrm_beacon_req_active_single_channel(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=11, duration=100, mode=1) token = run_req_beacon(hapd, addr, req) @@ -1573,6 +1593,7 @@ def test_rrm_beacon_req_active_ap_channels_unknown_opclass(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=255, duration=100, mode=1) token = run_req_beacon(hapd, addr, req + "3303ff010b") @@ -1594,6 +1615,7 @@ def test_rrm_beacon_req_active_ap_channel_oom(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() with alloc_fail(dev[0], 1, "wpas_add_channels"): req = build_beacon_request(chan=255, duration=100, mode=1) @@ -1614,6 +1636,7 @@ def test_rrm_beacon_req_active_scan_fail(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() with alloc_fail(dev[0], 1, "wpa_supplicant_trigger_scan"): req = build_beacon_request(chan=255, duration=100, mode=1) @@ -1635,6 +1658,7 @@ def test_rrm_beacon_req_active_zero_duration(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(mode=1) token = run_req_beacon(hapd, addr, req) @@ -1649,6 +1673,7 @@ def test_rrm_beacon_req_active_fail_random(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() with fail_test(dev[0], 1, "os_get_random;wpas_rm_handle_beacon_req"): req = build_beacon_request(duration=100, mode=1) @@ -1669,6 +1694,7 @@ def test_rrm_beacon_req_passive(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(duration=100) token = run_req_beacon(hapd, addr, req) @@ -1695,6 +1721,7 @@ def test_rrm_beacon_req_passive_no_match(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=1, duration=100, bssid="02:11:22:33:44:55") token = run_req_beacon(hapd, addr, req) @@ -1713,6 +1740,7 @@ def test_rrm_beacon_req_passive_no_match_oom(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(chan=1, duration=100, bssid="02:11:22:33:44:55") with alloc_fail(dev[0], 1, "wpabuf_resize;wpas_beacon_rep_scan_process"): @@ -1739,6 +1767,7 @@ def test_rrm_beacon_req_active_duration_mandatory(dev, apdev): dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(duration=100, mode=1) token = run_req_beacon(hapd, addr, "req_mode=10 " + req) @@ -1781,6 +1810,7 @@ def test_rrm_beacon_req_passive_scan_vht(dev, apdev): dev[0].connect("rrm-vht", key_mgmt="NONE", scan_freq="5180") addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(opclass=128, duration=100) token = run_req_beacon(hapd, addr, req) @@ -1837,6 +1867,7 @@ def test_rrm_beacon_req_passive_scan_vht160(dev, apdev): raise Exception("Unexpected SIGNAL_POLL value: " + str(sig)) addr = dev[0].own_addr() + hapd.wait_sta() req = build_beacon_request(opclass=129, duration=100) token = run_req_beacon(hapd, addr, req)