From: Jouni Malinen Date: Sat, 17 Jan 2015 11:05:34 +0000 (+0200) Subject: tests: Skip some scan tests if iw does not support scan flush X-Git-Tag: hostap_2_4~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a15cf1f9b61d4e6de1253464daa249467be727;p=thirdparty%2Fhostap.git tests: Skip some scan tests if iw does not support scan flush The external cfg80211 scan flushing operation requires a relatively recent iw version and not all distributions include that. Avoid false failure reports by marking these test cases skipped if the iw command fails. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 55931081f..d5d542285 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -334,8 +334,11 @@ def test_scan_for_auth(dev, apdev): wait_connect=False) dev[0].dump_monitor() # Clear cfg80211 BSS table. - subprocess.call(['iw', dev[0].ifname, 'scan', 'trigger', - 'freq', '2457', 'flush']) + try: + subprocess.check_call(['iw', dev[0].ifname, 'scan', 'trigger', + 'freq', '2457', 'flush']) + except subprocess.CalledProcessError, e: + raise HwsimSkip("iw scan trigger flush not supported") ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 5) if ev is None: raise Exception("External flush scan timed out") @@ -362,8 +365,11 @@ def test_scan_for_auth_fail(dev, apdev): dev[0].dump_monitor() hapd.disable() # Clear cfg80211 BSS table. - subprocess.call(['iw', dev[0].ifname, 'scan', 'trigger', - 'freq', '2457', 'flush']) + try: + subprocess.check_call(['iw', dev[0].ifname, 'scan', 'trigger', + 'freq', '2457', 'flush']) + except subprocess.CalledProcessError, e: + raise HwsimSkip("iw scan trigger flush not supported") ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 5) if ev is None: raise Exception("External flush scan timed out") @@ -398,8 +404,11 @@ def test_scan_for_auth_wep(dev, apdev): auth_alg="SHARED", scan_freq="2412", wait_connect=False) dev[0].dump_monitor() # Clear cfg80211 BSS table. - subprocess.call(['iw', dev[0].ifname, 'scan', 'trigger', - 'freq', '2457', 'flush']) + try: + subprocess.check_call(['iw', dev[0].ifname, 'scan', 'trigger', + 'freq', '2457', 'flush']) + except subprocess.CalledProcessError, e: + raise HwsimSkip("iw scan trigger flush not supported") ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 5) if ev is None: raise Exception("External flush scan timed out")