Browse Source

tests: Increase connection timeouts for remote tests

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>
Jonathan Afek 8 years ago
parent
commit
67a0d4f94e
1 changed files with 6 additions and 2 deletions
  1. 6 2
      tests/hwsim/wpasupplicant.py

+ 6 - 2
tests/hwsim/wpasupplicant.py

@@ -405,7 +405,9 @@ class WpaSupplicant:
             raise Exception("MESH_GROUP_REMOVE failed")
             raise Exception("MESH_GROUP_REMOVE failed")
         return None
         return None
 
 
-    def connect_network(self, id, timeout=10):
+    def connect_network(self, id, timeout=None):
+        if timeout is None:
+            timeout = 10 if self.hostname is None else 60
         self.dump_monitor()
         self.dump_monitor()
         self.select_network(id)
         self.select_network(id)
         self.wait_connected(timeout=timeout)
         self.wait_connected(timeout=timeout)
@@ -1239,7 +1241,9 @@ class WpaSupplicant:
             raise Exception(error)
             raise Exception(error)
         return ev
         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:
+            timeout = 10 if self.hostname is None else 30
         ev = self.wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=timeout)
         ev = self.wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=timeout)
         if ev is None:
         if ev is None:
             raise Exception(error)
             raise Exception(error)