about summary refs log tree commit diff
path: root/debian/tests/nm.py
diff options
context:
space:
mode:
authorTill Kamppeter <till.kamppeter@gmail.com>2019-07-02 11:54:00 +0200
committerTill Kamppeter <till.kamppeter@gmail.com>2019-07-02 11:54:00 +0200
commitb47c1b22b9619990d6b1669d76d0cd01452bf5d7 (patch)
treea274a1a284c816ed048fe921e90394c27748ad96 /debian/tests/nm.py
parent993f02a7e2b95a324c89ec797613a8470eaee699 (diff)
nm.py autopkgtest: Added timers to make the main loops time out if the asynchronous processes do not finish.
Diffstat (limited to 'debian/tests/nm.py')
-rwxr-xr-xdebian/tests/nm.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/debian/tests/nm.py b/debian/tests/nm.py
index 5037daa7..ab3571d3 100755
--- a/debian/tests/nm.py
+++ b/debian/tests/nm.py
@@ -274,8 +274,16 @@ class NetworkManagerTest(network_test_base.NetworkTestBase):
         def add_activate_cb(client, res, data):
             self.cb_conn = self.nmclient.add_and_activate_connection_finish(res)
             ml.quit()
+
+        def timeout_cb():
+            print("Main loop timed out!")
+            ml.quit()
+            return False
+
         self.nmclient.add_and_activate_connection_async(partial_conn, self.nmdev_w, ap.get_path(), None, add_activate_cb, None)
+        timeout_tag = GLib.timeout_add_seconds(300, timeout_cb)
         ml.run()
+        GLib.source_remove(timeout_tag)
         self.assertNotEqual(self.cb_conn, None)
         active_conn = self.cb_conn
         self.cb_conn = None
@@ -674,8 +682,16 @@ Logs are in '%s'. When done, exit the shell.
             def add_activate_cb(client, res, data):
                 self.cb_conn = self.nmclient.add_and_activate_connection_finish(res)
                 ml.quit()
+
+            def timeout_cb():
+                print("Main loop timed out!")
+                ml.quit()
+                return False
+
             self.nmclient.add_and_activate_connection_async(partial_conn, self.nmdev_e, None, None, add_activate_cb, None)
+            timeout_tag = GLib.timeout_add_seconds(300, timeout_cb)
             ml.run()
+            GLib.source_remove(timeout_tag)
             self.assertNotEqual(self.cb_conn, None)
             active_conn = self.cb_conn
             self.cb_conn = None