aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-07-03 16:23:18 (GMT)
committerJouni Malinen <j@w1.fi>2016-07-03 19:37:01 (GMT)
commit208ebb9d1ae4f31b5590760abd976461a4213f17 (patch)
tree3cd6bdbbcf1ff71c78e10bb32e2812e3b2f5c2c8
parent28642616bfb49390f8c97026b5531c12463269fb (diff)
downloadhostap-208ebb9d1ae4f31b5590760abd976461a4213f17.zip
hostap-208ebb9d1ae4f31b5590760abd976461a4213f17.tar.gz
hostap-208ebb9d1ae4f31b5590760abd976461a4213f17.tar.bz2
tests: Hotspot 2.0 network selection and OOM
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_ap_hs20.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py
index d1c7549..e9b15bf 100644
--- a/tests/hwsim/test_ap_hs20.py
+++ b/tests/hwsim/test_ap_hs20.py
@@ -17,7 +17,7 @@ import socket
import subprocess
import hostapd
-from utils import HwsimSkip, skip_with_fips, alloc_fail
+from utils import HwsimSkip, skip_with_fips, alloc_fail, wait_fail_trigger
import hwsim_utils
from tshark import run_tshark
from wlantest import Wlantest
@@ -3996,3 +3996,38 @@ def test_ap_hs20_cred_and_no_roaming_consortium(dev, apdev):
'roaming_consortium': "112234",
'eap': 'TTLS' })
interworking_select(dev[0], bssid, "home", freq=2412, no_match=True)
+
+def test_ap_hs20_interworking_oom(dev, apdev):
+ """Hotspot 2.0 network selection and OOM"""
+ bssid = apdev[0]['bssid']
+ params = hs20_ap_params()
+ params['hessid'] = bssid
+ params['nai_realm'] = [ "0,no.match.here;example.com;no.match.here.either,21[2:1][5:7]",
+ "0,example.com,13[5:6],21[2:4][5:7]",
+ "0,another.example.com" ]
+ hostapd.add_ap(apdev[0], params)
+
+ dev[0].hs20_enable()
+
+ id = dev[0].add_cred_values({ 'realm': "example.com",
+ 'username': "test",
+ 'password': "secret",
+ 'domain': "example.com",
+ 'eap': 'TTLS' })
+
+ dev[0].scan_for_bss(bssid, freq="2412")
+
+ funcs = [ "wpabuf_alloc;interworking_anqp_send_req",
+ "anqp_build_req;interworking_anqp_send_req",
+ "gas_query_req;interworking_anqp_send_req",
+ "dup_binstr;nai_realm_parse_realm",
+ "=nai_realm_parse_realm",
+ "=nai_realm_parse",
+ "=nai_realm_match" ]
+ for func in funcs:
+ with alloc_fail(dev[0], 1, func):
+ dev[0].request("INTERWORKING_SELECT auto freq=2412")
+ ev = dev[0].wait_event(["Starting ANQP"], timeout=5)
+ if ev is None:
+ raise Exception("ANQP did not start")
+ wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")