about summary refs log tree commit diff
path: root/shared/nm-test-utils-impl.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-07-31 10:51:42 +0200
committerMichael Biebl <biebl@debian.org>2019-07-31 10:51:42 +0200
commit2e5fa45ddfbb5cffa1e78221f1cea706e2f298af (patch)
tree86f69d36c56de3074280456eddc854a780b8e04b /shared/nm-test-utils-impl.c
parent85563b7fc7ec2cd21e38debb9b28db342e2e8e7c (diff)
New upstream version 1.19.90 upstream/1.19.90
Diffstat (limited to 'shared/nm-test-utils-impl.c')
-rw-r--r--shared/nm-test-utils-impl.c140
1 files changed, 0 insertions, 140 deletions
diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c
index 02d71593..eca037ba 100644
--- a/shared/nm-test-utils-impl.c
+++ b/shared/nm-test-utils-impl.c
@@ -1,4 +1,3 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -56,24 +55,6 @@ name_exists (GDBusConnection *c, const char *name)
 	return exists;
 }
 
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-static DBusGProxy *
-_libdbus_create_proxy_test (DBusGConnection *bus)
-{
-	DBusGProxy *proxy;
-
-	proxy = dbus_g_proxy_new_for_name (bus,
-	                                   NM_DBUS_SERVICE,
-	                                   NM_DBUS_PATH,
-	                                   "org.freedesktop.NetworkManager.LibnmGlibTest");
-	g_assert (proxy);
-
-	dbus_g_proxy_set_default_timeout (proxy, G_MAXINT);
-
-	return proxy;
-}
-#endif
-
 typedef struct {
 	GMainLoop *mainloop;
 	GDBusConnection *bus;
@@ -201,11 +182,6 @@ nmtstc_service_init (void)
 	                                     NULL, &error);
 	g_assert_no_error (error);
 
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-	info->libdbus.bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-	g_assert_no_error (error);
-	g_assert (info->libdbus.bus);
-#endif
 	return info;
 }
 
@@ -223,10 +199,6 @@ nmtstc_service_cleanup (NMTstcServiceInfo *info)
 
 	g_clear_object (&info->proxy);
 
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-	g_clear_pointer (&info->libdbus.bus, dbus_g_connection_unref);
-#endif
-
 	if (info->pid != NM_PID_T_INVAL) {
 		kill (info->pid, SIGTERM);
 
@@ -255,7 +227,6 @@ again_wait:
 	g_free (info);
 }
 
-#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB)
 typedef struct {
 	GMainLoop *loop;
 	const char *ifname;
@@ -368,7 +339,6 @@ nmtstc_service_add_wired_device (NMTstcServiceInfo *sinfo, NMClient *client,
 {
 	return add_device_common (sinfo, client, "AddWiredDevice", ifname, hwaddr, subchannels);
 }
-#endif
 
 void
 nmtstc_service_add_connection (NMTstcServiceInfo *sinfo,
@@ -376,41 +346,10 @@ nmtstc_service_add_connection (NMTstcServiceInfo *sinfo,
                                gboolean verify_connection,
                                char **out_path)
 {
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-	gs_unref_hashtable GHashTable *new_settings = NULL;
-	gboolean success;
-	gs_free_error GError *error = NULL;
-	gs_free char *path = NULL;
-	gs_unref_object DBusGProxy *proxy = NULL;
-
-	g_assert (sinfo);
-	g_assert (NM_IS_CONNECTION (connection));
-
-	new_settings = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
-
-	proxy = _libdbus_create_proxy_test (sinfo->libdbus.bus);
-
-	success = dbus_g_proxy_call (proxy,
-	                             "AddConnection",
-	                             &error,
-	                             DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, new_settings,
-	                             G_TYPE_BOOLEAN, verify_connection,
-	                             G_TYPE_INVALID,
-	                             DBUS_TYPE_G_OBJECT_PATH, &path,
-	                             G_TYPE_INVALID);
-	g_assert_no_error (error);
-	g_assert (success);
-
-	g_assert (path && *path);
-
-	if (out_path)
-		*out_path = g_strdup (path);
-#else
 	nmtstc_service_add_connection_variant (sinfo,
 	                                       nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL),
 	                                       verify_connection,
 	                                       out_path);
-#endif
 }
 
 void
@@ -450,37 +389,10 @@ nmtstc_service_update_connection (NMTstcServiceInfo *sinfo,
 		path = nm_connection_get_path (connection);
 	g_assert (path);
 
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-	{
-		gs_unref_hashtable GHashTable *new_settings = NULL;
-		gboolean success;
-		gs_free_error GError *error = NULL;
-		gs_unref_object DBusGProxy *proxy = NULL;
-
-		g_assert (sinfo);
-		g_assert (NM_IS_CONNECTION (connection));
-
-		new_settings = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
-
-		proxy = _libdbus_create_proxy_test (sinfo->libdbus.bus);
-
-		success = dbus_g_proxy_call (proxy,
-		                             "UpdateConnection",
-		                             &error,
-		                             DBUS_TYPE_G_OBJECT_PATH, path,
-		                             DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, new_settings,
-		                             G_TYPE_BOOLEAN, verify_connection,
-		                             G_TYPE_INVALID,
-		                             G_TYPE_INVALID);
-		g_assert_no_error (error);
-		g_assert (success);
-	}
-#else
 	nmtstc_service_update_connection_variant (sinfo,
 	                                          path,
 	                                          nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL),
 	                                          verify_connection);
-#endif
 }
 
 void
@@ -508,55 +420,3 @@ nmtstc_service_update_connection_variant (NMTstcServiceInfo *sinfo,
 	g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE ("()")));
 	g_variant_unref (result);
 }
-
-/*****************************************************************************/
-
-#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
-NMClient *
-nmtstc_nm_client_new (void)
-{
-	NMClient *client;
-	DBusGConnection *bus;
-	GError *error = NULL;
-	gboolean success;
-
-	bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-	g_assert_no_error (error);
-	g_assert (bus);
-
-	client = g_object_new (NM_TYPE_CLIENT,
-	                       NM_OBJECT_DBUS_CONNECTION, bus,
-	                       NM_OBJECT_DBUS_PATH, NM_DBUS_PATH,
-	                       NULL);
-	g_assert (client != NULL);
-
-	dbus_g_connection_unref (bus);
-
-	success = g_initable_init (G_INITABLE (client), NULL, &error);
-	g_assert_no_error (error);
-	g_assert (success == TRUE);
-
-	return client;
-}
-
-NMRemoteSettings *
-nmtstc_nm_remote_settings_new (void)
-{
-	NMRemoteSettings *settings;
-	DBusGConnection *bus;
-	GError *error = NULL;
-
-	bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-	g_assert_no_error (error);
-	g_assert (bus);
-
-	settings = nm_remote_settings_new (bus);
-	g_assert (settings);
-
-	dbus_g_connection_unref (bus);
-
-	return settings;
-}
-#endif
-
-/*****************************************************************************/