mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 03:23:04 -05:00
tests: Speed up hostapd_oom_loop tests
At some point, these hostapd_oom_* test cases started to fail with wpa_msg() allocation failure for the AP-ENABLED event. This resulted in unnecessary long test execution (waiting 30 seconds for an event that was dropped). Speed this up by using a shorter timeout. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
35d2e24bc7
commit
57ff37d0e8
@ -275,7 +275,7 @@ class Hostapd:
|
|||||||
vals[name_val[0]] = name_val[1]
|
vals[name_val[0]] = name_val[1]
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
def add_ap(ifname, params, wait_enabled=True, no_enable=False):
|
def add_ap(ifname, params, wait_enabled=True, no_enable=False, timeout=30):
|
||||||
logger.info("Starting AP " + ifname)
|
logger.info("Starting AP " + ifname)
|
||||||
hapd_global = HostapdGlobal()
|
hapd_global = HostapdGlobal()
|
||||||
hapd_global.remove(ifname)
|
hapd_global.remove(ifname)
|
||||||
@ -303,7 +303,7 @@ def add_ap(ifname, params, wait_enabled=True, no_enable=False):
|
|||||||
return hapd
|
return hapd
|
||||||
hapd.enable()
|
hapd.enable()
|
||||||
if wait_enabled:
|
if wait_enabled:
|
||||||
ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=30)
|
ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=timeout)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("AP startup timed out")
|
raise Exception("AP startup timed out")
|
||||||
if "AP-ENABLED" not in ev:
|
if "AP-ENABLED" not in ev:
|
||||||
|
@ -20,7 +20,7 @@ def hostapd_oom_loop(apdev, params, start_func="main"):
|
|||||||
if "OK" not in hapd.request("TEST_ALLOC_FAIL %d:%s" % (i, start_func)):
|
if "OK" not in hapd.request("TEST_ALLOC_FAIL %d:%s" % (i, start_func)):
|
||||||
raise HwsimSkip("TEST_ALLOC_FAIL not supported")
|
raise HwsimSkip("TEST_ALLOC_FAIL not supported")
|
||||||
try:
|
try:
|
||||||
hostapd.add_ap(apdev[1]['ifname'], params)
|
hostapd.add_ap(apdev[1]['ifname'], params, timeout=2.5)
|
||||||
logger.info("Iteration %d - success" % i)
|
logger.info("Iteration %d - success" % i)
|
||||||
hapd_global.remove(apdev[1]['ifname'])
|
hapd_global.remove(apdev[1]['ifname'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user