aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-03-26 20:51:32 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-26 20:53:58 (GMT)
commit07a1e904874a5c7e53273e5093265746516ef84f (patch)
treed72e99e6f524cc2ce7fda8350034358091cfc583
parent87faf1f22cbae40491278257ce575bfc22e84f4e (diff)
downloadhostap-07a1e904874a5c7e53273e5093265746516ef84f.zip
hostap-07a1e904874a5c7e53273e5093265746516ef84f.tar.gz
hostap-07a1e904874a5c7e53273e5093265746516ef84f.tar.bz2
tests: Fix FST cleanup if alloc_fail is not supported
The test cases fst_ap_start_session_oom and fst_setup_mbie_diff did not clean up FST sessions properly in case alloc_fail failed due to missing support for it in the build. This could result in abandoning attached hostapd global control interface monitors and test case failures due to the global control interface socket running out of output buffer. Fix this by going through the cleanup steps even if alloc_fail raises HwsimSkip exception. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_fst_module.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/hwsim/test_fst_module.py b/tests/hwsim/test_fst_module.py
index 971dded..6f83812 100644
--- a/tests/hwsim/test_fst_module.py
+++ b/tests/hwsim/test_fst_module.py
@@ -1527,6 +1527,12 @@ def test_fst_ap_start_session_oom(dev, apdev, test_params):
fst_test_common.fst_test_def_prio_low,
fst_test_common.fst_test_def_llt)
ap1.start()
+ try:
+ run_fst_ap_start_session_oom(apdev, ap1)
+ finally:
+ ap1.stop()
+
+def run_fst_ap_start_session_oom(apdev, ap1):
with alloc_fail(ap1, 1, "fst_iface_create"):
ap2_started = False
try:
@@ -1541,7 +1547,6 @@ def test_fst_ap_start_session_oom(dev, apdev, test_params):
except:
pass
finally:
- ap1.stop()
try:
ap2.stop()
except:
@@ -2534,9 +2539,13 @@ def _test_fst_setup_mbie_diff(dev, apdev, test_params):
req = "1200011a060000"
stie = "a40b0100000000020001040001"
mbie = "9e16040200010200000004000000000000000000000000ff"
- with alloc_fail(hapd, 1, "mb_ies_by_info"):
- fst_setup_req(wpas, hglobal, 5180, apdev[0]['bssid'], req, stie, mbie,
- no_wait=True)
+ try:
+ with alloc_fail(hapd, 1, "mb_ies_by_info"):
+ fst_setup_req(wpas, hglobal, 5180, apdev[0]['bssid'], req, stie,
+ mbie, no_wait=True)
+ except HwsimSkip, e:
+ # Skip exception to allow proper cleanup
+ pass
# Remove sessions to avoid causing issues to following test ases
s = hglobal.request("FST-MANAGER LIST_SESSIONS " + group)