]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: FST AP setup failing due to OOM
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 9 Jun 2015 11:57:05 +0000 (14:57 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 16 Jul 2015 15:26:16 +0000 (18:26 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_fst_module.py

index 95b651e1e5b45a83299725c723196650bb248bc2..4d2b5241a7c11decc2162688bfbdf4d30b882e6f 100644 (file)
@@ -15,6 +15,7 @@ from hwsim import HWSimRadio
 import hostapd
 import fst_test_common
 import fst_module_aux
+from utils import alloc_fail
 
 #enum - bad parameter types
 bad_param_none = 0
@@ -1480,6 +1481,34 @@ def test_fst_ap_ctrl_iface(dev, apdev, test_params):
         fst_module_aux.disconnect_two_ap_sta_pairs(ap1, ap2, sta1, sta2)
         fst_module_aux.stop_two_ap_sta_pairs(ap1, ap2, sta1, sta2)
 
+def test_fst_ap_start_session_oom(dev, apdev, test_params):
+    """FST AP setup failing due to OOM"""
+    ap1 = fst_module_aux.FstAP(apdev[0]['ifname'], 'fst_11a', 'a',
+                               fst_test_common.fst_test_def_chan_a,
+                               fst_test_common.fst_test_def_group,
+                               fst_test_common.fst_test_def_prio_low,
+                               fst_test_common.fst_test_def_llt)
+    ap1.start()
+    with alloc_fail(ap1, 1, "fst_iface_create"):
+        ap2_started = False
+        try:
+            ap2 = fst_module_aux.FstAP(apdev[1]['ifname'], 'fst_11g', 'b',
+                                       fst_test_common.fst_test_def_chan_g,
+                                       fst_test_common.fst_test_def_group,
+                                       fst_test_common.fst_test_def_prio_high,
+                                       fst_test_common.fst_test_def_llt)
+            try:
+                # This will fail in fst_iface_create() OOM
+                ap2.start()
+            except:
+                pass
+        finally:
+            ap1.stop()
+            try:
+                ap2.stop()
+            except:
+                pass
+
 # STA side FST module tests
 
 def test_fst_sta_start_session(dev, apdev, test_params):