[PATCH 10/18] tests: check for WPA_TRACE messages in hostapd log
Benjamin Berg
benjamin at sipsolutions.net
Thu Oct 30 01:24:41 PDT 2025
From: Benjamin Berg <benjamin.berg at intel.com>
Otherwise the tests will simply pass even though e.g. a memory leak or
other error is reported. So read the log file and raise an exception
when it contains the 'WPA_TRACE:' string.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
tests/hwsim/test_eht.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
index 339efaa103..c6c7859d62 100644
--- a/tests/hwsim/test_eht.py
+++ b/tests/hwsim/test_eht.py
@@ -2222,8 +2222,9 @@ def get_mld_devs(hapd_iface, count, prefix, rnr=False):
return [hapd_mld1_link0, hapd_mld1_link1, hapd_mld2_link0, hapd_mld2_link1]
-def stop_mld_devs(hapds, pid):
- pid = pid + ".hostapd.pid"
+def stop_mld_devs(hapds, prefix):
+ pid = prefix + ".hostapd.pid"
+ log = prefix + ".hostapd-log"
if "OK" not in hapds[0].request("TERMINATE"):
raise Exception("Failed to terminate hostapd process")
@@ -2241,6 +2242,11 @@ def stop_mld_devs(hapds, pid):
if os.path.exists(pid):
raise Exception("PID file exits after process termination")
+ with open(log, 'rb') as f:
+ log_data = f.read()
+ if b'WPA_TRACE:' in log_data:
+ raise Exception(f'WPA_TRACE messages found in {log}')
+
def eht_parse_rnr(bss, rnr=False, exp_bssid=None):
partner_rnr_pattern = re.compile(".*ap_info.*, mld ID=0, link ID=",
re.MULTILINE)
--
2.51.0
More information about the Hostap
mailing list