From: Jouni Malinen Date: Fri, 6 Mar 2015 15:03:06 +0000 (+0200) Subject: tests: Make offchannel_tx_roc_gas more robust X-Git-Tag: hostap_2_4~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cc223c2f57adaa4d1dbb6dee6f5caa228b54d98;p=thirdparty%2Fhostap.git tests: Make offchannel_tx_roc_gas more robust It was possible for this test case to fail if cfg80211 BSS cache included an entry for the same BSSID on another channel from an earlier test case. Fix this by epxlicitly flushing the cache. In addition, use scan_for_bss() to make the test less likely to fail in case of heavy CPU load. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_offchannel_tx.py b/tests/hwsim/test_offchannel_tx.py index 2a247c607..6d4939230 100644 --- a/tests/hwsim/test_offchannel_tx.py +++ b/tests/hwsim/test_offchannel_tx.py @@ -22,7 +22,8 @@ def test_offchannel_tx_roc_gas(dev, apdev): wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') wpas.interface_add("wlan5", drv_params="no_offchannel_tx=1") - wpas.scan(freq="2412") + wpas.flush_scan_cache() + wpas.scan_for_bss(bssid, freq=2412) anqp_get(wpas, bssid, 263) ev = wpas.wait_event(["GAS-QUERY-DONE"], timeout=10) if ev is None: