aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-02 16:10:30 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-02 16:10:30 (GMT)
commit5dec879d5b7775871f73cd9e7ceafea10a4ec5a2 (patch)
treef95fe4e0a54630e186b8c63ea190d55a85306b3c
parentea23df652a3be2d22f767ed0ffa95ee8f3d4a30e (diff)
downloadhostap-5dec879d5b7775871f73cd9e7ceafea10a4ec5a2.zip
hostap-5dec879d5b7775871f73cd9e7ceafea10a4ec5a2.tar.gz
hostap-5dec879d5b7775871f73cd9e7ceafea10a4ec5a2.tar.bz2
tests: Verify STA command output and EAPOL state
Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/hostapd.py7
-rw-r--r--tests/hwsim/test_ap_eap.py11
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py
index 9ac7c9c..cf74a47 100644
--- a/tests/hwsim/hostapd.py
+++ b/tests/hwsim/hostapd.py
@@ -179,8 +179,11 @@ class Hostapd:
hdr = struct.pack('<HH6B6B6BH', *t)
self.request("MGMT_TX " + binascii.hexlify(hdr + msg['payload']))
- def get_sta(self, addr):
- res = self.request("STA " + addr)
+ def get_sta(self, addr, info=None):
+ if info:
+ res = self.request("STA " + addr + " " + info)
+ else:
+ res = self.request("STA " + addr)
lines = res.splitlines()
vals = dict()
first = True
diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py
index 1e5ad5d..e11939e 100644
--- a/tests/hwsim/test_ap_eap.py
+++ b/tests/hwsim/test_ap_eap.py
@@ -149,12 +149,23 @@ def test_ap_wpa2_eap_ttls_mschapv2(dev, apdev):
"""WPA2-Enterprise connection using EAP-TTLS/MSCHAPv2"""
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0]['ifname'], params)
+ hapd = hostapd.Hostapd(apdev[0]['ifname'])
eap_connect(dev[0], "TTLS", "DOMAIN\mschapv2 user",
anonymous_identity="ttls", password="password",
ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
domain_suffix_match="w1.fi")
hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+ sta1 = hapd.get_sta(dev[0].p2p_interface_addr())
+ eapol1 = hapd.get_sta(dev[0].p2p_interface_addr(), info="eapol")
eap_reauth(dev[0], "TTLS")
+ sta2 = hapd.get_sta(dev[0].p2p_interface_addr())
+ eapol2 = hapd.get_sta(dev[0].p2p_interface_addr(), info="eapol")
+ if int(sta2['dot1xAuthEapolFramesRx']) <= int(sta1['dot1xAuthEapolFramesRx']):
+ raise Exception("dot1xAuthEapolFramesRx did not increase")
+ if int(eapol2['authAuthEapStartsWhileAuthenticated']) < 1:
+ raise Exception("authAuthEapStartsWhileAuthenticated did not increase")
+ if int(eapol2['backendAuthSuccesses']) <= int(eapol1['backendAuthSuccesses']):
+ raise Exception("backendAuthSuccesses did not increase")
def test_ap_wpa2_eap_ttls_eap_gtc(dev, apdev):
"""WPA2-Enterprise connection using EAP-TTLS/EAP-GTC"""