]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Skip some scan tests if iw does not support scan flush
authorJouni Malinen <j@w1.fi>
Sat, 17 Jan 2015 11:05:34 +0000 (13:05 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 17 Jan 2015 11:05:34 +0000 (13:05 +0200)
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 <j@w1.fi>
tests/hwsim/test_scan.py

index 55931081f699dbb55c87f6175ac7cff875776d5c..d5d542285e8fb85745531c30058ed1df4b787eb0 100644 (file)
@@ -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")