]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make scan_trigger_failure more informative
authorJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 16:41:04 +0000 (18:41 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 16:41:04 +0000 (18:41 +0200)
If wpa_state is left to SCANNING by a previously executed test case,
scan_trigger_failure will fail. Instead of waiting for that failure,
check for wpa_state at the beginning of the test case and report a more
helpful error message if the test case would fail due to a previously
executed test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_scan.py

index 761520abaf42dcb54d63015f722cb996f71dcfe5..9e823c3781212d639e9c84c75edf7be0cc2aebc0 100644 (file)
@@ -817,6 +817,9 @@ def _test_scan_random_mac_connected(dev, apdev, params):
 @remote_compatible
 def test_scan_trigger_failure(dev, apdev):
     """Scan trigger to the driver failing"""
+    if dev[0].get_status_field('wpa_state') == "SCANNING":
+        raise Exception("wpa_state was already SCANNING")
+
     hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
     bssid = apdev[0]['bssid']