]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make wpas_ctrl_many_networks more robust under valgrind
authorJouni Malinen <j@w1.fi>
Sat, 7 Feb 2015 20:38:21 +0000 (22:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 8 Feb 2015 11:25:35 +0000 (13:25 +0200)
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>
tests/hwsim/test_wpas_ctrl.py
tests/hwsim/wpasupplicant.py

index c3617f6386c5da4f352c69b678fa56b78664b852..b2144f71b966269b4b9ea190c60822930247eb64 100644 (file)
@@ -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"""
index cbba8c6451c8cc9158a16872ac33726a7689f698..0298e29acdf9a6732a39085a0ad8cf0815024a04 100644 (file)
@@ -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: