Browse Source

tests: Verify network information in SCAN_RESULTS

This checks WPA/RSN IE parsing result and WEP information in
SCAN_RESULTS.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
91bc6c364f

+ 4 - 0
tests/hwsim/test_ap_ft.py

@@ -139,6 +139,8 @@ def test_ap_ft(dev, apdev):
     hostapd.add_ap(apdev[1]['ifname'], params)
 
     run_roams(dev[0], apdev, ssid, passphrase)
+    if "[WPA2-FT/PSK-CCMP]" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("Scan results missing RSN element info")
 
 def test_ap_ft_mixed(dev, apdev):
     """WPA2-PSK-FT mixed-mode AP"""
@@ -264,6 +266,8 @@ def test_ap_ft_eap(dev, apdev):
     hostapd.add_ap(apdev[1]['ifname'], params)
 
     run_roams(dev[0], apdev, ssid, passphrase, eap=True)
+    if "[WPA2-FT/EAP-CCMP]" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("Scan results missing RSN element info")
     check_mib(dev[0], [ ("dot11RSNAAuthenticationSuiteRequested", "00-0f-ac-3"),
                         ("dot11RSNAAuthenticationSuiteSelected", "00-0f-ac-3") ])
 

+ 2 - 0
tests/hwsim/test_ap_pmf.py

@@ -31,6 +31,8 @@ def test_ap_pmf_required(dev, apdev):
     dev[0].connect(ssid, psk="12345678", ieee80211w="1",
                    key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",
                    scan_freq="2412")
+    if "[WPA2-PSK-SHA256-CCMP]" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("Scan results missing RSN element info")
     hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
     dev[1].connect(ssid, psk="12345678", ieee80211w="2",
                    key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",

+ 2 - 0
tests/hwsim/test_ap_psk.py

@@ -93,6 +93,8 @@ def test_ap_wpa_ptk_rekey(dev, apdev):
     params = hostapd.wpa_params(ssid=ssid, passphrase=passphrase)
     hostapd.add_ap(apdev[0]['ifname'], params)
     dev[0].connect(ssid, psk=passphrase, wpa_ptk_rekey="1", scan_freq="2412")
+    if "[WPA-PSK-TKIP]" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("Scan results missing WPA element info")
     ev = dev[0].wait_event(["WPA: Key negotiation completed"])
     if ev is None:
         raise Exception("PTK rekey timed out")

+ 2 - 0
tests/hwsim/test_pmksa_cache.py

@@ -350,6 +350,8 @@ def test_pmksa_cache_preauth(dev, apdev):
             raise Exception("Pre-authentication EAPOL status was not available")
 
         dev[0].scan(freq="2412")
+        if "[WPA2-EAP-CCMP-preauth]" not in dev[0].request("SCAN_RESULTS"):
+            raise Exception("Scan results missing RSN element info")
         dev[0].request("ROAM " + bssid1)
         ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
                                 "CTRL-EVENT-CONNECTED"], timeout=10)

+ 2 - 0
tests/hwsim/test_wep.py

@@ -15,6 +15,8 @@ def test_wep_open_auth(dev, apdev):
     dev[0].connect("wep-open", key_mgmt="NONE", wep_key0='"hello"',
                    scan_freq="2412")
     hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+    if "[WEP]" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("WEP flag not indicated in scan results")
 
 def test_wep_shared_key_auth(dev, apdev):
     """WEP Shared Key authentication"""