summary refs log tree commit diff
path: root/src/settings/plugins/ifnet/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/plugins/ifnet/tests')
-rw-r--r--src/settings/plugins/ifnet/tests/Makefile.am23
-rw-r--r--src/settings/plugins/ifnet/tests/Makefile.in446
-rw-r--r--src/settings/plugins/ifnet/tests/hostname2
-rw-r--r--src/settings/plugins/ifnet/tests/test-ifnet.c (renamed from src/settings/plugins/ifnet/tests/test_all.c)252
4 files changed, 500 insertions, 223 deletions
diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am
index 754bb182..1919f141 100644
--- a/src/settings/plugins/ifnet/tests/Makefile.am
+++ b/src/settings/plugins/ifnet/tests/Makefile.am
@@ -4,42 +4,43 @@ if ENABLE_TESTS
 
 AM_CPPFLAGS= \
 	-I$(srcdir)/../ \
-	-I$(top_srcdir)/include \
-	-I$(top_builddir)/include \
+	-I$(top_srcdir)/shared \
+	-I$(top_builddir)/shared \
 	-I$(top_srcdir)/libnm-core \
 	-I$(top_builddir)/libnm-core \
 	-I$(top_srcdir)/src \
 	-I$(top_srcdir)/src/settings \
 	-I$(top_srcdir)/src/platform \
 	-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
-	-DNETWORKMANAGER_COMPILATION \
+	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
 	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(CHECK_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(CODE_COVERAGE_CFLAGS) \
+	-DTEST_IFNET_DIR=\"$(abs_srcdir)\" \
+	-DTEST_SCRATCH_DIR=\"$(abs_builddir)/\" \
 	-DTEST_WPA_SUPPLICANT_CONF='"$(srcdir)/wpa_supplicant.conf"' \
 	-DSYSCONFDIR=\"nonexistent\"
 
-noinst_PROGRAMS = check_ifnet
-check_ifnet_SOURCES = \
-	test_all.c \
+noinst_PROGRAMS = test-ifnet
+test_ifnet_SOURCES = \
+	test-ifnet.c \
 	../connection_parser.c \
 	../net_parser.c \
 	../net_utils.c \
 	../wpa_parser.c
 
-check_ifnet_LDFLAGS = \
+test_ifnet_LDFLAGS = \
 	$(CODE_COVERAGE_LDFLAGS)
 
-check_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la
+test_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la
 
-check-local: check_ifnet
-	$(abs_builddir)/check_ifnet $(abs_srcdir) $(abs_builddir)
+#@VALGRIND_RULES@
+TESTS = test-ifnet
 
 endif
 
 EXTRA_DIST = \
-	hostname \
 	net \
 	net.all \
 	nm-system-settings.conf \
diff --git a/src/settings/plugins/ifnet/tests/Makefile.in b/src/settings/plugins/ifnet/tests/Makefile.in
index d331ecee..1e08b955 100644
--- a/src/settings/plugins/ifnet/tests/Makefile.in
+++ b/src/settings/plugins/ifnet/tests/Makefile.in
@@ -88,7 +88,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-@ENABLE_TESTS_TRUE@noinst_PROGRAMS = check_ifnet$(EXEEXT)
+@ENABLE_TESTS_TRUE@noinst_PROGRAMS = test-ifnet$(EXEEXT)
+@ENABLE_TESTS_TRUE@TESTS = test-ifnet$(EXEEXT)
 subdir = src/settings/plugins/ifnet/tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \
@@ -112,22 +113,22 @@ CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 PROGRAMS = $(noinst_PROGRAMS)
-am__check_ifnet_SOURCES_DIST = test_all.c ../connection_parser.c \
+am__test_ifnet_SOURCES_DIST = test-ifnet.c ../connection_parser.c \
 	../net_parser.c ../net_utils.c ../wpa_parser.c
-@ENABLE_TESTS_TRUE@am_check_ifnet_OBJECTS = test_all.$(OBJEXT) \
+@ENABLE_TESTS_TRUE@am_test_ifnet_OBJECTS = test-ifnet.$(OBJEXT) \
 @ENABLE_TESTS_TRUE@	connection_parser.$(OBJEXT) \
 @ENABLE_TESTS_TRUE@	net_parser.$(OBJEXT) net_utils.$(OBJEXT) \
 @ENABLE_TESTS_TRUE@	wpa_parser.$(OBJEXT)
-check_ifnet_OBJECTS = $(am_check_ifnet_OBJECTS)
-@ENABLE_TESTS_TRUE@check_ifnet_DEPENDENCIES =  \
+test_ifnet_OBJECTS = $(am_test_ifnet_OBJECTS)
+@ENABLE_TESTS_TRUE@test_ifnet_DEPENDENCIES =  \
 @ENABLE_TESTS_TRUE@	$(top_builddir)/src/libNetworkManager.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-check_ifnet_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+test_ifnet_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(check_ifnet_LDFLAGS) $(LDFLAGS) -o $@
+	$(test_ifnet_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -162,8 +163,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(check_ifnet_SOURCES)
-DIST_SOURCES = $(am__check_ifnet_SOURCES_DIST)
+SOURCES = $(test_ifnet_SOURCES)
+DIST_SOURCES = $(am__test_ifnet_SOURCES_DIST)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -188,8 +189,212 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
 am__DIST_COMMON = $(srcdir)/Makefile.in \
-	$(top_srcdir)/build-aux/depcomp
+	$(top_srcdir)/build-aux/depcomp \
+	$(top_srcdir)/build-aux/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALL_LINGUAS = @ALL_LINGUAS@
@@ -206,7 +411,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CKDB_PATH = @CKDB_PATH@
 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
@@ -218,8 +422,6 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DBUS_CFLAGS = @DBUS_CFLAGS@
-DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@
-DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@
 DBUS_LIBS = @DBUS_LIBS@
 DBUS_SYS_DIR = @DBUS_SYS_DIR@
 DEFS = @DEFS@
@@ -229,6 +431,7 @@ DHCPCD_PATH = @DHCPCD_PATH@
 DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@
 DLLTOOL = @DLLTOOL@
 DNSMASQ_PATH = @DNSMASQ_PATH@
+DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -283,16 +486,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
 INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
 INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 IPTABLES_PATH = @IPTABLES_PATH@
-IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@
-IWMX_SDK_LIBS = @IWMX_SDK_LIBS@
 KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@
 LCOV = @LCOV@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@
+LIBAUDIT_LIBS = @LIBAUDIT_LIBS@
 LIBDL = @LIBDL@
-LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
-LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
-LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM = @LIBM@
@@ -329,6 +529,8 @@ NEWT_LIBS = @NEWT_LIBS@
 NM = @NM@
 NMEDIT = @NMEDIT@
 NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@
+NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@
+NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@
 NM_MAJOR_VERSION = @NM_MAJOR_VERSION@
 NM_MICRO_VERSION = @NM_MICRO_VERSION@
 NM_MINOR_VERSION = @NM_MINOR_VERSION@
@@ -357,7 +559,6 @@ POLKIT_LIBS = @POLKIT_LIBS@
 POSUB = @POSUB@
 PPPD_PATH = @PPPD_PATH@
 PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@
-PPPOE_PATH = @PPPOE_PATH@
 QT_CFLAGS = @QT_CFLAGS@
 QT_LIBS = @QT_LIBS@
 RANLIB = @RANLIB@
@@ -372,6 +573,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@
 SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@
 SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@
 SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@
+SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@
+SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@
 SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@
 SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@
 SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
@@ -432,6 +635,7 @@ mkdir_p = @mkdir_p@
 nmbinary = @nmbinary@
 nmconfdir = @nmconfdir@
 nmdatadir = @nmdatadir@
+nmlibdir = @nmlibdir@
 nmrundir = @nmrundir@
 nmstatedir = @nmstatedir@
 oldincludedir = @oldincludedir@
@@ -439,6 +643,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -456,35 +661,36 @@ with_resolvconf = @with_resolvconf@
 with_valgrind = @with_valgrind@
 @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \
 @ENABLE_TESTS_TRUE@	-I$(srcdir)/../ \
-@ENABLE_TESTS_TRUE@	-I$(top_srcdir)/include \
-@ENABLE_TESTS_TRUE@	-I$(top_builddir)/include \
+@ENABLE_TESTS_TRUE@	-I$(top_srcdir)/shared \
+@ENABLE_TESTS_TRUE@	-I$(top_builddir)/shared \
 @ENABLE_TESTS_TRUE@	-I$(top_srcdir)/libnm-core \
 @ENABLE_TESTS_TRUE@	-I$(top_builddir)/libnm-core \
 @ENABLE_TESTS_TRUE@	-I$(top_srcdir)/src \
 @ENABLE_TESTS_TRUE@	-I$(top_srcdir)/src/settings \
 @ENABLE_TESTS_TRUE@	-I$(top_srcdir)/src/platform \
 @ENABLE_TESTS_TRUE@	-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
-@ENABLE_TESTS_TRUE@	-DNETWORKMANAGER_COMPILATION \
+@ENABLE_TESTS_TRUE@	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
 @ENABLE_TESTS_TRUE@	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 @ENABLE_TESTS_TRUE@	$(CHECK_CFLAGS) \
 @ENABLE_TESTS_TRUE@	$(GLIB_CFLAGS) \
 @ENABLE_TESTS_TRUE@	$(CODE_COVERAGE_CFLAGS) \
+@ENABLE_TESTS_TRUE@	-DTEST_IFNET_DIR=\"$(abs_srcdir)\" \
+@ENABLE_TESTS_TRUE@	-DTEST_SCRATCH_DIR=\"$(abs_builddir)/\" \
 @ENABLE_TESTS_TRUE@	-DTEST_WPA_SUPPLICANT_CONF='"$(srcdir)/wpa_supplicant.conf"' \
 @ENABLE_TESTS_TRUE@	-DSYSCONFDIR=\"nonexistent\"
 
-@ENABLE_TESTS_TRUE@check_ifnet_SOURCES = \
-@ENABLE_TESTS_TRUE@	test_all.c \
+@ENABLE_TESTS_TRUE@test_ifnet_SOURCES = \
+@ENABLE_TESTS_TRUE@	test-ifnet.c \
 @ENABLE_TESTS_TRUE@	../connection_parser.c \
 @ENABLE_TESTS_TRUE@	../net_parser.c \
 @ENABLE_TESTS_TRUE@	../net_utils.c \
 @ENABLE_TESTS_TRUE@	../wpa_parser.c
 
-@ENABLE_TESTS_TRUE@check_ifnet_LDFLAGS = \
+@ENABLE_TESTS_TRUE@test_ifnet_LDFLAGS = \
 @ENABLE_TESTS_TRUE@	$(CODE_COVERAGE_LDFLAGS)
 
-@ENABLE_TESTS_TRUE@check_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la
+@ENABLE_TESTS_TRUE@test_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la
 EXTRA_DIST = \
-	hostname \
 	net \
 	net.all \
 	nm-system-settings.conf \
@@ -494,7 +700,7 @@ EXTRA_DIST = \
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -534,9 +740,9 @@ clean-noinstPROGRAMS:
 	echo " rm -f" $$list; \
 	rm -f $$list
 
-check_ifnet$(EXEEXT): $(check_ifnet_OBJECTS) $(check_ifnet_DEPENDENCIES) $(EXTRA_check_ifnet_DEPENDENCIES) 
-	@rm -f check_ifnet$(EXEEXT)
-	$(AM_V_CCLD)$(check_ifnet_LINK) $(check_ifnet_OBJECTS) $(check_ifnet_LDADD) $(LIBS)
+test-ifnet$(EXEEXT): $(test_ifnet_OBJECTS) $(test_ifnet_DEPENDENCIES) $(EXTRA_test_ifnet_DEPENDENCIES) 
+	@rm -f test-ifnet$(EXEEXT)
+	$(AM_V_CCLD)$(test_ifnet_LINK) $(test_ifnet_OBJECTS) $(test_ifnet_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -547,7 +753,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection_parser.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_parser.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ifnet.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wpa_parser.Po@am__quote@
 
 .c.o:
@@ -685,6 +891,169 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+	rm -f $< $@
+	$(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+	@:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+	  fi; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	elif test -n "$$redo_logs"; then \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS:
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	bases=`for i in $$bases; do echo $$i; done \
+	         | $(am__list_recheck_tests)` || exit 1; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+test-ifnet.log: test-ifnet$(EXEEXT)
+	@p='test-ifnet$(EXEEXT)'; \
+	b='test-ifnet'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@	@p='$<'; \
+@am__EXEEXT_TRUE@	$(am__set_b); \
+@am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
+
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -715,9 +1084,8 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
-@ENABLE_TESTS_FALSE@check-local:
 check-am: all-am
-	$(MAKE) $(AM_MAKEFLAGS) check-local
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
 all-am: Makefile $(PROGRAMS)
 installdirs:
@@ -741,6 +1109,9 @@ install-strip:
 	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
 	fi
 mostlyclean-generic:
+	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
 
@@ -824,7 +1195,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
 	clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
 	ctags ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
@@ -836,16 +1207,13 @@ uninstall-am:
 	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am
+	recheck tags tags-am uninstall uninstall-am
 
 .PRECIOUS: Makefile
 
 
 @ENABLE_TESTS_TRUE@@GNOME_CODE_COVERAGE_RULES@
 
-@ENABLE_TESTS_TRUE@check-local: check_ifnet
-@ENABLE_TESTS_TRUE@	$(abs_builddir)/check_ifnet $(abs_srcdir) $(abs_builddir)
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/src/settings/plugins/ifnet/tests/hostname b/src/settings/plugins/ifnet/tests/hostname
deleted file mode 100644
index 25c76165..00000000
--- a/src/settings/plugins/ifnet/tests/hostname
+++ /dev/null
@@ -1,2 +0,0 @@
-#Generated by NetworkManager
-hostname="gentoo"
diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test-ifnet.c
index 55e7e283..96fb5dd3 100644
--- a/src/settings/plugins/ifnet/tests/test_all.c
+++ b/src/settings/plugins/ifnet/tests/test-ifnet.c
@@ -24,14 +24,13 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <glib.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <nm-utils.h>
 
+#include "nm-default.h"
 #include "nm-linux-platform.h"
-#include "nm-logging.h"
 
 #include "net_parser.h"
 #include "net_utils.h"
@@ -59,82 +58,38 @@ nm_config_get_dhcp_client (NMConfig *config)
 static void
 test_getdata (void)
 {
-	ASSERT (ifnet_get_data ("eth1", "config")
-		&& strcmp (ifnet_get_data ("eth1", "config"), "( \"dhcp\" )") == 0,
-		"get data", "config_eth1 is not correct");
-	ASSERT (ifnet_get_data ("ppp0", "username")
-		&& strcmp (ifnet_get_data ("ppp0", "username"), "user") == 0,
-		"get data", "config_ppp0 username is not correctly read");
-	ASSERT (ifnet_get_data ("ppp0", "password")
-		&& strcmp (ifnet_get_data ("ppp0", "password"),
-			   "password") == 0, "get data",
-		"config_ppp0 password is not correctly read");
-	ASSERT (ifnet_get_global_data ("modules")
-		&& strcmp ("!wpa_supplicant", ifnet_get_global_data ("modules")) == 0,
-		"get data", "config_eth1 is not correct");
-}
-
-static void
-test_read_hostname (const char *base_path)
-{
-	char *hostname_path, *hostname;
-
-	hostname_path = g_build_filename (base_path, "hostname", NULL);
-	hostname = read_hostname (hostname_path);
-
-	g_assert_cmpstr (hostname, ==, "gentoo");
-
-	g_free (hostname);
-	g_free (hostname_path);
-}
-
-static void
-test_write_hostname (const char *temp_path)
-{
-	char *hostname_path, *hostname;
-
-	hostname_path = g_build_filename (temp_path, "hostname-test", NULL);
-	write_hostname (hostname_path, "gentoo-nm");
-	hostname = read_hostname (hostname_path);
-
-	g_assert_cmpstr (hostname, ==, "gentoo-nm");
-
-	g_free (hostname);
-	unlink (hostname_path);
-	g_free (hostname_path);
+	g_assert (ifnet_get_data ("eth1", "config") &&
+	          strcmp (ifnet_get_data ("eth1", "config"), "( \"dhcp\" )") == 0);
+	g_assert (ifnet_get_data ("ppp0", "username") &&
+	          strcmp (ifnet_get_data ("ppp0", "username"), "user") == 0);
+	g_assert (ifnet_get_data ("ppp0", "password") &&
+	          strcmp (ifnet_get_data ("ppp0", "password"), "password") == 0);
+	g_assert (ifnet_get_global_data ("modules") &&
+	          strcmp ("!wpa_supplicant", ifnet_get_global_data ("modules")) == 0);
 }
 
 static void
 test_is_static (void)
 {
-	ASSERT (is_static_ip4 ("eth1") == FALSE, "is static",
-		"a dhcp interface is recognized as static");
-	ASSERT (is_static_ip4 ("eth0") == TRUE, "is static",
-		"a static interface is recognized as dhcp");
-	ASSERT (is_static_ip6 ("eth0") == FALSE, "is static",
-		"a dhcp interface is recognized as static");
+	g_assert (!is_static_ip4 ("eth1"));
+	g_assert (is_static_ip4 ("eth0"));
+	g_assert (!is_static_ip6 ("eth0"));
 }
 
 static void
 test_has_default_route (void)
 {
-	ASSERT (has_default_ip4_route ("eth0"),
-		"has default route", "eth0 should have a default ipv4 route");
-	ASSERT (has_default_ip6_route ("eth4"),
-		"has default route", "eth4 should have a default ipv6 route");
-	ASSERT (!has_default_ip4_route ("eth5")
-		&& !has_default_ip6_route ("eth5"),
-		"has default route", "eth5 shouldn't have a default route");
+	g_assert (has_default_ip4_route ("eth0"));
+	g_assert (has_default_ip6_route ("eth4"));
+	g_assert (!has_default_ip4_route ("eth5") &&
+	          !has_default_ip6_route ("eth5"));
 }
 
 static void
 test_has_ip6_address (void)
 {
-	ASSERT (has_ip6_address ("eth2"), "has ip6 address",
-		"eth2 should have a ipv6 address");
-	ASSERT (!has_ip6_address ("eth0"), "has ip6 address",
-		"eth0 shouldn't have a ipv6 address")
-
+	g_assert (has_ip6_address ("eth2"));
+	g_assert (!has_ip6_address ("eth0"));
 }
 
 static void
@@ -144,12 +99,9 @@ test_is_ip4_address (void)
 	gchar *address2 = "192.168.100.{1..254}/24";
 	gchar *address3 = "192.168.4.2555/24";
 
-	ASSERT (is_ip4_address (address1), "is ip4 address",
-		"%s should be a valid address", address1);
-	ASSERT (is_ip4_address (address2), "is ip4 address",
-		"%s should be a valid address", address2);
-	ASSERT (!is_ip4_address (address3), "is ip4 address",
-		"%s should be an invalid address", address3);
+	g_assert (is_ip4_address (address1));
+	g_assert (is_ip4_address (address2));
+	g_assert (!is_ip4_address (address3));
 }
 
 static void
@@ -157,19 +109,15 @@ test_is_ip6_address (void)
 {
 	gchar *address1 = "4321:0:1:2:3:4:567:89ac/24";
 
-	ASSERT (is_ip6_address (address1), "is ip6 address",
-		"%s should be a valid address", address1);
+	g_assert (is_ip6_address (address1));
 }
 
 static void
 check_ip_block (ip_block * iblock, gchar * ip, guint32 prefix, gchar * gateway)
 {
-	ASSERT (strcmp (ip, iblock->ip) == 0, "check ip",
-		"ip expected:%s, find:%s", ip, iblock->ip);
-	ASSERT (prefix == iblock->prefix, "check netmask",
-		"prefix expected:%d, find:%d", prefix, iblock->prefix);
-	ASSERT (g_strcmp0 (gateway, iblock->next_hop) == 0, "check gateway",
-		"gateway expected:%s, find:%s", gateway, iblock->next_hop);
+	g_assert_cmpstr (ip, ==, iblock->ip);
+	g_assert (prefix == iblock->prefix);
+	g_assert_cmpstr (gateway, ==, iblock->next_hop);
 }
 
 static void
@@ -178,13 +126,11 @@ test_convert_ipv4_config_block (void)
 	ip_block *iblock = convert_ip4_config_block ("eth0");
 	ip_block *tmp = iblock;
 
-	ASSERT (iblock != NULL, "convert ipv4 block",
-		"block eth0 should not be NULL");
+	g_assert (iblock != NULL);
 	check_ip_block (iblock, "202.117.16.121", 24, "202.117.16.1");
 	iblock = iblock->next;
 	destroy_ip_block (tmp);
-	ASSERT (iblock != NULL, "convert ipv4 block",
-		"block eth0 should have a second IP address");
+	g_assert (iblock != NULL);
 	check_ip_block (iblock, "192.168.4.121", 24, "202.117.16.1");
 	destroy_ip_block (iblock);
 
@@ -192,17 +138,14 @@ test_convert_ipv4_config_block (void)
 	                       "*Can't handle IPv4 address*202.117.16.1211*");
 	iblock = convert_ip4_config_block ("eth2");
 	g_test_assert_expected_messages ();
-	ASSERT (iblock != NULL
-		&& iblock->next == NULL,
-		"convert error IPv4 address", "should only get one address");
+	g_assert (iblock != NULL && iblock->next == NULL);
 	check_ip_block (iblock, "192.168.4.121", 24, NULL);
 	destroy_ip_block (iblock);
 
 	g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING,
 	                       "*missing netmask or prefix*");
 	iblock = convert_ip4_config_block ("eth3");
-	ASSERT (iblock == NULL, "convert config_block",
-		"convert error configuration");
+	g_assert (iblock == NULL);
 }
 
 static void
@@ -211,22 +154,20 @@ test_convert_ipv4_routes_block (void)
 	ip_block *iblock = convert_ip4_routes_block ("eth0");
 	ip_block *tmp = iblock;
 
-	ASSERT (iblock != NULL, "convert ip4 routes", "should get one route");
+	g_assert (iblock != NULL);
 	check_ip_block (iblock, "192.168.4.0", 24, "192.168.4.1");
 	iblock = iblock->next;
 	destroy_ip_block (tmp);
-	ASSERT (iblock == NULL, "convert ip4 routes",
-		"should only get one route");
+	g_assert (iblock == NULL);
 
 	iblock = convert_ip4_routes_block ("eth9");
 	tmp = iblock;
 
-	ASSERT (iblock != NULL, "convert ip4 routes", "should get one route");
+	g_assert (iblock != NULL);
 	check_ip_block (iblock, "10.0.0.0", 8, "192.168.0.1");
 	iblock = iblock->next;
 	destroy_ip_block (tmp);
-	ASSERT (iblock == NULL, "convert ip4 routes",
-		"should only get one route");
+	g_assert (iblock == NULL);
 }
 
 static void
@@ -258,19 +199,15 @@ test_strip_string (void)
 	result = strip_string (result, '(');
 	result = strip_string (result, ')');
 	result = strip_string (result, '"');
-	ASSERT (strcmp (result, "default via     202.117.16.1") ==
-		0, "strip_string",
-		"string isn't stripped, result is: %s", result);
+	g_assert_cmpstr (result, ==, "default via     202.117.16.1");
 	g_free (result_b);
 }
 
 static void
 test_is_unmanaged (void)
 {
-	ASSERT (is_managed ("eth0"), "test_is_unmanaged",
-		"eth0 should be managed");
-	ASSERT (!is_managed ("eth4"), "test_is_unmanaged",
-		"eth4 should be unmanaged");
+	g_assert (is_managed ("eth0"));
+	g_assert (!is_managed ("eth4"));
 }
 
 static void
@@ -285,33 +222,23 @@ test_new_connection (void)
 	                       "*Can't handle IPv6 address*202.117.16.1211*");
 	connection = ifnet_update_connection_from_config_block ("eth2", NULL, &error);
 	g_test_assert_expected_messages ();
-	ASSERT (connection != NULL, "new connection",
-		"new connection failed: %s",
-		error ? error->message : "None");
+	g_assert (connection != NULL);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("qiaomuf", NULL, &error);
-	ASSERT (connection != NULL, "new connection",
-		"new connection failed: %s",
-		error ? error->message : "NONE");
+	g_assert (connection != NULL);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("myxjtu2", NULL, &error);
-	ASSERT (connection != NULL, "new connection",
-		"new connection failed: %s",
-		error ? error->message : "NONE");
+	g_assert (connection != NULL);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("eth9", NULL, &error);
-	ASSERT (connection != NULL, "new connection",
-		"new connection(eth9) failed: %s",
-		error ? error->message : "NONE");
+	g_assert (connection != NULL);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("eth10", NULL, &error);
-	ASSERT (connection != NULL, "new connection",
-		"new connection(eth10) failed: %s",
-		error ? error->message : "NONE");
+	g_assert (connection != NULL);
 	g_object_unref (connection);
 }
 
@@ -329,17 +256,16 @@ kill_backup (char **path)
 #define SUP_GEN_NAME "wpa_supplicant.conf.generate"
 
 static void
-test_update_connection (const char *basepath)
+test_update_connection (void)
 {
 	GError *error = NULL;
 	NMConnection *connection;
 	gboolean success;
 	char *backup = NULL;
+	char *basepath = TEST_IFNET_DIR;
 
 	connection = ifnet_update_connection_from_config_block ("eth0", basepath, &error);
-	ASSERT (connection != NULL, "get connection",
-		"get connection failed: %s",
-		error ? error->message : "None");
+	g_assert (connection != NULL);
 
 	success = ifnet_update_parsers_by_connection (connection, "eth0",
 	                                              NET_GEN_NAME,
@@ -348,12 +274,11 @@ test_update_connection (const char *basepath)
 	                                              &backup,
 	                                              &error);
 	kill_backup (&backup);
-	ASSERT (success, "update connection", "update connection failed %s", "eth0");
+	g_assert (success);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("0xab3ace", basepath, &error);
-	ASSERT (connection != NULL, "get connection", "get connection failed: %s",
-		error ? error->message : "None");
+	g_assert (connection != NULL);
 
 	success = ifnet_update_parsers_by_connection (connection, "0xab3ace",
 	                                              NET_GEN_NAME,
@@ -362,7 +287,7 @@ test_update_connection (const char *basepath)
 	                                              &backup,
 	                                              &error);
 	kill_backup (&backup);
-	ASSERT (success, "update connection", "update connection failed %s", "0xab3ace");
+	g_assert (success);
 	g_object_unref (connection);
 
 	unlink (NET_GEN_NAME);
@@ -370,14 +295,14 @@ test_update_connection (const char *basepath)
 }
 
 static void
-test_add_connection (const char *basepath)
+test_add_connection (void)
 {
 	NMConnection *connection;
 	char *backup = NULL;
+	const char *basepath = TEST_IFNET_DIR;
 
 	connection = ifnet_update_connection_from_config_block ("eth0", basepath, NULL);
-	ASSERT (ifnet_add_new_connection (connection, NET_GEN_NAME, SUP_GEN_NAME, NULL, &backup, NULL),
-	        "add connection", "add connection failed: %s", "eth0");
+	g_assert (ifnet_add_new_connection (connection, NET_GEN_NAME, SUP_GEN_NAME, NULL, &backup, NULL));
 	kill_backup (&backup);
 	g_object_unref (connection);
 
@@ -387,8 +312,7 @@ test_add_connection (const char *basepath)
 	                       "*Can't handle ipv4 address: 202.117.16.255, missing netmask or prefix*");
 	connection = ifnet_update_connection_from_config_block ("myxjtu2", basepath, NULL);
 	g_test_assert_expected_messages ();
-	ASSERT (ifnet_add_new_connection (connection, NET_GEN_NAME, SUP_GEN_NAME, NULL, &backup, NULL),
-	        "add connection", "add connection failed: %s", "myxjtu2");
+	g_assert (ifnet_add_new_connection (connection, NET_GEN_NAME, SUP_GEN_NAME, NULL, &backup, NULL));
 	kill_backup (&backup);
 	g_object_unref (connection);
 
@@ -404,20 +328,14 @@ test_delete_connection (void)
 	char *backup = NULL;
 
 	connection = ifnet_update_connection_from_config_block ("eth7", NULL, &error);
-	ASSERT (connection != NULL, "get connection",
-	        "get connection failed: %s",
-	        error ? error->message : "None");
-	ASSERT (ifnet_delete_connection_in_parsers ("eth7", NET_GEN_NAME, SUP_GEN_NAME, &backup),
-	        "delete connection", "delete connection failed: %s", "eth7");
+	g_assert (connection != NULL);
+	g_assert (ifnet_delete_connection_in_parsers ("eth7", NET_GEN_NAME, SUP_GEN_NAME, &backup));
 	kill_backup (&backup);
 	g_object_unref (connection);
 
 	connection = ifnet_update_connection_from_config_block ("qiaomuf", NULL, &error);
-	ASSERT (connection != NULL, "get connection",
-	        "get connection failed: %s",
-	        error ? error->message : "None");
-	ASSERT (ifnet_delete_connection_in_parsers ("qiaomuf", NET_GEN_NAME, SUP_GEN_NAME, &backup),
-	        "delete connection", "delete connection failed: %s", "qiaomuf");
+	g_assert (connection != NULL);
+	g_assert (ifnet_delete_connection_in_parsers ("qiaomuf", NET_GEN_NAME, SUP_GEN_NAME, &backup));
 	kill_backup (&backup);
 	g_object_unref (connection);
 
@@ -435,54 +353,46 @@ test_missing_config (void)
 	                       "*Unknown config for eth8*");
 	connection = ifnet_update_connection_from_config_block ("eth8", NULL, &error);
 	g_test_assert_expected_messages ();
-	ASSERT (connection == NULL && error != NULL, "get connection",
-	        "get connection should fail with 'Unknown config for eth8'");
+	g_assert (connection == NULL && error != NULL);
 }
 
 NMTST_DEFINE ();
 
+#define TPATH "/settings/plugins/ifnet/"
+
 int
 main (int argc, char **argv)
 {
-	char *f;
+	int ret;
 
 	nm_linux_platform_setup ();
 
 	nmtst_init_assert_logging (&argc, &argv, "WARN", "DEFAULT");
 
-	f = g_build_filename (argv[1], "net", NULL);
-	ifnet_init (f);
-	g_free (f);
-
-	f = g_build_filename (argv[1], "wpa_supplicant.conf", NULL);
-	wpa_parser_init (f);
-	g_free (f);
-
-	test_strip_string ();
-	test_is_static ();
-	test_has_ip6_address ();
-	test_has_default_route ();
-	test_getdata ();
-	test_read_hostname (argv[1]);
-	test_write_hostname (argv[2]);
-	test_is_ip4_address ();
-	test_is_ip6_address ();
-	test_convert_ipv4_config_block ();
-	test_convert_ipv4_routes_block ();
-	test_is_unmanaged ();
-	test_wpa_parser ();
-	test_convert_ipv4_routes_block ();
-	test_new_connection ();
-	test_update_connection (argv[1]);
-	test_add_connection (argv[1]);
-	test_delete_connection ();
-	test_missing_config ();
+	ifnet_init (TEST_IFNET_DIR "/net");
+	wpa_parser_init (TEST_IFNET_DIR "/wpa_supplicant.conf");
+
+	g_test_add_func (TPATH "strip-string", test_strip_string);
+	g_test_add_func (TPATH "is-static", test_is_static);
+	g_test_add_func (TPATH "has-ip6-address", test_has_ip6_address);
+	g_test_add_func (TPATH "has-default-route", test_has_default_route);
+	g_test_add_func (TPATH "get-data", test_getdata);
+	g_test_add_func (TPATH "is-ip4-address", test_is_ip4_address);
+	g_test_add_func (TPATH "is-ip6-address", test_is_ip6_address);
+	g_test_add_func (TPATH "convert-ip4-config", test_convert_ipv4_config_block);
+	g_test_add_func (TPATH "convert-ip4-routes", test_convert_ipv4_routes_block);
+	g_test_add_func (TPATH "is-unmanaged", test_is_unmanaged);
+	g_test_add_func (TPATH "wpa-parser", test_wpa_parser);
+	g_test_add_func (TPATH "new-connection", test_new_connection);
+	g_test_add_func (TPATH "update-connection", test_update_connection);
+	g_test_add_func (TPATH "add-connection", test_add_connection);
+	g_test_add_func (TPATH "delete-connection", test_delete_connection);
+	g_test_add_func (TPATH "missing-config", test_missing_config);
+
+	ret = g_test_run ();
 
 	ifnet_destroy ();
 	wpa_parser_destroy ();
 
-	f = g_path_get_basename (argv[0]);
-	fprintf (stdout, "%s: SUCCESS\n", f);
-	g_free (f);
-	return 0;
+	return ret;
 }