diff options
| author | Michael Biebl <biebl@debian.org> | 2020-06-29 22:16:54 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2020-06-29 22:16:54 +0200 |
| commit | 238d328f69e0f4b838f361d7ddac1d6134bfd631 (patch) | |
| tree | 411ff73bb36d725e3a337d2fddbccc7b074622e0 /src/settings/plugins/ifcfg-rh/tests | |
| parent | e8d426c51e83b8465f9be527fd014f51443f829d (diff) | |
| parent | 10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff) | |
Update upstream source from tag 'upstream/1.25.91'
Update to upstream version '1.25.91' with Debian dir 82448cadc1dd251ffbe44b7c339cadeb55eb776b
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/tests')
3 files changed, 21 insertions, 2 deletions
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes b/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes index 5d02c62e..9c05417e 100644 --- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes +++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes @@ -13,3 +13,7 @@ NETMASK2=255.255.255.255 GATEWAY2=192.168.1.8 METRIC2=3 OPTIONS2="mtu lock 9000 cwnd 12 src 1.1.1.1 tos 0x28 onlink window 30000 initcwnd lock 13 initrwnd 14 scope link" + +ADDRESS3=1.2.3.4 +NETMASK3=255.255.255.255 +OPTIONS3="local scope host" diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy b/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy index faa247d8..1fef7e97 100644 --- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy +++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy @@ -6,3 +6,4 @@ 43.53.0.0/16 metric 3 via 7.7.7.7 dev eth2 cwnd 14 mtu lock 9000 initrwnd 20 window lock 10000 initcwnd lock 42 src 1.2.3.4 7.7.7.8/32 via (null) metric 18 +local 1.2.3.4 diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index a5025f3b..40d1bb8c 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -1323,7 +1323,7 @@ test_read_wired_static_routes (void) g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL); /* Routes */ - g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip4), ==, 3); + g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip4), ==, 4); ip4_route = nm_setting_ip_config_get_route (s_ip4, 0); g_assert (ip4_route); @@ -1367,6 +1367,13 @@ test_read_wired_static_routes (void) nmtst_assert_route_attribute_boolean (ip4_route, NM_IP_ROUTE_ATTRIBUTE_ONLINK, TRUE); nmtst_assert_route_attribute_byte (ip4_route, NM_IP_ROUTE_ATTRIBUTE_SCOPE, 253); + ip4_route = nm_setting_ip_config_get_route (s_ip4, 3); + g_assert (ip4_route); + g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "1.2.3.4"); + g_assert_cmpint (nm_ip_route_get_prefix (ip4_route), ==, 32); + nmtst_assert_route_attribute_string (ip4_route, NM_IP_ROUTE_ATTRIBUTE_TYPE, "local"); + nmtst_assert_route_attribute_byte (ip4_route, NM_IP_ROUTE_ATTRIBUTE_SCOPE, 254); + g_object_unref (connection); } @@ -1402,7 +1409,7 @@ test_read_wired_static_routes_legacy (void) g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_MANUAL); /* Routes */ - g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip4), ==, 4); + g_assert_cmpint (nm_setting_ip_config_get_num_routes (s_ip4), ==, 5); /* Route #1 */ ip4_route = nm_setting_ip_config_get_route (s_ip4, 0); @@ -1443,6 +1450,13 @@ test_read_wired_static_routes_legacy (void) g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, NULL); g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 18); + + /* Route #5 */ + ip4_route = nm_setting_ip_config_get_route (s_ip4, 4); + g_assert (ip4_route != NULL); + g_assert_cmpstr (nm_ip_route_get_dest (ip4_route), ==, "1.2.3.4"); + nmtst_assert_route_attribute_string (ip4_route, NM_IP_ROUTE_ATTRIBUTE_TYPE, "local"); + g_object_unref (connection); } |