From: Jouni Malinen Date: Sat, 7 Feb 2015 20:38:21 +0000 (+0200) Subject: tests: Make wpas_ctrl_many_networks more robust under valgrind X-Git-Tag: hostap_2_4~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=874057da4e11cf7a5e54e3360187d9342ea891a4;p=thirdparty%2Fhostap.git 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 --- diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index c3617f638..b2144f71b 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -238,6 +238,10 @@ def test_wpas_ctrl_many_networks(dev, apdev): res = dev[0].request("LIST_NETWORKS LAST_ID=%d" % (id - 2)) if str(id) not in res: 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): """wpa_supplicant ctrl_iface DUP_NETWORK""" diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index cbba8c645..0298e29ac 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -75,9 +75,9 @@ class WpaSupplicant: self.remove_ifname() self.global_request("INTERFACE_REMOVE " + ifname) - def request(self, cmd): + def request(self, cmd, timeout=10): logger.debug(self.ifname + ": CTRL: " + cmd) - return self.ctrl.request(cmd) + return self.ctrl.request(cmd, timeout=timeout) def global_request(self, cmd): if self.global_iface is None: