summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-05 10:36:50 +0200
committerThomas Haller <thaller@redhat.com>2017-09-08 11:05:05 +0200
commit96f1358eeff52cd441dfd910d341082cc957cecd (patch)
treec85be9e489b37b8a3a5e8cc46dfec2bebbae9786 /src/tests
parentead1ffd9bc5571c76210cd457db131984569cc46 (diff)
downloadNetworkManager-96f1358eeff52cd441dfd910d341082cc957cecd.tar.gz
core: return new route from _nm_ip_config_add_obj()
Later we will need the exact instance that we just added (or the previously existing one, if the new route is already tracked).
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test-ip4-config.c18
-rw-r--r--src/tests/test-ip6-config.c18
2 files changed, 18 insertions, 18 deletions
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index f5620d95c7..d8b6f2de06 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -42,10 +42,10 @@ build_test_config (void)
nm_ip4_config_add_address (config, &addr);
route = *nmtst_platform_ip4_route ("10.0.0.0", 8, "192.168.1.1");
- nm_ip4_config_add_route (config, &route);
+ nm_ip4_config_add_route (config, &route, NULL);
route = *nmtst_platform_ip4_route ("172.16.0.0", 16, "192.168.1.1");
- nm_ip4_config_add_route (config, &route);
+ nm_ip4_config_add_route (config, &route, NULL);
nm_ip4_config_set_gateway (config, nmtst_inet4_from_string ("192.168.1.1"));
@@ -95,7 +95,7 @@ test_subtract (void)
nm_ip4_config_add_address (dst, &addr);
route = *nmtst_platform_ip4_route (expected_route_dest, expected_route_plen, expected_route_next_hop);
- nm_ip4_config_add_route (dst, &route);
+ nm_ip4_config_add_route (dst, &route, NULL);
nm_ip4_config_add_nameserver (dst, expected_ns1);
nm_ip4_config_add_nameserver (dst, expected_ns2);
@@ -170,10 +170,10 @@ test_compare_with_source (void)
/* Route */
route = *nmtst_platform_ip4_route ("10.0.0.0", 8, "192.168.1.1");
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip4_config_add_route (a, &route);
+ nm_ip4_config_add_route (a, &route, NULL);
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
- nm_ip4_config_add_route (b, &route);
+ nm_ip4_config_add_route (b, &route, NULL);
/* Assert that the configs are basically the same, eg that the source is ignored */
g_assert (nm_ip4_config_equal (a, b));
@@ -234,13 +234,13 @@ test_add_route_with_source (void)
/* Test that a higher priority source is not overwritten */
route = *nmtst_platform_ip4_route ("1.2.3.0", 24, "1.2.3.1");
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip4_config_add_route (a, &route);
+ nm_ip4_config_add_route (a, &route, NULL);
test_route = _nmtst_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
- nm_ip4_config_add_route (a, &route);
+ nm_ip4_config_add_route (a, &route, NULL);
test_route = _nmtst_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
@@ -248,13 +248,13 @@ test_add_route_with_source (void)
/* Test that a lower priority address source is overwritten */
_nmtst_ip4_config_del_route (a, 0);
route.rt_source = NM_IP_CONFIG_SOURCE_KERNEL;
- nm_ip4_config_add_route (a, &route);
+ nm_ip4_config_add_route (a, &route, NULL);
test_route = _nmtst_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip4_config_add_route (a, &route);
+ nm_ip4_config_add_route (a, &route, NULL);
test_route = _nmtst_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
diff --git a/src/tests/test-ip6-config.c b/src/tests/test-ip6-config.c
index 32eaeb6f8b..bc703dd440 100644
--- a/src/tests/test-ip6-config.c
+++ b/src/tests/test-ip6-config.c
@@ -37,8 +37,8 @@ build_test_config (void)
config = nmtst_ip6_config_new (1);
nm_ip6_config_add_address (config, nmtst_platform_ip6_address ("abcd:1234:4321::cdde", "1:2:3:4::5", 64));
- nm_ip6_config_add_route (config, nmtst_platform_ip6_route ("abcd:1200::", 24, "abcd:1234:4321:cdde::2", NULL));
- nm_ip6_config_add_route (config, nmtst_platform_ip6_route ("2001::", 16, "2001:abba::2234", NULL));
+ nm_ip6_config_add_route (config, nmtst_platform_ip6_route ("abcd:1200::", 24, "abcd:1234:4321:cdde::2", NULL), NULL);
+ nm_ip6_config_add_route (config, nmtst_platform_ip6_route ("2001::", 16, "2001:abba::2234", NULL), NULL);
nm_ip6_config_set_gateway (config, nmtst_inet6_from_string ("3001:abba::3234"));
@@ -74,7 +74,7 @@ test_subtract (void)
/* add a couple more things to the test config */
dst = build_test_config ();
nm_ip6_config_add_address (dst, nmtst_platform_ip6_address (expected_addr, NULL, expected_addr_plen));
- nm_ip6_config_add_route (dst, nmtst_platform_ip6_route (expected_route_dest, expected_route_plen, expected_route_next_hop, NULL));
+ nm_ip6_config_add_route (dst, nmtst_platform_ip6_route (expected_route_dest, expected_route_plen, expected_route_next_hop, NULL), NULL);
expected_ns1 = *nmtst_inet6_from_string ("2222:3333:4444::5555");
nm_ip6_config_add_nameserver (dst, &expected_ns1);
@@ -141,10 +141,10 @@ test_compare_with_source (void)
/* Route */
route = *nmtst_platform_ip6_route ("abcd:1200::", 24, "abcd:1234:4321:cdde::2", NULL);
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip6_config_add_route (a, &route);
+ nm_ip6_config_add_route (a, &route, NULL);
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
- nm_ip6_config_add_route (b, &route);
+ nm_ip6_config_add_route (b, &route, NULL);
/* Assert that the configs are basically the same, eg that the source is ignored */
g_assert (nm_ip6_config_equal (a, b));
@@ -205,13 +205,13 @@ test_add_route_with_source (void)
/* Test that a higher priority source is not overwritten */
route = *nmtst_platform_ip6_route ("abcd:1200::", 24, "abcd:1234:4321:cdde::2", NULL);
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip6_config_add_route (a, &route);
+ nm_ip6_config_add_route (a, &route, NULL);
test_route = _nmtst_ip6_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
- nm_ip6_config_add_route (a, &route);
+ nm_ip6_config_add_route (a, &route, NULL);
test_route = _nmtst_ip6_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
@@ -219,13 +219,13 @@ test_add_route_with_source (void)
/* Test that a lower priority address source is overwritten */
_nmtst_ip6_config_del_route (a, 0);
route.rt_source = NM_IP_CONFIG_SOURCE_KERNEL;
- nm_ip6_config_add_route (a, &route);
+ nm_ip6_config_add_route (a, &route, NULL);
test_route = _nmtst_ip6_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
- nm_ip6_config_add_route (a, &route);
+ nm_ip6_config_add_route (a, &route, NULL);
test_route = _nmtst_ip6_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);