tests: Make wpas_ctrl_many_networks more robust under valgrind

It is possible for a low powered CPU to take excessively long time to
delete 1000 network blocks when running under valgrind. This would have
resulted in the test case failing and the following reset operation
timing out which would then stop the test sequence completely.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-02-07 22:38:21 +02:00
parent f77d6d4bd8
commit 874057da4e
2 changed files with 6 additions and 2 deletions

View file

@ -238,6 +238,10 @@ def test_wpas_ctrl_many_networks(dev, apdev):
res = dev[0].request("LIST_NETWORKS LAST_ID=%d" % (id - 2)) res = dev[0].request("LIST_NETWORKS LAST_ID=%d" % (id - 2))
if str(id) not in res: if str(id) not in res:
raise Exception("Last added network was not present when using LAST_ID") raise Exception("Last added network was not present when using LAST_ID")
# This command can take a very long time under valgrind testing on a low
# power CPU, so increase the command timeout significantly to avoid issues
# with the test case failing and following reset operation timing out.
dev[0].request("REMOVE_NETWORK all", timeout=60)
def test_wpas_ctrl_dup_network(dev, apdev): def test_wpas_ctrl_dup_network(dev, apdev):
"""wpa_supplicant ctrl_iface DUP_NETWORK""" """wpa_supplicant ctrl_iface DUP_NETWORK"""

View file

@ -75,9 +75,9 @@ class WpaSupplicant:
self.remove_ifname() self.remove_ifname()
self.global_request("INTERFACE_REMOVE " + ifname) self.global_request("INTERFACE_REMOVE " + ifname)
def request(self, cmd): def request(self, cmd, timeout=10):
logger.debug(self.ifname + ": CTRL: " + cmd) logger.debug(self.ifname + ": CTRL: " + cmd)
return self.ctrl.request(cmd) return self.ctrl.request(cmd, timeout=timeout)
def global_request(self, cmd): def global_request(self, cmd):
if self.global_iface is None: if self.global_iface is None: