From fda4734a1bf76348f8cc888eaa86b0878558bd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= Date: Thu, 28 Jan 2021 09:26:03 +0000 Subject: [PATCH] auto-t: throw exception if hostapd can't send BSS transition req The testAPRoam autotest was silently failing on my machine until I realized that my distribution hostapd (Arch Linux) is not built with CONFIG_WNM_AP=y. Indeed, it is also disabled by default in upstream hostapd. This resulted in the send_bss_transition() function of hostapd.py silently failing. With this change, throw an exception in case the BSS_TM_REQ command does not succeed to hopefully save others the time of debugging this problem. --- autotests/util/hostapd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 019d23ba..277a07b0 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -184,7 +184,10 @@ class HostapdCLI: (addr, bss_info, op_class, chan_num, phy_num)] pref += 1 - ctx.start_process(cmd, wait=True) + proc = ctx.start_process(cmd, wait=True, need_out=True) + + if 'OK' not in proc.out: + raise Exception('BSS_TM_REQ failed, is hostapd built with CONFIG_WNM_AP=y?') def get_config_value(self, key): # first find the right config file