From: Yu Watanabe Date: Thu, 3 Jul 2025 03:35:37 +0000 (+0900) Subject: test: assume RTA_VIA is supported X-Git-Tag: v258-rc1~196^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F38039%2Fhead;p=thirdparty%2Fsystemd.git test: assume RTA_VIA is supported RTA_VIA support was added in kernel v5.2: https://github.com/torvalds/linux/commit/d15662682db232da77136cd348f4c9df312ca6f9 Our baseline on the kernel is v5.4. Hence, we can assume that the attribute is supported. --- diff --git a/src/test/test-local-addresses.c b/src/test/test-local-addresses.c index 2380f28d19e..52622a851ff 100644 --- a/src/test/test-local-addresses.c +++ b/src/test/test-local-addresses.c @@ -13,8 +13,6 @@ #include "sysctl-util.h" #include "tests.h" -static bool support_rta_via = false; - static void print_local_addresses(const struct local_address *a, size_t n) { FOREACH_ARRAY(i, a, n) log_debug("%s ifindex=%i scope=%u priority=%"PRIu32" weight=%"PRIu32" address=%s", @@ -136,7 +134,7 @@ static void check_local_gateways(sd_netlink *rtnl, int ifindex, int request_ifin .family = AF_INET6, .address = u, }), - family == AF_UNSPEC && support_rta_via); + family == AF_UNSPEC); ASSERT_OK(in_addr_from_string(AF_INET6, "2001:db8:1:123::1", &u)); ASSERT_EQ(has_local_address(a, n, @@ -176,7 +174,7 @@ static void check_local_outbounds(sd_netlink *rtnl, int ifindex, int request_ifi .family = AF_INET6, .address = u, }), - family == AF_UNSPEC && support_rta_via); + family == AF_UNSPEC); ASSERT_OK(in_addr_from_string(AF_INET6, ipv6_expected, &u)); ASSERT_EQ(has_local_address(a, n, @@ -282,12 +280,7 @@ TEST(local_addresses_with_dummy) { .address = u, }, sizeof(RouteVia))); ASSERT_OK(sd_netlink_message_append_u32(message, RTA_OIF, ifindex)); - r = sd_netlink_call(rtnl, message, 0, NULL); - if (r == -EINVAL) - log_debug_errno(r, "RTA_VIA is not supported, ignoring: %m"); - else - ASSERT_OK(r); - support_rta_via = r >= 0; + ASSERT_OK(sd_netlink_call(rtnl, message, 0, NULL)); message = sd_netlink_message_unref(message); /* Add an IPv6 default gateway */ diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 3aa288e6e9e..dc867cd1d47 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -239,17 +239,6 @@ def expectedFailureIfNexthopIsNotAvailable(): return f -def expectedFailureIfRTA_VIAIsNotSupported(): - def f(func): - call_quiet('ip link add dummy98 type dummy') - call_quiet('ip link set up dev dummy98') - call_quiet('ip route add 2001:1234:5:8fff:ff:ff:ff:fe/128 dev dummy98') - rc = call_quiet('ip route add 10.10.10.10 via inet6 2001:1234:5:8fff:ff:ff:ff:fe dev dummy98') - remove_link('dummy98') - return func if rc == 0 else unittest.expectedFailure(func) - - return f - def expectedFailureIfAlternativeNameIsNotAvailable(): def f(func): call_quiet('ip link add dummy98 type dummy') @@ -4510,7 +4499,6 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'local fe80:[a-f0-9:]* table local proto kernel metric 0 pref medium', output) self.assertIn('multicast ff00::/8 table local proto kernel metric 256 pref medium', output) - @expectedFailureIfRTA_VIAIsNotSupported() def test_route_via_ipv6(self): copy_network_unit('25-route-via-ipv6.network', '12-dummy.netdev') start_networkd()