about summary refs log tree commit diff
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
committerMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
commit7514efc2f38c9ace4557d4e69d68e7d380389030 (patch)
tree7fb00fda86cfcc2ca377f191633a7cfdbfea7ca3 /src/tests
parentd6201f5d8daada3d64a0a3e0038e14eebec683ce (diff)
Imported Upstream version 1.4.0 upstream/1.4.0
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/Makefile.am12
-rw-r--r--src/tests/Makefile.in31
-rw-r--r--src/tests/config/Makefile.am7
-rw-r--r--src/tests/config/Makefile.in24
-rw-r--r--src/tests/config/NetworkManager.state4
-rw-r--r--src/tests/config/nm-test-device.c14
-rw-r--r--src/tests/config/nm-test-device.h6
-rw-r--r--src/tests/config/test-config.c63
-rw-r--r--src/tests/test-dcb.c2
-rw-r--r--src/tests/test-general-with-expect.c2
-rw-r--r--src/tests/test-general.c2
-rw-r--r--src/tests/test-ip4-config.c42
-rw-r--r--src/tests/test-ip6-config.c42
-rw-r--r--src/tests/test-resolvconf-capture.c2
-rw-r--r--src/tests/test-route-manager.c101
-rw-r--r--src/tests/test-systemd.c56
-rw-r--r--src/tests/test-utils.c83
-rw-r--r--src/tests/test-wired-defname.c26
18 files changed, 371 insertions, 148 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index e1734b6d..8851c242 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,5 +1,7 @@
 SUBDIRS = config
 
+@GNOME_CODE_COVERAGE_RULES@
+
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/shared \
 	-I$(top_builddir)/shared \
@@ -12,7 +14,10 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	$(GLIB_CFLAGS)
+	$(GLIB_CFLAGS) \
+	$(CODE_COVERAGE_CFLAGS)
+
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
 
 noinst_PROGRAMS = \
 	test-general \
@@ -47,6 +52,7 @@ test_ip6_config_LDADD = \
 
 test_route_manager_fake_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
+	$(GUDEV_CFLAGS) \
 	-I$(top_srcdir)/src/platform/tests \
 	-DSETUP=nm_fake_platform_setup \
 	-DKERNEL_HACKS=0
@@ -56,7 +62,7 @@ test_route_manager_fake_SOURCES = \
 	test-route-manager.c
 
 test_route_manager_fake_LDADD = \
-	$(top_builddir)/src/libNetworkManager.la
+	$(top_builddir)/src/libNetworkManagerTest.la
 
 test_route_manager_linux_SOURCES = \
 	$(top_srcdir)/src/platform/tests/test-common.c \
@@ -64,6 +70,7 @@ test_route_manager_linux_SOURCES = \
 
 test_route_manager_linux_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
+	$(GUDEV_CFLAGS) \
 	-I$(top_srcdir)/src/platform/tests \
 	-DSETUP=nm_linux_platform_setup \
 	-DKERNEL_HACKS=1
@@ -123,7 +130,6 @@ test_systemd_SOURCES = \
 	test-systemd.c
 
 test_systemd_LDADD = \
-	$(top_builddir)/src/libNetworkManager-base.la \
 	$(top_builddir)/src/libsystemd-nm.la
 
 ####### utils test #######
diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in
index 2296c2b0..a4ca2212 100644
--- a/src/tests/Makefile.in
+++ b/src/tests/Makefile.in
@@ -102,8 +102,9 @@ TESTS = test-ip4-config$(EXEEXT) test-ip6-config$(EXEEXT) \
 	test-wired-defname$(EXEEXT) test-utils$(EXEEXT)
 subdir = src/tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \
-	$(top_srcdir)/m4/compiler_warnings.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
+	$(top_srcdir)/m4/compiler_options.m4 \
 	$(top_srcdir)/m4/gettext.m4 \
 	$(top_srcdir)/m4/gnome-code-coverage.m4 \
 	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
@@ -159,7 +160,7 @@ am_test_route_manager_fake_OBJECTS =  \
 test_route_manager_fake_OBJECTS =  \
 	$(am_test_route_manager_fake_OBJECTS)
 test_route_manager_fake_DEPENDENCIES =  \
-	$(top_builddir)/src/libNetworkManager.la
+	$(top_builddir)/src/libNetworkManagerTest.la
 am_test_route_manager_linux_OBJECTS =  \
 	test_route_manager_linux-test-common.$(OBJEXT) \
 	test_route_manager_linux-test-route-manager.$(OBJEXT)
@@ -169,9 +170,7 @@ test_route_manager_linux_DEPENDENCIES =  \
 	$(top_builddir)/src/libNetworkManager.la
 am_test_systemd_OBJECTS = test_systemd-test-systemd.$(OBJEXT)
 test_systemd_OBJECTS = $(am_test_systemd_OBJECTS)
-test_systemd_DEPENDENCIES =  \
-	$(top_builddir)/src/libNetworkManager-base.la \
-	$(top_builddir)/src/libsystemd-nm.la
+test_systemd_DEPENDENCIES = $(top_builddir)/src/libsystemd-nm.la
 test_systemd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_systemd_CFLAGS) \
 	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@@ -533,6 +532,7 @@ DHCLIENT_PATH = @DHCLIENT_PATH@
 DHCPCD_PATH = @DHCPCD_PATH@
 DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@
 DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
 DNSMASQ_PATH = @DNSMASQ_PATH@
 DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@
 DSYMUTIL = @DSYMUTIL@
@@ -589,13 +589,14 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
 INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
 INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 IPTABLES_PATH = @IPTABLES_PATH@
+JANSSON_CFLAGS = @JANSSON_CFLAGS@
+JANSSON_LIBS = @JANSSON_LIBS@
 KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@
 LCOV = @LCOV@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@
 LIBAUDIT_LIBS = @LIBAUDIT_LIBS@
-LIBDL = @LIBDL@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM = @LIBM@
@@ -607,6 +608,8 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
 LIBSOUP_LIBS = @LIBSOUP_LIBS@
+LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
+LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
 LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@
 LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@
 LIBTOOL = @LIBTOOL@
@@ -667,6 +670,8 @@ QT_CFLAGS = @QT_CFLAGS@
 QT_LIBS = @QT_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+SANITIZERS = @SANITIZERS@
+SANITIZER_ENV = @SANITIZER_ENV@
 SED = @SED@
 SELINUX_CFLAGS = @SELINUX_CFLAGS@
 SELINUX_LIBS = @SELINUX_LIBS@
@@ -702,6 +707,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_RANLIB = @ac_ct_RANLIB@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -776,8 +782,10 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	$(GLIB_CFLAGS)
+	$(GLIB_CFLAGS) \
+	$(CODE_COVERAGE_CFLAGS)
 
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
 
 ####### ip4 config test #######
 test_ip4_config_SOURCES = \
@@ -798,6 +806,7 @@ test_ip6_config_LDADD = \
 ####### route manager test #######
 test_route_manager_fake_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
+	$(GUDEV_CFLAGS) \
 	-I$(top_srcdir)/src/platform/tests \
 	-DSETUP=nm_fake_platform_setup \
 	-DKERNEL_HACKS=0
@@ -807,7 +816,7 @@ test_route_manager_fake_SOURCES = \
 	test-route-manager.c
 
 test_route_manager_fake_LDADD = \
-	$(top_builddir)/src/libNetworkManager.la
+	$(top_builddir)/src/libNetworkManagerTest.la
 
 test_route_manager_linux_SOURCES = \
 	$(top_srcdir)/src/platform/tests/test-common.c \
@@ -815,6 +824,7 @@ test_route_manager_linux_SOURCES = \
 
 test_route_manager_linux_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
+	$(GUDEV_CFLAGS) \
 	-I$(top_srcdir)/src/platform/tests \
 	-DSETUP=nm_linux_platform_setup \
 	-DKERNEL_HACKS=1
@@ -874,7 +884,6 @@ test_systemd_SOURCES = \
 	test-systemd.c
 
 test_systemd_LDADD = \
-	$(top_builddir)/src/libNetworkManager-base.la \
 	$(top_builddir)/src/libsystemd-nm.la
 
 
@@ -1633,6 +1642,8 @@ uninstall-am:
 .PRECIOUS: Makefile
 
 
+@GNOME_CODE_COVERAGE_RULES@
+
 ###########################################
 
 @VALGRIND_RULES@
diff --git a/src/tests/config/Makefile.am b/src/tests/config/Makefile.am
index 17876e4d..d0cb797d 100644
--- a/src/tests/config/Makefile.am
+++ b/src/tests/config/Makefile.am
@@ -9,8 +9,8 @@ AM_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
 	$(GLIB_CFLAGS) \
-	-DSRCDIR=\""$(srcdir)"\" \
-	-DBUILDDIR=\""$(builddir)"\"
+	-DSRCDIR=\""$(abs_srcdir)"\" \
+	-DBUILDDIR=\""$(abs_builddir)"\"
 
 noinst_PROGRAMS = \
 	test-config
@@ -21,13 +21,14 @@ test_config_SOURCES = \
 	test-config.c
 
 test_config_LDADD = \
-	$(top_builddir)/src/libNetworkManager.la
+	$(top_builddir)/src/libNetworkManagerTest.la
 
 @VALGRIND_RULES@
 TESTS = test-config
 
 EXTRA_DIST = \
 	NetworkManager.conf \
+	NetworkManager.state \
 	bad.conf \
 	global-dns-invalid.conf \
 	conf.d/00-overrides.conf \
diff --git a/src/tests/config/Makefile.in b/src/tests/config/Makefile.in
index 7197ee1f..89c18941 100644
--- a/src/tests/config/Makefile.in
+++ b/src/tests/config/Makefile.in
@@ -92,8 +92,9 @@ noinst_PROGRAMS = test-config$(EXEEXT)
 TESTS = test-config$(EXEEXT)
 subdir = src/tests/config
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \
-	$(top_srcdir)/m4/compiler_warnings.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
+	$(top_srcdir)/m4/compiler_options.m4 \
 	$(top_srcdir)/m4/gettext.m4 \
 	$(top_srcdir)/m4/gnome-code-coverage.m4 \
 	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
@@ -116,7 +117,8 @@ PROGRAMS = $(noinst_PROGRAMS)
 am_test_config_OBJECTS = nm-test-device.$(OBJEXT) \
 	test-config.$(OBJEXT)
 test_config_OBJECTS = $(am_test_config_OBJECTS)
-test_config_DEPENDENCIES = $(top_builddir)/src/libNetworkManager.la
+test_config_DEPENDENCIES =  \
+	$(top_builddir)/src/libNetworkManagerTest.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -422,6 +424,7 @@ DHCLIENT_PATH = @DHCLIENT_PATH@
 DHCPCD_PATH = @DHCPCD_PATH@
 DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@
 DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
 DNSMASQ_PATH = @DNSMASQ_PATH@
 DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@
 DSYMUTIL = @DSYMUTIL@
@@ -478,13 +481,14 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
 INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
 INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 IPTABLES_PATH = @IPTABLES_PATH@
+JANSSON_CFLAGS = @JANSSON_CFLAGS@
+JANSSON_LIBS = @JANSSON_LIBS@
 KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@
 LCOV = @LCOV@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@
 LIBAUDIT_LIBS = @LIBAUDIT_LIBS@
-LIBDL = @LIBDL@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM = @LIBM@
@@ -496,6 +500,8 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
 LIBSOUP_LIBS = @LIBSOUP_LIBS@
+LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
+LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
 LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@
 LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@
 LIBTOOL = @LIBTOOL@
@@ -556,6 +562,8 @@ QT_CFLAGS = @QT_CFLAGS@
 QT_LIBS = @QT_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+SANITIZERS = @SANITIZERS@
+SANITIZER_ENV = @SANITIZER_ENV@
 SED = @SED@
 SELINUX_CFLAGS = @SELINUX_CFLAGS@
 SELINUX_LIBS = @SELINUX_LIBS@
@@ -591,6 +599,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_RANLIB = @ac_ct_RANLIB@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -663,8 +672,8 @@ AM_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
 	$(GLIB_CFLAGS) \
-	-DSRCDIR=\""$(srcdir)"\" \
-	-DBUILDDIR=\""$(builddir)"\"
+	-DSRCDIR=\""$(abs_srcdir)"\" \
+	-DBUILDDIR=\""$(abs_builddir)"\"
 
 test_config_SOURCES = \
 	nm-test-device.c \
@@ -672,10 +681,11 @@ test_config_SOURCES = \
 	test-config.c
 
 test_config_LDADD = \
-	$(top_builddir)/src/libNetworkManager.la
+	$(top_builddir)/src/libNetworkManagerTest.la
 
 EXTRA_DIST = \
 	NetworkManager.conf \
+	NetworkManager.state \
 	bad.conf \
 	global-dns-invalid.conf \
 	conf.d/00-overrides.conf \
diff --git a/src/tests/config/NetworkManager.state b/src/tests/config/NetworkManager.state
new file mode 100644
index 00000000..1b9d604a
--- /dev/null
+++ b/src/tests/config/NetworkManager.state
@@ -0,0 +1,4 @@
+[main]
+NetworkingEnabled=true
+WirelessEnabled=true
+WWANEnabled=true
diff --git a/src/tests/config/nm-test-device.c b/src/tests/config/nm-test-device.c
index 04ccaec2..1ae964ee 100644
--- a/src/tests/config/nm-test-device.c
+++ b/src/tests/config/nm-test-device.c
@@ -38,17 +38,6 @@ nm_test_device_init (NMTestDevice *self)
 /* We jump over NMDevice's construct/destruct methods, which require NMPlatform
  * and NMConnectionProvider to be initialized.
  */
-
-static GObject*
-constructor (GType type,
-             guint n_construct_params,
-             GObjectConstructParam *construct_params)
-{
-	return PARENT_CLASS->constructor (type,
-	                                  n_construct_params,
-	                                  construct_params);
-}
-
 static void
 constructed (GObject *object)
 {
@@ -73,7 +62,6 @@ nm_test_device_class_init (NMTestDeviceClass *klass)
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
 
-	object_class->constructor = constructor;
 	object_class->constructed = constructed;
 	object_class->dispose = dispose;
 
@@ -85,6 +73,6 @@ nm_test_device_new (const char *hwaddr)
 {
 	return g_object_new (NM_TYPE_TEST_DEVICE,
 	                     NM_DEVICE_IFACE, "dummy",
-	                     NM_DEVICE_HW_ADDRESS, hwaddr,
+	                     NM_DEVICE_PERM_HW_ADDRESS, hwaddr,
 	                     NULL);
 }
diff --git a/src/tests/config/nm-test-device.h b/src/tests/config/nm-test-device.h
index c3532c9c..dfb8ff78 100644
--- a/src/tests/config/nm-test-device.h
+++ b/src/tests/config/nm-test-device.h
@@ -23,8 +23,6 @@
 
 #include "nm-device.h"
 
-G_BEGIN_DECLS
-
 #define NM_TYPE_TEST_DEVICE            (nm_test_device_get_type ())
 #define NM_TEST_DEVICE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_TEST_DEVICE, NMTestDevice))
 #define NM_TEST_DEVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  NM_TYPE_TEST_DEVICE, NMTestDeviceClass))
@@ -45,6 +43,4 @@ GType nm_test_device_get_type (void);
 
 NMDevice *nm_test_device_new (const char *hwaddr);
 
-G_END_DECLS
-
-#endif	/* NM_DEVICE_H */
+#endif /* __NETWORKMANAGER_TEST_DEVICE_H__ */
diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c
index b6d88edf..73358d02 100644
--- a/src/tests/config/test-config.c
+++ b/src/tests/config/test-config.c
@@ -27,7 +27,7 @@
 #include "nm-fake-platform.h"
 #include "nm-bus-manager.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 /********************************************************************************/
 
@@ -930,6 +930,65 @@ test_config_enable (void)
 
 /*****************************************************************************/
 
+static void
+test_config_state_file (void)
+{
+	NMConfig *config;
+	const NMConfigState *state;
+	gs_free_error GError *error = NULL;
+	gboolean ret;
+	gs_free char *file_data = NULL;
+	gsize file_size;
+	const char *const TMP_FILE = BUILDDIR "/tmp.state";
+
+	ret = g_file_get_contents (SRCDIR "/NetworkManager.state", &file_data, &file_size, &error);
+	nmtst_assert_success (ret, error);
+	ret = g_file_set_contents (TMP_FILE, file_data, file_size, &error);
+	nmtst_assert_success (ret, error);
+
+	config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "",
+	                       "--state-file", TMP_FILE, NULL);
+	g_assert (config);
+
+	state = nm_config_state_get (config);
+	g_assert (state);
+
+	g_assert_cmpint (state->net_enabled, ==, TRUE);
+	g_assert_cmpint (state->wifi_enabled, ==, TRUE);
+	g_assert_cmpint (state->wwan_enabled, ==, TRUE);
+
+	nm_config_state_set (config, TRUE, TRUE,
+	                     NM_CONFIG_STATE_PROPERTY_NETWORKING_ENABLED, FALSE,
+	                     NM_CONFIG_STATE_PROPERTY_WIFI_ENABLED, TRUE,
+	                     NM_CONFIG_STATE_PROPERTY_WWAN_ENABLED, FALSE);
+
+	state = nm_config_state_get (config);
+	g_assert (state);
+
+	g_assert_cmpint (state->net_enabled, ==, FALSE);
+	g_assert_cmpint (state->wifi_enabled, ==, TRUE);
+	g_assert_cmpint (state->wwan_enabled, ==, FALSE);
+
+	g_object_unref (config);
+
+	/* Reload configuration */
+	config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "",
+	                       "--state-file", TMP_FILE, NULL);
+	g_assert (config);
+
+	state = nm_config_state_get (config);
+	g_assert (state);
+
+	g_assert_cmpint (state->net_enabled, ==, FALSE);
+	g_assert_cmpint (state->wifi_enabled, ==, TRUE);
+	g_assert_cmpint (state->wwan_enabled, ==, FALSE);
+
+	g_object_unref (config);
+	unlink (TMP_FILE);
+}
+
+/*****************************************************************************/
+
 NMTST_DEFINE ();
 
 int
@@ -960,6 +1019,8 @@ main (int argc, char **argv)
 
 	g_test_add_func ("/config/enable", test_config_enable);
 
+	g_test_add_func ("/config/state-file", test_config_state_file);
+
 	/* This one has to come last, because it leaves its values in
 	 * nm-config.c's global variables, and there's no way to reset
 	 * those to NULL.
diff --git a/src/tests/test-dcb.c b/src/tests/test-dcb.c
index e8e1ec86..0a133de3 100644
--- a/src/tests/test-dcb.c
+++ b/src/tests/test-dcb.c
@@ -24,7 +24,7 @@
 
 #include "nm-dcb.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 typedef struct {
 	guint num;
diff --git a/src/tests/test-general-with-expect.c b/src/tests/test-general-with-expect.c
index 64b47bd3..ab2b15b5 100644
--- a/src/tests/test-general-with-expect.c
+++ b/src/tests/test-general-with-expect.c
@@ -30,7 +30,7 @@
 #include "NetworkManagerUtils.h"
 #include "nm-multi-index.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 #ifndef CLOCK_BOOTTIME
 #define CLOCK_BOOTTIME 7
diff --git a/src/tests/test-general.c b/src/tests/test-general.c
index f714deec..9769ead1 100644
--- a/src/tests/test-general.c
+++ b/src/tests/test-general.c
@@ -26,7 +26,7 @@
 #include "NetworkManagerUtils.h"
 #include "nm-core-internal.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 /* Reference implementation for nm_utils_ip6_address_clear_host_address.
  * Taken originally from set_address_masked(), src/rdisc/nm-lndp-rdisc.c
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index 9d38dc27..95b221bc 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -26,7 +26,7 @@
 #include "nm-ip4-config.h"
 #include "nm-platform.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 static NMIP4Config *
 build_test_config (void)
@@ -161,18 +161,18 @@ test_compare_with_source (void)
 
 	/* Address */
 	addr = *nmtst_platform_ip4_address ("1.2.3.4", NULL, 24);
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_address (a, &addr);
 
-	addr.source = NM_IP_CONFIG_SOURCE_VPN;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip4_config_add_address (b, &addr);
 
 	/* Route */
 	route = *nmtst_platform_ip4_route ("10.0.0.0", 8, "192.168.1.1");
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_route (a, &route);
 
-	route.source = NM_IP_CONFIG_SOURCE_VPN;
+	route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip4_config_add_route (b, &route);
 
 	/* Assert that the configs are basically the same, eg that the source is ignored */
@@ -193,31 +193,31 @@ test_add_address_with_source (void)
 
 	/* Test that a higher priority source is not overwritten */
 	addr = *nmtst_platform_ip4_address ("1.2.3.4", NULL, 24);
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_address (a, &addr);
 
 	test_addr = nm_ip4_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
-	addr.source = NM_IP_CONFIG_SOURCE_VPN;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip4_config_add_address (a, &addr);
 
 	test_addr = nm_ip4_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	/* Test that a lower priority address source is overwritten */
 	nm_ip4_config_del_address (a, 0);
-	addr.source = NM_IP_CONFIG_SOURCE_KERNEL;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_KERNEL;
 	nm_ip4_config_add_address (a, &addr);
 
 	test_addr = nm_ip4_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
 
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_address (a, &addr);
 
 	test_addr = nm_ip4_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	g_object_unref (a);
 }
@@ -233,31 +233,31 @@ test_add_route_with_source (void)
 
 	/* Test that a higher priority source is not overwritten */
 	route = *nmtst_platform_ip4_route ("1.2.3.4", 24, "1.2.3.1");
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_route (a, &route);
 
 	test_route = nm_ip4_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
-	route.source = NM_IP_CONFIG_SOURCE_VPN;
+	route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip4_config_add_route (a, &route);
 
 	test_route = nm_ip4_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	/* Test that a lower priority address source is overwritten */
 	nm_ip4_config_del_route (a, 0);
-	route.source = NM_IP_CONFIG_SOURCE_KERNEL;
+	route.rt_source = NM_IP_CONFIG_SOURCE_KERNEL;
 	nm_ip4_config_add_route (a, &route);
 
 	test_route = nm_ip4_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip4_config_add_route (a, &route);
 
 	test_route = nm_ip4_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	g_object_unref (a);
 }
diff --git a/src/tests/test-ip6-config.c b/src/tests/test-ip6-config.c
index 5a2bb589..3eceec0c 100644
--- a/src/tests/test-ip6-config.c
+++ b/src/tests/test-ip6-config.c
@@ -26,7 +26,7 @@
 #include "nm-ip6-config.h"
 
 #include "nm-platform.h"
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 static NMIP6Config *
 build_test_config (void)
@@ -132,18 +132,18 @@ test_compare_with_source (void)
 
 	/* Address */
 	addr = *nmtst_platform_ip6_address ("1122:3344:5566::7788", NULL, 64);
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_address (a, &addr);
 
-	addr.source = NM_IP_CONFIG_SOURCE_VPN;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip6_config_add_address (b, &addr);
 
 	/* Route */
 	route = *nmtst_platform_ip6_route ("abcd:1234:4321::", 24, "abcd:1234:4321:cdde::2");
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_route (a, &route);
 
-	route.source = NM_IP_CONFIG_SOURCE_VPN;
+	route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip6_config_add_route (b, &route);
 
 	/* Assert that the configs are basically the same, eg that the source is ignored */
@@ -164,31 +164,31 @@ test_add_address_with_source (void)
 
 	/* Test that a higher priority source is not overwritten */
 	addr = *nmtst_platform_ip6_address ("1122:3344:5566::7788", NULL, 64);
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_address (a, &addr);
 
 	test_addr = nm_ip6_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
-	addr.source = NM_IP_CONFIG_SOURCE_VPN;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip6_config_add_address (a, &addr);
 
 	test_addr = nm_ip6_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	/* Test that a lower priority address source is overwritten */
 	nm_ip6_config_del_address (a, 0);
-	addr.source = NM_IP_CONFIG_SOURCE_KERNEL;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_KERNEL;
 	nm_ip6_config_add_address (a, &addr);
 
 	test_addr = nm_ip6_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
 
-	addr.source = NM_IP_CONFIG_SOURCE_USER;
+	addr.addr_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_address (a, &addr);
 
 	test_addr = nm_ip6_config_get_address (a, 0);
-	g_assert_cmpint (test_addr->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_addr->addr_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	g_object_unref (a);
 }
@@ -204,31 +204,31 @@ test_add_route_with_source (void)
 
 	/* Test that a higher priority source is not overwritten */
 	route = *nmtst_platform_ip6_route ("abcd:1234:4321::", 24, "abcd:1234:4321:cdde::2");
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_route (a, &route);
 
 	test_route = nm_ip6_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
-	route.source = NM_IP_CONFIG_SOURCE_VPN;
+	route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
 	nm_ip6_config_add_route (a, &route);
 
 	test_route = nm_ip6_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	/* Test that a lower priority address source is overwritten */
 	nm_ip6_config_del_route (a, 0);
-	route.source = NM_IP_CONFIG_SOURCE_KERNEL;
+	route.rt_source = NM_IP_CONFIG_SOURCE_KERNEL;
 	nm_ip6_config_add_route (a, &route);
 
 	test_route = nm_ip6_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = NM_IP_CONFIG_SOURCE_USER;
 	nm_ip6_config_add_route (a, &route);
 
 	test_route = nm_ip6_config_get_route (a, 0);
-	g_assert_cmpint (test_route->source, ==, NM_IP_CONFIG_SOURCE_USER);
+	g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
 
 	g_object_unref (a);
 }
diff --git a/src/tests/test-resolvconf-capture.c b/src/tests/test-resolvconf-capture.c
index 31b6e177..32bc9734 100644
--- a/src/tests/test-resolvconf-capture.c
+++ b/src/tests/test-resolvconf-capture.c
@@ -28,7 +28,7 @@
 #include "nm-ip6-config.h"
 #include "nm-platform.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 static void
 test_capture_empty (void)
diff --git a/src/tests/test-route-manager.c b/src/tests/test-route-manager.c
index c753174d..b81c263c 100644
--- a/src/tests/test-route-manager.c
+++ b/src/tests/test-route-manager.c
@@ -23,12 +23,11 @@
 #include <arpa/inet.h>
 #include <linux/rtnetlink.h>
 
-#include "test-common.h"
-
 #include "nm-platform.h"
+#include "nm-platform-utils.h"
 #include "nm-route-manager.h"
 
-#include "nm-test-utils.h"
+#include "test-common.h"
 
 typedef struct {
 	int ifindex0, ifindex1;
@@ -45,7 +44,7 @@ setup_dev0_ip4 (int ifindex, guint mss_of_first_route, guint32 metric_of_second_
 	route.ifindex = ifindex;
 	route.mss = 0;
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "6.6.6.0", &route.network);
 	route.plen = 24;
 	route.gateway = INADDR_ANY;
@@ -53,7 +52,7 @@ setup_dev0_ip4 (int ifindex, guint mss_of_first_route, guint32 metric_of_second_
 	route.mss = mss_of_first_route;
 	g_array_append_val (routes, route);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "7.0.0.0", &route.network);
 	route.plen = 8;
 	inet_pton (AF_INET, "6.6.6.1", &route.gateway);
@@ -87,21 +86,21 @@ setup_dev1_ip4 (int ifindex)
 	                                route.mss))
 		g_assert_not_reached ();
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "6.6.6.0", &route.network);
 	route.plen = 24;
 	route.gateway = INADDR_ANY;
 	route.metric = 20;
 	g_array_append_val (routes, route);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "7.0.0.0", &route.network);
 	route.plen = 8;
 	route.gateway = INADDR_ANY;
 	route.metric = 22;
 	g_array_append_val (routes, route);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "8.0.0.0", &route.network);
 	route.plen = 8;
 	inet_pton (AF_INET, "6.6.6.2", &route.gateway);
@@ -121,14 +120,14 @@ update_dev0_ip4 (int ifindex)
 	route.ifindex = ifindex;
 	route.mss = 0;
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "6.6.6.0", &route.network);
 	route.plen = 24;
 	route.gateway = INADDR_ANY;
 	route.metric = 20;
 	g_array_append_val (routes, route);
 
-	route.source = NM_IP_CONFIG_SOURCE_USER;
+	route.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER);
 	inet_pton (AF_INET, "7.0.0.0", &route.network);
 	route.plen = 8;
 	route.gateway = INADDR_ANY;
@@ -163,7 +162,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP4Route state1[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex0,
@@ -173,7 +172,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("7.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex0,
@@ -183,7 +182,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_UNIVERSE),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("7.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -193,7 +192,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex1,
@@ -203,7 +202,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("8.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -216,7 +215,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP4Route state2[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex0,
@@ -226,7 +225,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("7.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex0,
@@ -236,7 +235,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("7.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -246,7 +245,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex1,
@@ -256,7 +255,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("8.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -269,7 +268,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP4Route state3[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("7.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -279,7 +278,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex1,
@@ -289,7 +288,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_LINK),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("8.0.0.0"),
 			.plen = 8,
 			.ifindex = fixture->ifindex1,
@@ -299,7 +298,7 @@ test_ip4 (test_fixture *fixture, gconstpointer user_data)
 			.scope_inv = nm_platform_route_scope_inv (RT_SCOPE_UNIVERSE),
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = nmtst_inet4_from_string ("6.6.6.0"),
 			.plen = 24,
 			.ifindex = fixture->ifindex1,
@@ -542,7 +541,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP6Route state1[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex0,
@@ -551,7 +550,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex0,
@@ -560,7 +559,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex0,
@@ -569,7 +568,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -578,7 +577,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -587,7 +586,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -596,7 +595,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:d34d::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -608,7 +607,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP6Route state2[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex0,
@@ -617,7 +616,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex0,
@@ -626,7 +625,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex0,
@@ -635,7 +634,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -644,7 +643,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -653,7 +652,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -662,7 +661,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:d34d::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -674,7 +673,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 
 	NMPlatformIP6Route state3[] = {
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:abad:c0de::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -683,7 +682,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -692,7 +691,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -701,7 +700,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:1337::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -710,7 +709,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:8086::"),
 			.plen = 48,
 			.ifindex = fixture->ifindex1,
@@ -719,7 +718,7 @@ test_ip6 (test_fixture *fixture, gconstpointer user_data)
 			.mss = 0,
 		},
 		{
-			.source = NM_IP_CONFIG_SOURCE_USER,
+			.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (NM_IP_CONFIG_SOURCE_USER),
 			.network = *nmtst_inet6_from_string ("2001:db8:d34d::"),
 			.plen = 64,
 			.ifindex = fixture->ifindex1,
@@ -787,6 +786,7 @@ static void
 _assert_route_check (const NMPlatformVTableRoute *vtable, gboolean has, const NMPlatformIPXRoute *route)
 {
 	const NMPlatformIPXRoute *r;
+	NMPlatformIPXRoute c;
 
 	g_assert (route);
 
@@ -800,11 +800,18 @@ _assert_route_check (const NMPlatformVTableRoute *vtable, gboolean has, const NM
 	} else {
 		char buf[sizeof (_nm_utils_to_string_buffer)];
 
-		if (!r || vtable->route_cmp (route, r) != 0)
+		if (r) {
+			if (vtable->is_ip4)
+				c.r4 = route->r4;
+			else
+				c.r6 = route->r6;
+			c.rx.rt_source = nmp_utils_ip_config_source_round_trip_rtprot (c.rx.rt_source);
+		}
+		if (!r || vtable->route_cmp (r, &c) != 0) {
 			g_error ("Invalid route. Expect %s, has %s",
-			         vtable->route_to_string (route, NULL, 0),
+			         vtable->route_to_string (&c, NULL, 0),
 			         vtable->route_to_string (r, buf, sizeof (buf)));
-		g_assert (r);
+		}
 	}
 }
 
diff --git a/src/tests/test-systemd.c b/src/tests/test-systemd.c
index 936bff20..744b55c9 100644
--- a/src/tests/test-systemd.c
+++ b/src/tests/test-systemd.c
@@ -25,7 +25,52 @@
 #include "sd-lldp.h"
 #include "sd-event.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
+
+/*****************************************************************************
+ * Stub implementations of libNetworkManagerBase symbols
+ *****************************************************************************/
+
+gboolean
+nm_utils_get_testing_initialized (void)
+{
+	return TRUE;
+}
+
+void
+_nm_utils_set_testing (NMUtilsTestFlags flags)
+{
+	g_assert_not_reached ();
+}
+
+gint32
+nm_utils_get_monotonic_timestamp_s (void)
+{
+	return 1;
+}
+
+NMLogDomain _nm_logging_enabled_state[_LOGL_N_REAL];
+
+void
+_nm_log_impl (const char *file,
+              guint line,
+              const char *func,
+              NMLogLevel level,
+              NMLogDomain domain,
+              int error,
+              const char *fmt,
+              ...)
+{
+}
+
+gboolean
+nm_logging_setup (const char  *level,
+                  const char  *domains,
+                  char       **bad_domains,
+                  GError     **error)
+{
+	return TRUE;
+}
 
 /*****************************************************************************/
 
@@ -39,6 +84,12 @@ test_dhcp_create (void)
 	g_assert (r == 0);
 	g_assert (client4);
 
+	if (/* never true */ client4 == (gpointer) &r) {
+		/* we don't want to call this, but ensure that the linker
+		 * includes all these symbols. */
+		sd_dhcp_client_start (client4);
+	}
+
 	sd_dhcp_client_unref (client4);
 }
 
@@ -48,10 +99,9 @@ static void
 test_lldp_create (void)
 {
 	sd_lldp *lldp = NULL;
-	int ifindex = 1;
 	int r;
 
-	r = sd_lldp_new (&lldp, ifindex);
+	r = sd_lldp_new (&lldp);
 	g_assert (r == 0);
 	g_assert (lldp);
 
diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c
index 6fc3978b..000a9d1e 100644
--- a/src/tests/test-utils.c
+++ b/src/tests/test-utils.c
@@ -26,7 +26,7 @@
 
 #include "nm-core-utils.c"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 static void
 test_stable_privacy (void)
@@ -34,21 +34,93 @@ test_stable_privacy (void)
 	struct in6_addr addr1;
 
 	inet_pton (AF_INET6, "1234::", &addr1);
-	_set_stable_privacy (&addr1, "eth666", "6b138152-9f3e-4b97-aaf7-e6e553f2a24e", 0, (guint8 *) "key", 3, NULL);
+	_set_stable_privacy (NM_UTILS_STABLE_TYPE_UUID, &addr1, "eth666", "6b138152-9f3e-4b97-aaf7-e6e553f2a24e", 0, (guint8 *) "key", 3, NULL);
 	nmtst_assert_ip6_address (&addr1, "1234::4ceb:14cd:3d54:793f");
 
 	/* We get an address without the UUID. */
 	inet_pton (AF_INET6, "1::", &addr1);
-	_set_stable_privacy (&addr1, "eth666", NULL, 384, (guint8 *) "key", 3, NULL);
+	_set_stable_privacy (NM_UTILS_STABLE_TYPE_UUID, &addr1, "eth666", NULL, 384, (guint8 *) "key", 3, NULL);
 	nmtst_assert_ip6_address (&addr1, "1::11aa:2530:9144:dafa");
 
 	/* We get a different address in a different network. */
 	inet_pton (AF_INET6, "2::", &addr1);
-	_set_stable_privacy (&addr1, "eth666", NULL, 384, (guint8 *) "key", 3, NULL);
+	_set_stable_privacy (NM_UTILS_STABLE_TYPE_UUID, &addr1, "eth666", NULL, 384, (guint8 *) "key", 3, NULL);
 	nmtst_assert_ip6_address (&addr1, "2::338e:8d:c11:8726");
+
+	inet_pton (AF_INET6, "1234::", &addr1);
+	_set_stable_privacy (NM_UTILS_STABLE_TYPE_STABLE_ID, &addr1, "eth666", "6b138152-9f3e-4b97-aaf7-e6e553f2a24e", 0, (guint8 *) "key", 3, NULL);
+	nmtst_assert_ip6_address (&addr1, "1234::ad4c:ae44:3d30:af1e");
+
+	inet_pton (AF_INET6, "1234::", &addr1);
+	_set_stable_privacy (NM_UTILS_STABLE_TYPE_STABLE_ID, &addr1, "eth666", "stable-id-1", 0, (guint8 *) "key", 3, NULL);
+	nmtst_assert_ip6_address (&addr1, "1234::4944:67b0:7a6c:1cf");
+}
+
+/*****************************************************************************/
+
+static void
+_do_test_hw_addr (NMUtilsStableType stable_type,
+                  const char *stable_id,
+                  const guint8 *secret_key,
+                  gsize key_len,
+                  const char *ifname,
+                  const char *current_mac_address,
+                  const char *generate_mac_address_mask,
+                  const char **expected)
+{
+	gs_free char *generated = NULL;
+	const char **e;
+	gboolean found = FALSE;
+
+	for (e = expected; *e; e++) {
+		g_assert (*e);
+		g_assert (nm_utils_hwaddr_valid (*e, ETH_ALEN));
+	}
+
+	generated = _hw_addr_gen_stable_eth (stable_type,
+	                                     stable_id,
+	                                     secret_key,
+	                                     key_len,
+	                                     ifname,
+	                                     current_mac_address,
+	                                     generate_mac_address_mask);
+
+	g_assert (generated);
+	g_assert (nm_utils_hwaddr_valid (generated, ETH_ALEN));
+	for (e = expected; *e; e++) {
+		if (!nm_utils_hwaddr_matches (generated, -1, *e, -1))
+			continue;
+		g_assert (!found);
+		found = TRUE;
+		g_assert_cmpstr (generated, ==, *e);
+	}
+	g_assert (found);
+}
+#define do_test_hw_addr(stable_type, stable_id, secret_key, ifname, current_mac_address, generate_mac_address_mask, ...) \
+	_do_test_hw_addr ((stable_type), (stable_id), (const guint8 *) ""secret_key"", NM_STRLEN (secret_key), (ifname), ""current_mac_address"", generate_mac_address_mask, (const char *[]) { __VA_ARGS__, NULL })
+
+static void
+test_hw_addr_gen_stable_eth (void)
+{
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", NULL, "06:0D:CD:0C:9E:2C");
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_STABLE_ID, "stable-1", "key1", "eth0", "01:23:45:67:89:ab", NULL, "C6:AE:A9:9A:76:09");
+
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "FF:FF:FF:00:00:00", "00:23:45:0C:9E:2C");
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "03:23:45:67:89:ab", "FF:FF:FF:00:00:00", "02:23:45:0C:9E:2C");
+
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "00:00:00:00:00:00", "06:0D:CD:0C:9E:2C");
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "02:00:00:00:00:00", "04:0D:CD:0C:9E:2C");
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "02:00:00:00:00:00", "04:0D:CD:0C:9E:2C");
+
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "02:00:00:00:00:00 00:00:00:00:00:00", "04:0D:CD:0C:9E:2C");
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "02:00:00:00:00:00 02:00:00:00:00:00", "06:0D:CD:0C:9E:2C");
+
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "00:00:00:00:00:00 E9:60:CE:F5:ED:2F", "06:0D:CD:0C:9E:2C");
+
+	do_test_hw_addr (NM_UTILS_STABLE_TYPE_UUID,      "stable-1", "key1", "eth0", "01:23:45:67:89:ab", "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00", "06:0D:CD:0C:9E:2C", "04:0D:CD:0C:9E:2C");
 }
 
-/*******************************************/
+/*****************************************************************************/
 
 NMTST_DEFINE ();
 
@@ -58,6 +130,7 @@ main (int argc, char **argv)
 	nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
 
 	g_test_add_func ("/utils/stable_privacy", test_stable_privacy);
+	g_test_add_func ("/utils/hw_addr_gen_stable_eth", test_hw_addr_gen_stable_eth);
 
 	return g_test_run ();
 }
diff --git a/src/tests/test-wired-defname.c b/src/tests/test-wired-defname.c
index 6edd5ff2..3ae3a19d 100644
--- a/src/tests/test-wired-defname.c
+++ b/src/tests/test-wired-defname.c
@@ -24,7 +24,7 @@
 #include "nm-setting-connection.h"
 #include "nm-device-ethernet-utils.h"
 
-#include "nm-test-utils.h"
+#include "nm-test-utils-core.h"
 
 static NMConnection *
 _new_connection (const char *id)
@@ -41,12 +41,28 @@ _new_connection (const char *id)
 
 /*******************************************/
 
+static char *
+_get_default_wired_name (GSList *list)
+{
+	gs_free NMConnection **v = NULL;
+	guint l, i;
+
+	l = g_slist_length (list);
+	v = g_new0 (NMConnection *, l + 1);
+	for (i = 0; list; list = list->next, i++)
+		v[i] = NM_CONNECTION (list->data);
+	g_assert (i == l);
+	return nm_device_ethernet_utils_get_default_wired_name (v);
+}
+
+/*******************************************/
+
 static void
 test_defname_no_connections (void)
 {
 	gs_free char *name = NULL;
 
-	name = nm_device_ethernet_utils_get_default_wired_name (NULL);
+	name = _get_default_wired_name (NULL);
 	g_assert_cmpstr (name, ==, "Wired connection 1");
 }
 
@@ -62,7 +78,7 @@ test_defname_no_conflict (void)
 	list = g_slist_append (list, _new_connection ("work wifi"));
 	list = g_slist_append (list, _new_connection ("random gsm connection"));
 
-	name = nm_device_ethernet_utils_get_default_wired_name (list);
+	name = _get_default_wired_name (list);
 	g_assert_cmpstr (name, ==, "Wired connection 1");
 
 	g_slist_free_full (list, g_object_unref);
@@ -80,7 +96,7 @@ test_defname_conflict (void)
 	list = g_slist_append (list, _new_connection ("Wired connection 1"));
 	list = g_slist_append (list, _new_connection ("random gsm connection"));
 
-	name = nm_device_ethernet_utils_get_default_wired_name (list);
+	name = _get_default_wired_name (list);
 	g_assert_cmpstr (name, ==, "Wired connection 2");
 
 	g_slist_free_full (list, g_object_unref);
@@ -102,7 +118,7 @@ test_defname_multiple_conflicts (void)
 	list = g_slist_append (list, _new_connection ("work wifi"));
 	list = g_slist_append (list, _new_connection ("a vpn"));
 
-	name = nm_device_ethernet_utils_get_default_wired_name (list);
+	name = _get_default_wired_name (list);
 	g_assert_cmpstr (name, ==, "Wired connection 4");
 
 	g_slist_free_full (list, g_object_unref);