diff options
author | Thomas Haller <thaller@redhat.com> | 2015-05-04 17:18:39 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-05-04 18:41:15 +0200 |
commit | b22bf15c1d4aca4aada52debbe5f4641f5db24a4 (patch) | |
tree | 977211b65690dea7d586e03e23cdf361f4e93b24 /src/platform/tests | |
parent | 7572837375d6eed2833eb5144fc8f9221c57eedf (diff) | |
download | NetworkManager-b22bf15c1d4aca4aada52debbe5f4641f5db24a4.tar.gz |
platform: fix root-tests after adding link detection without udev
Co-Authored-By: Lubomir Rintel <lkundrak@v3.sk>
Fixes: 388b7830f322b60960884328ff51f7b4df0ef3d3
Diffstat (limited to 'src/platform/tests')
-rw-r--r-- | src/platform/tests/test-address.c | 2 | ||||
-rw-r--r-- | src/platform/tests/test-cleanup.c | 2 | ||||
-rw-r--r-- | src/platform/tests/test-link.c | 13 | ||||
-rw-r--r-- | src/platform/tests/test-route.c | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c index 9463ae4e9f..0547261551 100644 --- a/src/platform/tests/test-address.c +++ b/src/platform/tests/test-address.c @@ -260,7 +260,7 @@ setup_tests (void) nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME)); g_assert (!nm_platform_link_exists (NM_PLATFORM_GET, DEVICE_NAME)); g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME)); - wait_signal (link_added); + accept_signal (link_added); free_signal (link_added); g_test_add_func ("/address/internal/ip4", test_ip4_address); diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c index 29892c9c83..473489da81 100644 --- a/src/platform/tests/test-cleanup.c +++ b/src/platform/tests/test-cleanup.c @@ -36,7 +36,7 @@ test_cleanup_internal (void) /* Create and set up device */ g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME)); - wait_signal (link_added); + accept_signal (link_added); free_signal (link_added); g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME))); ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME); diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 6dddfc0d59..d82d0165e6 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -115,7 +115,7 @@ software_add (NMLinkType link_type, const char *name) /* Don't call link_callback for the bridge interface */ parent_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, PARENT_NAME); if (nm_platform_bridge_add (NM_PLATFORM_GET, PARENT_NAME, NULL, 0)) - wait_signal (parent_added); + accept_signal (parent_added); free_signal (parent_added); { @@ -148,7 +148,7 @@ test_slave (int master, int type, SignalData *master_changed) g_assert (ifindex > 0); link_changed = add_signal_ifindex (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_CHANGED, link_callback, ifindex); link_removed = add_signal_ifindex (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_REMOVED, link_callback, ifindex); - wait_signal (link_added); + accept_signal (link_added); /* Set the slave up to see whether master's IFF_LOWER_UP is set correctly. * @@ -263,7 +263,7 @@ test_software (NMLinkType link_type, const char *link_typename) link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, DEVICE_NAME); g_assert (software_add (link_type, DEVICE_NAME)); no_error (); - wait_signal (link_added); + accept_signal (link_added); g_assert (nm_platform_link_exists (NM_PLATFORM_GET, DEVICE_NAME)); ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME); g_assert (ifindex >= 0); @@ -405,7 +405,7 @@ test_internal (void) /* Add device */ g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME)); no_error (); - wait_signal (link_added); + accept_signal (link_added); /* Try to add again */ g_assert (!nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME)); @@ -485,6 +485,7 @@ test_external (void) run_command ("ip link add %s type %s", DEVICE_NAME, "dummy"); wait_signal (link_added); + g_assert (nm_platform_link_exists (NM_PLATFORM_GET, DEVICE_NAME)); ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME); g_assert (ifindex > 0); @@ -496,7 +497,7 @@ test_external (void) success = nm_platform_link_get (NM_PLATFORM_GET, ifindex, &link); g_assert (success); - if (!link.driver) { + if (!link.initialized) { /* we still lack the notification via UDEV. Expect another link changed signal. */ wait_signal (link_changed); } @@ -505,8 +506,10 @@ test_external (void) g_assert (!nm_platform_link_is_up (NM_PLATFORM_GET, ifindex)); g_assert (!nm_platform_link_is_connected (NM_PLATFORM_GET, ifindex)); g_assert (!nm_platform_link_uses_arp (NM_PLATFORM_GET, ifindex)); + run_command ("ip link set %s up", DEVICE_NAME); wait_signal (link_changed); + g_assert (nm_platform_link_is_up (NM_PLATFORM_GET, ifindex)); g_assert (nm_platform_link_is_connected (NM_PLATFORM_GET, ifindex)); run_command ("ip link set %s down", DEVICE_NAME); diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index 85a119ddd0..c22ce51571 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -325,7 +325,7 @@ setup_tests (void) nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME)); g_assert (!nm_platform_link_exists (NM_PLATFORM_GET, DEVICE_NAME)); g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME)); - wait_signal (link_added); + accept_signal (link_added); free_signal (link_added); g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME))); |