tests: Additional coverage for SCAN_RESULTS and BSS entry flags

This increases wpa_supplicant_ie_txt(), print_bss_info(), and
wpa_supplicant_ctrl_iface_scan_result() testing coverage to include the
previously missing key management options.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-12-07 23:27:45 +02:00
parent ff1dd3e9a1
commit d463c5566f
7 changed files with 57 additions and 0 deletions

View file

@ -1695,6 +1695,12 @@ def test_ap_wpa2_eap_psk(dev, apdev):
check_mib(dev[0], [ ("dot11RSNAAuthenticationSuiteRequested", "00-0f-ac-5"),
("dot11RSNAAuthenticationSuiteSelected", "00-0f-ac-5") ])
bss = dev[0].get_bss(apdev[0]['bssid'])
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[WPA2-EAP-SHA256-CCMP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
logger.info("Negative test with incorrect password")
dev[0].request("REMOVE_NETWORK all")
eap_connect(dev[0], apdev[0], "PSK", "psk.user@example.com",

View file

@ -345,6 +345,10 @@ def test_ap_hs20_select(dev, apdev):
dev[0].set_cred_quoted(id, "realm", "no.match.example.com");
interworking_select(dev[0], bssid, no_match=True, freq="2412")
res = dev[0].request("SCAN_RESULTS")
if "[HS20]" not in res:
raise Exception("HS20 flag missing from scan results: " + res)
bssid2 = apdev[1]['bssid']
params = hs20_ap_params()
params['nai_realm'] = [ "0,example.org,21" ]

View file

@ -169,6 +169,16 @@ def test_ibss_wpa_none(dev):
print bssid1
print bssid2
bss = dev[0].get_bss(bssid0)
if not bss:
bss = dev[1].get_bss(bssid1)
if not bss:
raise Exception("Could not find BSS entry for IBSS")
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[WPA-None-TKIP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
# Allow some time for all peers to complete key setup
time.sleep(1)
@ -240,6 +250,21 @@ def test_ibss_open(dev):
if bssid0 != bssid1:
logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1)
res = dev[0].request("SCAN_RESULTS")
if "[IBSS]" not in res:
res = dev[1].request("SCAN_RESULTS")
if "[IBSS]" not in res:
raise Exception("IBSS flag missing from scan results: " + res)
bss = dev[0].get_bss(bssid0)
if not bss:
bss = dev[1].get_bss(bssid1)
if not bss:
raise Exception("Could not find BSS entry for IBSS")
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[IBSS]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
def test_ibss_open_fixed_bssid(dev):
"""IBSS open (no security) and fixed BSSID"""
ssid="ibss"

View file

@ -49,6 +49,10 @@ def test_autogo(dev):
if "id=" + id not in res:
raise Exception("Could not find BSS entry based on id range")
res = dev[1].request("SCAN_RESULTS")
if "[P2P]" not in res:
raise Exception("P2P flag missing from scan results: " + res)
# Presence request to increase testing coverage
if "FAIL" in dev[1].group_request("P2P_PRESENCE_REQ 30000 102400"):
raise Exception("Could not send presence request")

View file

@ -27,6 +27,11 @@ def test_sae(dev, apdev):
scan_freq="2412")
if dev[0].get_status_field('sae_group') != '19':
raise Exception("Expected default SAE group not used")
bss = dev[0].get_bss(apdev[0]['bssid'])
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[WPA2-SAE-CCMP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
def test_sae_pmksa_caching(dev, apdev):
"""SAE and PMKSA caching"""

View file

@ -24,6 +24,13 @@ def test_suite_b(dev, apdev):
client_cert="auth_serv/user.pem",
private_key="auth_serv/user.key",
pairwise="GCMP", group="GCMP", scan_freq="2412")
bss = dev[0].get_bss(apdev[0]['bssid'])
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[WPA2-EAP-SUITE-B-GCMP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
dev[0].request("DISCONNECT")
ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=20)
if ev is None:

View file

@ -18,6 +18,12 @@ def test_wep_open_auth(dev, apdev):
if "[WEP]" not in dev[0].request("SCAN_RESULTS"):
raise Exception("WEP flag not indicated in scan results")
bss = dev[0].get_bss(apdev[0]['bssid'])
if 'flags' not in bss:
raise Exception("Could not get BSS flags from BSS table")
if "[WEP]" not in bss['flags']:
raise Exception("Unexpected BSS flags: " + bss['flags'])
def test_wep_shared_key_auth(dev, apdev):
"""WEP Shared Key authentication"""
hapd = hostapd.add_ap(apdev[0]['ifname'],