mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
test-network: add test case for multipath routing
This commit is contained in:
parent
6ff5cc6b7a
commit
a0ce990e71
test/test-network
@ -12,6 +12,10 @@ IPv4LLRoute=yes
|
||||
Destination=2001:1234:5:8fff:ff:ff:ff:ff/128
|
||||
Scope=link
|
||||
|
||||
[Route]
|
||||
Destination=2001:1234:5:9fff:ff:ff:ff:ff/128
|
||||
Scope=link
|
||||
|
||||
[Route]
|
||||
Destination=::/0
|
||||
Gateway=2001:1234:5:8fff:ff:ff:ff:ff
|
||||
@ -62,3 +66,18 @@ Destination=149.10.123.3
|
||||
[Route]
|
||||
Type=multicast
|
||||
Destination=149.10.123.4
|
||||
|
||||
[Route]
|
||||
Destination=192.168.10.1/32
|
||||
MultiPathRoute=149.10.124.59@dummy98 10
|
||||
MultiPathRoute=149.10.124.60@dummy98 5
|
||||
|
||||
[Route]
|
||||
Destination=2001:1234:5:7fff:ff:ff:ff:ff/128
|
||||
MultiPathRoute=2001:1234:5:8fff:ff:ff:ff:ff@dummy98 10
|
||||
MultiPathRoute=2001:1234:5:9fff:ff:ff:ff:ff@dummy98 5
|
||||
|
||||
[Route]
|
||||
Destination=192.168.10.2/32
|
||||
MultiPathRoute=2001:1234:5:8fff:ff:ff:ff:ff@dummy98 10
|
||||
MultiPathRoute=2001:1234:5:9fff:ff:ff:ff:ff@dummy98 5
|
||||
|
@ -1812,6 +1812,30 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
print(output)
|
||||
self.assertRegex(output, 'prohibit 202.54.1.4 proto static')
|
||||
|
||||
print('### ip route show 192.168.10.1')
|
||||
output = check_output('ip route show 192.168.10.1')
|
||||
print(output)
|
||||
self.assertRegex(output, '192.168.10.1 proto static')
|
||||
self.assertRegex(output, 'nexthop via 149.10.124.59 dev dummy98 weight 10')
|
||||
self.assertRegex(output, 'nexthop via 149.10.124.60 dev dummy98 weight 5')
|
||||
|
||||
print('### ip route show 192.168.10.2')
|
||||
output = check_output('ip route show 192.168.10.2')
|
||||
print(output)
|
||||
# old ip command does not show IPv6 gateways...
|
||||
self.assertRegex(output, '192.168.10.2 proto static')
|
||||
self.assertRegex(output, 'nexthop')
|
||||
self.assertRegex(output, 'dev dummy98 weight 10')
|
||||
self.assertRegex(output, 'dev dummy98 weight 5')
|
||||
|
||||
print('### ip -6 route show 2001:1234:5:7fff:ff:ff:ff:ff')
|
||||
output = check_output('ip -6 route show 2001:1234:5:7fff:ff:ff:ff:ff')
|
||||
print(output)
|
||||
# old ip command does not show 'nexthop' keyword and weight...
|
||||
self.assertRegex(output, '2001:1234:5:7fff:ff:ff:ff:ff')
|
||||
self.assertRegex(output, 'via 2001:1234:5:8fff:ff:ff:ff:ff dev dummy98')
|
||||
self.assertRegex(output, 'via 2001:1234:5:9fff:ff:ff:ff:ff dev dummy98')
|
||||
|
||||
def test_gateway_reconfigure(self):
|
||||
copy_unit_to_networkd_unit_path('25-gateway-static.network', '12-dummy.netdev')
|
||||
start_networkd()
|
||||
|
Loading…
Reference in New Issue
Block a user