From 3dfa519c3252df42ea1c04519acd8fa43a5a998f Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 17 Jul 2015 22:24:58 +0200 Subject: [PATCH] tests: Work around iw scan getting stuck On recent kernels, it seems that something changed (scheduler?) that makes hwsim send the scan done event so quickly that iw isn't scheduled back in to listen for it, causing iw to get stuck. Work around this by using the scan trigger command (it'll be quick enough so that we don't really need to wait) and the scan trigger and dump commands where the results are required (and use a small sleep there instead of waiting for the scan results.) I'll try to fix this separately in iw later. Signed-off-by: Johannes Berg --- tests/hwsim/test_ap_ht.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index e6895c55c..8a8aa9f98 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -17,7 +17,7 @@ from test_ap_csa import csa_supported def clear_scan_cache(ifname): subprocess.call(['ifconfig', ifname, 'up']) - subprocess.call(['iw', ifname, 'scan', 'freq', '2412', 'flush']) + subprocess.call(['iw', ifname, 'scan', 'trigger', 'freq', '2412', 'flush']) time.sleep(0.1) subprocess.call(['ifconfig', ifname, 'down']) @@ -144,7 +144,9 @@ def test_ap_ht40_scan_not_affected(dev, apdev): hostapd.add_ap(apdev[1]['ifname'], params) subprocess.call(['ifconfig', apdev[0]['ifname'], 'up']) - subprocess.call(['iw', apdev[0]['ifname'], 'scan', 'freq', '2462'], + subprocess.call(['iw', apdev[0]['ifname'], 'scan', 'trigger', 'freq', '2462']) + time.sleep(0.5) + subprocess.call(['iw', apdev[0]['ifname'], 'scan', 'dump'], stdout=open('/dev/null', 'w')) time.sleep(0.1) subprocess.call(['ifconfig', apdev[0]['ifname'], 'down'])