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 <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2015-07-17 22:24:58 +02:00 committed by Jouni Malinen
parent a0e117c684
commit 3dfa519c32

View File

@ -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'])