From patchwork Wed May 13 06:59:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 2237508 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=GpLk/Idd; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=K5z38lN/; 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 4gFks53hXBz1yJ5 for ; Wed, 13 May 2026 17:01:29 +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: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:In-Reply-To:References: List-Owner; bh=VIQT3CQE9098UWWh7pvoq8pL6fDEUKHzCMRgNMPBDrU=; b=GpLk/IddUZ8gNH d5Oq4FGj8ePI7y14sK0ihRXrF4u796rVOLY3RVMYEkjAtT3/BErNgI63xZvx4E3Dc6wop3OItnn6H 2r/m0g4ootvMfflwhxAyKfZyHFeFDOL1lxuOou2asvIujJpn1vCk6jL+ez6SWaTZucLTg7D71Co47 ymof5yn+eh+gOJ2DttUlUInZBOUEFPqgk5iWwBZWaRn15CwyikLKmbU2LaM0IUzY6sVu2JtKml1R4 VbeNjS3uzD0uR0qn12qwJLm0pmYfwxdQ28lReTPIzID/WPtGHthW7GVCDYIDlxv5QANK6Zah6tmmu iZX1BJ5h2xtwFRT14rtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN3ZC-00000001UdL-3BZd; Wed, 13 May 2026 06:59:38 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN3ZA-00000001UZY-0FMT for hostap@lists.infradead.org; Wed, 13 May 2026 06:59:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778655577; x=1810191577; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Mq8lRwmj3+8Bd6y8NjO1m6eEuE1GvKazarKI++libEo=; b=K5z38lN/N6l5T1Ap1RSOM582Ch9GsecmJrJ9QsHODNSLzSJ6rqyjEsGI kwty9GfxfW5qBurg8CaiozG8AHoAPF1M7Q08V9O5FKKqI0i1tq4gNFl8/ bU6CsY/xCzxUGsRTqwmCbVIEhOnNvxUFQTEA7v+VSzofuhIb6jWwB3OTF zxzfwyinjTe2ThflcrQEM1oLftuCLnnVbFUs/VfWgNuJL5lmUQTom9Kd4 SgLrnBBAzrDKL0e63bDhI8MW45Qsub4SX1B/x07QRg/tFVkHgz7Gpv+5+ +49sh2zU/1eRXmYWnbuIZSZfX0qF45dTokpCGjjrLqdIgkiiNT5Am8A7X A==; X-CSE-ConnectionGUID: bL9ePVpGSm+iaNH7emM+pA== X-CSE-MsgGUID: eVmpUegTT7yEEgyxzaaE4w== X-IronPort-AV: E=McAfee;i="6800,10657,11784"; a="97001322" X-IronPort-AV: E=Sophos;i="6.23,232,1770624000"; d="scan'208";a="97001322" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 23:59:36 -0700 X-CSE-ConnectionGUID: wCFjqiizQpaiEqclwE9ojQ== X-CSE-MsgGUID: vCo1T8r6SHOTxaaCMDDplw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,232,1770624000"; d="scan'208";a="233721931" Received: from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com) ([10.167.28.6]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 23:59:34 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: maheshkkv@google.com, vamsin@qti.qualcomm.com, Ilan Peer Subject: [PATCH 3/3] tests: Add NAN test to cover followup status tracking Date: Wed, 13 May 2026 09:59:06 +0300 Message-ID: <20260513065909.12048-8-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260512_235936_138120_04F4A05F X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -4.8 (----) 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: Ilan Peer Add a test to verify that when a NAN transmit is requested with a cookie, the corresponding event is sent by the wpa_supplicant with valid acknowledgment status Signed-off-by: Ilan Peer --- tests/hwsim/test_nan.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) Content analysis details: (-4.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.175.65.10 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -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] -0.4 DKIMWL_WL_HIGH DKIMwl.org - High trust sender -0.0 DMARC_PASS DMARC pass policy 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: Ilan Peer Add a test to verify that when a NAN transmit is requested with a cookie, the corresponding event is sent by the wpa_supplicant with valid acknowledgment status Signed-off-by: Ilan Peer --- tests/hwsim/test_nan.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_nan.py b/tests/hwsim/test_nan.py index 1c16ba47c0..691da50032 100644 --- a/tests/hwsim/test_nan.py +++ b/tests/hwsim/test_nan.py @@ -279,11 +279,15 @@ class NanDevice: if "OK" not in self.wpas.request("NAN_UPDATE_CONFIG"): raise Exception(f"{self.ifname}: failed to update NAN configuration") - def transmit(self, handle, req_instance_id, address, ssi=None): + def transmit(self, handle, req_instance_id, address, ssi=None, cookie=None): logger.info(f"Transmitting followup on {self.ifname}") cmd = f"NAN_TRANSMIT handle={handle} req_instance_id={req_instance_id} address={address}" if ssi is not None: cmd += f" ssi={ssi}" + + if cookie is not None: + cmd += f" cookie={cookie}" + if "OK" not in self.wpas.request(cmd): raise Exception(f"{self.ifname}: failed to transmit NAN followup") @@ -449,6 +453,35 @@ def test_nan_sync_followup(dev, apdev, params): if ev is None or f"id={pid}" not in ev or f"peer_instance_id={sid}" not in ev or "ssi=11223344" not in ev: raise Exception("NAN-RECEIVE followup event not seen or invalid format") +def test_nan_sync_followup_tracking(dev, apdev, params): + """NAN synchronized active subscribe and solicited publish with followup tracking""" + with hwsim_nan_radios(count=2) as [wpas1, wpas2], \ + NanDevice(wpas1, "nan0") as pub, NanDevice(wpas2, "nan1") as sub: + pid, sid, paddr, _ = nan_sync_discovery(pub, sub, "test_service", + pssi="aabbccdd", sssi="ddbbccaa", + unsolicited=0, timeout=2) + + # Check followup to the publisher. Acknowledgment is expected. + cookie = 127 + sub.transmit(handle=sid, req_instance_id=pid, address=paddr, ssi="11223344", cookie=cookie) + ev = pub.wpas.wait_event(["NAN-RECEIVE"], timeout=2) + if ev is None or f"id={pid}" not in ev or f"peer_instance_id={sid}" not in ev or "ssi=11223344" not in ev: + raise Exception("NAN-RECEIVE followup event not seen or invalid format") + + ev = sub.wpas.wait_event(["NAN-TRANSMIT-STATUS"], timeout=2) + if ev is None or f"cookie={cookie}" not in ev or "acked=1" not in ev: + raise Exception("NAN-TX-STATUS event not seen or invalid data") + + # Check followup to an invalid address. Acknowledgment is not expected. + cookie = 243 + suffix = int(paddr[-2:], 16) ^ 0xFF + addr = paddr[:-2] + f"{suffix:02x}" + + sub.transmit(handle=sid, req_instance_id=pid, address=addr, cookie=cookie) + ev = sub.wpas.wait_event(["NAN-TRANSMIT-STATUS"], timeout=2) + if ev is None or f"cookie={cookie}" not in ev or "acked=0" not in ev: + raise Exception("NAN-TX-STATUS event not seen or invalid data") + def test_nan_sync_active_subscribe_two_publishers(dev, apdev, params): """NAN synchronized active subscribe and 2 publishers""" with hwsim_nan_radios(count=3) as [wpas1, wpas2, wpas3], \