From: Peddolla Harshavardhan Reddy Date: Fri, 13 Jun 2025 16:38:14 +0000 (+0530) Subject: tests: Fix pasn_sae_driver to clear PTKSA cache after first PASN exchange X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c01a9cc5ea0daed2c7e2e291f0ee9f34e9836de3;p=thirdparty%2Fhostap.git tests: Fix pasn_sae_driver to clear PTKSA cache after first PASN exchange The test pasn_sae_driver triggers PASN for the same peers twice. In the current implementation, when PASN succeeds, the keys generated are stored in the PTKSA cache. The function wpas_pasn_configure_next_peer() shows an issue where it does not reuse keys from a previous PASN exchange, even when those keys are available in the cache. Instead, it initiates a new PASN exchange unnecessarily. Fix the test case by deleting the keys from the cache after the first PASN attempt. This ensures a full PASN exchange can occur again. A subsequent commit will address the API behavior to reuse keys from the cache when available. Signed-off-by: Peddolla Harshavardhan Reddy --- diff --git a/tests/hwsim/test_pasn.py b/tests/hwsim/test_pasn.py index 5a2ec578b..da6719373 100644 --- a/tests/hwsim/test_pasn.py +++ b/tests/hwsim/test_pasn.py @@ -1068,6 +1068,10 @@ def test_pasn_sae_driver(dev, apdev): time.sleep(1) dev[0].dump_monitor() + cmd2 = f"PASN_DRIVER del {bssid} {bssid2}" + if "OK" not in dev[0].request(cmd2): + raise Exception("PASN_DRIVER failed") + if "OK" not in dev[0].request(cmd): raise Exception("PASN_DRIVER failed")