diff mbox

[v2,2/6] tests: Increase connection timeouts

Message ID 1468429565-16488-1-git-send-email-jonathan@wizery.com
State Accepted
Headers show

Commit Message

Jonathan Afek July 13, 2016, 5:06 p.m. UTC
Use increased timeouts for connect and disconnect since these
operations take a longer time on real harware than they do
on hwsim.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
---
 tests/hwsim/wpasupplicant.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Sept. 17, 2016, 7:49 p.m. UTC | #1
On Wed, Jul 13, 2016 at 08:06:03PM +0300, Jonathan Afek wrote:
> Use increased timeouts for connect and disconnect since these
> operations take a longer time on real harware than they do
> on hwsim.

Thanks, applied.
diff mbox

Patch

diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index ddcd6ef..383a2e7 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -405,7 +405,12 @@  class WpaSupplicant:
             raise Exception("MESH_GROUP_REMOVE failed")
         return None
 
-    def connect_network(self, id, timeout=10):
+    def connect_network(self, id, timeout=None):
+        if timeout is None:
+            if self.hostname is None:
+                timeout = 10
+            else:
+                timeout = 60
         self.dump_monitor()
         self.select_network(id)
         self.wait_connected(timeout=timeout)
@@ -1239,7 +1244,12 @@  class WpaSupplicant:
             raise Exception(error)
         return ev
 
-    def wait_disconnected(self, timeout=10, error="Disconnection timed out"):
+    def wait_disconnected(self, timeout=None, error="Disconnection timed out"):
+        if timeout is None:
+            if self.hostname is None:
+                timeout = 10
+            else:
+                timeout = 30
         ev = self.wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=timeout)
         if ev is None:
             raise Exception(error)