From: Jouni Malinen Date: Sat, 26 Apr 2014 14:18:37 +0000 (+0300) Subject: tests: Verify network information in SCAN_RESULTS X-Git-Tag: hostap_2_2~209 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=91bc6c364f5cde3249bd206f5901bc4b32dea87e;p=mech_eap.git 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 --- diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 024c2ef..b65c4bd 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/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") ]) diff --git a/tests/hwsim/test_ap_pmf.py b/tests/hwsim/test_ap_pmf.py index 68eb3aa..22a3c99 100644 --- a/tests/hwsim/test_ap_pmf.py +++ b/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", diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 1a6d805..6ab8532 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/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") diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py index b1d6bfe..7819ad8 100644 --- a/tests/hwsim/test_pmksa_cache.py +++ b/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) diff --git a/tests/hwsim/test_wep.py b/tests/hwsim/test_wep.py index 8dbc9be..8790033 100644 --- a/tests/hwsim/test_wep.py +++ b/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"""