[gnome-control-center/benzea/reenable-tests] tests: Add some NM test server debug printing



commit b969ca8b975a71abb4ec482112dcb3403073dde3
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Jan 20 16:23:04 2022 +0100

    tests: Add some NM test server debug printing

 tests/network/nm-utils/nm-test-utils-impl.c           | 3 +++
 tests/network/nm-utils/test-networkmanager-service.py | 6 ++++++
 2 files changed, 9 insertions(+)
---
diff --git a/tests/network/nm-utils/nm-test-utils-impl.c b/tests/network/nm-utils/nm-test-utils-impl.c
index 998d792a2..b40dc7139 100644
--- a/tests/network/nm-utils/nm-test-utils-impl.c
+++ b/tests/network/nm-utils/nm-test-utils-impl.c
@@ -89,6 +89,7 @@ nmtstc_service_init (void)
         * stdin; if it closes, the service will exit immediately. We use this to
         * make sure the service exits if the test program crashes.
         */
+       g_message("Starting test service, %ld", g_get_real_time ());
        g_spawn_async_with_pipes (NULL, (char **) args, NULL,
                                  G_SPAWN_SEARCH_PATH,
                                  NULL, NULL,
@@ -103,6 +104,8 @@ nmtstc_service_init (void)
        }
        g_assert (i > 0);
 
+       g_message("Test service is now on bus (i: %d)", i);
+
        /* Grab a proxy to our fake NM service to trigger tests */
        info->proxy = g_dbus_proxy_new_sync (info->bus,
                                             G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
diff --git a/tests/network/nm-utils/test-networkmanager-service.py 
b/tests/network/nm-utils/test-networkmanager-service.py
index a5984ad78..798bb77fc 100755
--- a/tests/network/nm-utils/test-networkmanager-service.py
+++ b/tests/network/nm-utils/test-networkmanager-service.py
@@ -1404,12 +1404,16 @@ class DnsManager(ExportedObj):
 
 ###################################################################
 def stdin_cb(io, condition):
+    print("quitting because stdin got condition: %d", condition)
     mainloop.quit()
 
 def quit_cb(user_data):
+    print("quitting after 20s")
     mainloop.quit()
 
 def main():
+    import time
+    print("test-networkmanager-service.py", time.time())
     dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
     random.seed()
@@ -1434,10 +1438,12 @@ def main():
     GLib.timeout_add_seconds(20, quit_cb, None)
 
     try:
+        print("test-networkmanager-service.py entered mainloop", time.time())
         mainloop.run()
     except Exception as e:
         pass
 
+    print("test-networkmanager-service.py exiting", time.time())
     sys.exit(0)
 
 if __name__ == '__main__':


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]