summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-11-13 17:17:06 -0500
committerDan Winship <danw@gnome.org>2014-11-14 15:36:31 -0500
commitd1faee92288831517f6f5f7baa057c790be3b022 (patch)
tree9b3a33b2cb636ef92036a87b16e079b9e4239bd7 /src/tests
parent529092f035680584e38f4fcfa8473876e9b7f86c (diff)
downloadNetworkManager-d1faee92288831517f6f5f7baa057c790be3b022.tar.gz
core: fix a spurious warning with non-kernel network devices
NMDevice was warning about not being able to set ifindex even on devices that we know don't have an ifindex. https://bugzilla.gnome.org/show_bug.cgi?id=739889
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/config/nm-test-device.c11
-rw-r--r--src/tests/config/test-config.c3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/tests/config/nm-test-device.c b/src/tests/config/nm-test-device.c
index 8f9c431cc2..63067b25f6 100644
--- a/src/tests/config/nm-test-device.c
+++ b/src/tests/config/nm-test-device.c
@@ -67,10 +67,17 @@ finalize (GObject *object)
g_object_class->finalize (object);
}
+static guint32
+get_generic_capabilities (NMDevice *device)
+{
+ return NM_DEVICE_CAP_IS_NON_KERNEL;
+}
+
static void
nm_test_device_class_init (NMTestDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
g_object_class = g_type_class_peek (G_TYPE_OBJECT);
@@ -78,13 +85,15 @@ nm_test_device_class_init (NMTestDeviceClass *klass)
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
+
+ device_class->get_generic_capabilities = get_generic_capabilities;
}
NMDevice *
nm_test_device_new (const char *hwaddr)
{
return g_object_new (NM_TYPE_TEST_DEVICE,
- NM_DEVICE_IFACE, "dummy:",
+ NM_DEVICE_IFACE, "dummy",
NM_DEVICE_HW_ADDRESS, hwaddr,
NULL);
}
diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c
index fff2d2a092..808fc670b3 100644
--- a/src/tests/config/test-config.c
+++ b/src/tests/config/test-config.c
@@ -26,6 +26,7 @@
#include <nm-config.h>
#include "nm-test-device.h"
+#include "nm-fake-platform.h"
static void
setup_config (const char *config_file, const char *config_dir, ...)
@@ -287,6 +288,8 @@ main (int argc, char **argv)
g_test_init (&argc, &argv, NULL);
+ nm_fake_platform_setup ();
+
g_test_add_func ("/config/simple", test_config_simple);
g_test_add_func ("/config/non-existent", test_config_non_existent);
g_test_add_func ("/config/parse-error", test_config_parse_error);