From patchwork Fri Sep 27 09:36:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1990192 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=dHYuRBOZ; 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=h+uA4qwI; 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 4XFQPP1hFFz1xtK for ; Fri, 27 Sep 2024 19:38:01 +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=PBaB4gRQHKLHGM8pBOgOWzjDQwqXmDEVjFDK83+Y9s8=; b=dHYuRBOZG2+hC4 L/jLLlLYB2AlsKFYlhZwwbM7rDNTxboW1TKI6o6zct2ULptZ80HOK891p4kdHafRgxMf702l6+8jJ Knm7ZDTIslfJjdaMAzqQT56ov9/dsQZ89S0tIeEeG+RCM9XCFRkNo05FwqM2ItRkgTLdSmUQIafQK 4d2i1PCIObBZYlllvnO81H9brnXQduhrNi8ZCjVoRt3kg+07B6aZnFII1rmx9uNPEk1y+pV1X/USt kH6a0mzoIY7/KSYJlVi1tk7Ub7WmElwjDCpG5V8wJcEh6ZFZVOrgHsG5cETIEnau14FevBoJKeH49 ZzlT5hT9icG83aU+y1Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1su7Pe-0000000Ag6U-2lkY; Fri, 27 Sep 2024 09:37:22 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1su7PH-0000000Afyt-2CiQ for hostap@lists.infradead.org; Fri, 27 Sep 2024 09:37:00 +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=vb9n8p/LJ1GP8ifF2evoCDdU7s89d/6MXLwyhQrpQRw=; t=1727429817; x=1728639417; b=h+uA4qwIahjCnZ5pXhXaRIZVKNK2kamzKrUwUfAyD0ON87T a3m9UTEt/SFL57WwPHI7Oj7dpEmsdw2AG0FbTq0SQ+W2ANLYmrQeX83UZlXSwa903HcD4CTKGIiH9 a5zGs+tHJXDX5hjTgzFYWt404anUi1RjGEctf7vskU1GWZsEzKZbsygjjq6JcdmqDlaMbHvOryVm0 ppwjxfvswmmvWZs3CRnb9jINvZB9SB+oI7l4qHIq0pkJg+Px+n4NzQhypcPB1E+DWEQrZ/FDA1LnX umwzwdbzW106vECzRzRHyDHVTCFlYOqJzMkhCUFlo7tfIDawrC46fovfOzvAlLrA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1su7PC-00000003b5M-1rIT; Fri, 27 Sep 2024 11:36:54 +0200 From: Benjamin Berg To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH 2/3] tests: Insert sleep after DATA_TEST_FRAME where needed Date: Fri, 27 Sep 2024 11:36:21 +0200 Message-ID: <20240927093622.883806-2-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240927093622.883806-1-benjamin@sipsolutions.net> References: <20240927093622.883806-1-benjamin@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240927_023659_607196_E4E76059 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) 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: Benjamin Berg If the frame is not fully processed the neighbor entries of the bridge will not yet be updated. Add a sleep to ensure that the tests are not racy. Signed-off-by: Benjamin Berg --- tests/hwsim/test_ap_hs20.py | 13 +++++++++++-- tests/hwsim/test_hs20_filter.py | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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 -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Benjamin Berg If the frame is not fully processed the neighbor entries of the bridge will not yet be updated. Add a sleep to ensure that the tests are not racy. Signed-off-by: Benjamin Berg --- tests/hwsim/test_ap_hs20.py | 13 +++++++++++-- tests/hwsim/test_hs20_filter.py | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 35cb0b8fe9..8b6359113e 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -4357,16 +4357,19 @@ def _test_ap_hs20_proxyarp(dev, apdev): if "OK" not in dev[1].request("DATA_TEST_FRAME " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") + # Wait for frames to be processed + time.sleep(0.1) + matches = get_permanent_neighbors("ap-br0") logger.info("After connect: " + str(matches)) - if len(matches) != 3: - raise Exception("Unexpected number of neighbor entries after connect") if 'aaaa:bbbb:cccc::2 dev ap-br0 lladdr 02:00:00:00:00:00 PERMANENT' not in matches: raise Exception("dev0 addr missing") if 'aaaa:bbbb:dddd::2 dev ap-br0 lladdr 02:00:00:00:01:00 PERMANENT' not in matches: raise Exception("dev1 addr(1) missing") if 'aaaa:bbbb:eeee::2 dev ap-br0 lladdr 02:00:00:00:01:00 PERMANENT' not in matches: raise Exception("dev1 addr(2) missing") + if len(matches) != 3: + raise Exception("Unexpected number of neighbor entries after connect") dev[0].request("DISCONNECT") dev[1].request("DISCONNECT") time.sleep(0.5) @@ -4489,6 +4492,9 @@ def _test_ap_hs20_proxyarp_dgaf(dev, apdev, disabled): if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") + # Wait for frames to be processed + time.sleep(0.1) + matches = get_permanent_neighbors("ap-br0") logger.info("After connect: " + str(matches)) if len(matches) != 2: @@ -4949,6 +4955,9 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False): if "OK" not in hapd.request("DATA_TEST_FRAME ifname=ap-br0 " + binascii.hexlify(pkt).decode()): raise Exception("DATA_TEST_FRAME failed") + # Wait for frames to be processed + time.sleep(0.1) + macs = get_bridge_macs("ap-br0") logger.info("After connect (showmacs): " + str(macs)) diff --git a/tests/hwsim/test_hs20_filter.py b/tests/hwsim/test_hs20_filter.py index 11cf347563..b916da567e 100644 --- a/tests/hwsim/test_hs20_filter.py +++ b/tests/hwsim/test_hs20_filter.py @@ -172,6 +172,9 @@ 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") + # Wait for frames to be processed + time.sleep(0.1) + if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode(): raise Exception("gratuitous ARP frame updated erroneously") finally: @@ -199,6 +202,9 @@ 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") + # Wait for frames to be processed + time.sleep(0.1) + if hapd.own_addr() in subprocess.check_output(['ip', 'neigh', 'show']).decode(): raise Exception("unsolicited NA frame updated erroneously") finally: