[RFC 15/97] tests: Verify NAN-NDP-DISCONNECTED failure flag

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Apr 28 13:05:16 PDT 2026


In case of wrong password, make sure failure=1 is set in the
NAN-NDP-DISCONNECTED event.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 tests/hwsim/test_nan.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/hwsim/test_nan.py b/tests/hwsim/test_nan.py
index 8926140b9f..b977e9c0a6 100644
--- a/tests/hwsim/test_nan.py
+++ b/tests/hwsim/test_nan.py
@@ -1072,11 +1072,11 @@ def _nan_ndp_request_and_accept(pub, sub, pid, sid, paddr, saddr, req_ssi, resp_
     # Verify disconnection on wrong password
     if wrong_pwd:
         ev = sub.wpas.wait_event(["NAN-NDP-DISCONNECTED"], timeout=5)
-        if ev is None or "reason=3" not in ev:
-            raise Exception("NAN-NDP-DISCONNECTED event not seen on subscriber")
+        if ev is None or "reason=3" not in ev or "failure=1" not in ev:
+            raise Exception("NAN-NDP-DISCONNECTED(failure) event not seen on subscriber")
         ev = pub.wpas.wait_event(["NAN-NDP-DISCONNECTED"], timeout=5)
-        if ev is None or "reason=3" not in ev:
-            raise Exception("NAN-NDP-DISCONNECTED event not seen on publisher")
+        if ev is None or "reason=3" not in ev or "failure=1" not in ev:
+            raise Exception("NAN-NDP-DISCONNECTED(failure) event not seen on publisher")
         return None
 
     # Handle counter proposal
-- 
2.53.0




More information about the Hostap mailing list