summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-26 12:01:03 +0100
committerThomas Haller <thaller@redhat.com>2015-04-08 14:39:16 +0200
commit24288f713afd9626255523374b8a71fccd349f79 (patch)
treed7d2ea953d57a1fb6d567fca3986aaa6ff08ab51
parentb6d3b98655d119b155ec024b5eb5b6103111c75c (diff)
downloadNetworkManager-24288f713afd9626255523374b8a71fccd349f79.tar.gz
platform/test: split initialization of platform tests out
test-route-manager soon wants a different initialization
-rw-r--r--src/platform/tests/test-address.c6
-rw-r--r--src/platform/tests/test-cleanup.c6
-rw-r--r--src/platform/tests/test-common.c2
-rw-r--r--src/platform/tests/test-common.h3
-rw-r--r--src/platform/tests/test-link.c6
-rw-r--r--src/platform/tests/test-route.c6
-rw-r--r--src/tests/test-route-manager.c6
7 files changed, 34 insertions, 1 deletions
diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c
index 902b33ee59..21cd427fed 100644
--- a/src/platform/tests/test-address.c
+++ b/src/platform/tests/test-address.c
@@ -247,6 +247,12 @@ test_ip6_address_external (void)
}
void
+init_tests (int *argc, char ***argv)
+{
+ nmtst_init_with_logging (argc, argv, NULL, "ALL");
+}
+
+void
setup_tests (void)
{
SignalData *link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, DEVICE_NAME);
diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c
index 5d789d1bdf..796ca874e5 100644
--- a/src/platform/tests/test-cleanup.c
+++ b/src/platform/tests/test-cleanup.c
@@ -87,6 +87,12 @@ test_cleanup_internal (void)
}
void
+init_tests (int *argc, char ***argv)
+{
+ nmtst_init_with_logging (argc, argv, NULL, "ALL");
+}
+
+void
setup_tests (void)
{
nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME));
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index d8e8775f82..5194580dca 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -255,7 +255,7 @@ main (int argc, char **argv)
int result;
const char *program = *argv;
- nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
+ init_tests (&argc, &argv);
NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup && getuid() != 0) {
diff --git a/src/platform/tests/test-common.h b/src/platform/tests/test-common.h
index 17c4029d8c..367833d111 100644
--- a/src/platform/tests/test-common.h
+++ b/src/platform/tests/test-common.h
@@ -9,6 +9,8 @@
#include "nm-fake-platform.h"
#include "nm-linux-platform.h"
+#include "nm-test-utils.h"
+
#define DEVICE_NAME "nm-test-device"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
@@ -43,5 +45,6 @@ void link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received,
void run_command (const char *format, ...);
+void init_tests (int *argc, char ***argv);
void setup_tests (void);
diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c
index 0643b052cd..323ebc921c 100644
--- a/src/platform/tests/test-link.c
+++ b/src/platform/tests/test-link.c
@@ -540,6 +540,12 @@ test_external (void)
}
void
+init_tests (int *argc, char ***argv)
+{
+ nmtst_init_with_logging (argc, argv, NULL, "ALL");
+}
+
+void
setup_tests (void)
{
nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME));
diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c
index b6e99ab9fb..a2d35749e7 100644
--- a/src/platform/tests/test-route.c
+++ b/src/platform/tests/test-route.c
@@ -312,6 +312,12 @@ test_ip6_route (void)
}
void
+init_tests (int *argc, char ***argv)
+{
+ nmtst_init_with_logging (argc, argv, NULL, "ALL");
+}
+
+void
setup_tests (void)
{
SignalData *link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, DEVICE_NAME);
diff --git a/src/tests/test-route-manager.c b/src/tests/test-route-manager.c
index b93dbb18f5..9b4f6d800d 100644
--- a/src/tests/test-route-manager.c
+++ b/src/tests/test-route-manager.c
@@ -674,6 +674,12 @@ fixture_teardown (test_fixture *fixture, gconstpointer user_data)
}
void
+init_tests (int *argc, char ***argv)
+{
+ nmtst_init_with_logging (argc, argv, NULL, "ALL");
+}
+
+void
setup_tests (void)
{
g_test_add ("/route-manager/ip4", test_fixture, NULL, fixture_setup, test_ip4, fixture_teardown);