1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-02 09:47:03 +03:00

test-network: add tests for Family= in [NextHop]

This commit is contained in:
Yu Watanabe 2021-02-03 17:19:04 +09:00
parent 26ff450550
commit 6cd8f9b5f2
2 changed files with 21 additions and 1 deletions

View File

@ -3,9 +3,25 @@ Name=veth99
[Network]
IPv6AcceptRA=no
Address=2001:1234:5:8f63::1/120
Address=192.168.5.10/24
Gateway=192.168.5.1
[NextHop]
Id=1
Gateway=192.168.5.1
[NextHop]
Id=2
Gateway=2001:1234:5:8f63::2
[NextHop]
Id=3
Family=ipv6
[NextHop]
Id=4
Family=ipv4
[NextHop]
Gateway=192.168.5.2

View File

@ -2799,7 +2799,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
output = check_output('ip nexthop list dev veth99')
print(output)
self.assertRegex(output, '192.168.5.1')
self.assertIn('id 1 via 192.168.5.1 dev veth99', output)
self.assertIn('id 2 via 2001:1234:5:8f63::2 dev veth99', output)
self.assertIn('id 3 dev veth99', output)
self.assertIn('id 4 dev veth99', output)
self.assertRegex(output, r'id [0-9]* via 192.168.5.2 dev veth99')
def test_qdisc(self):
copy_unit_to_networkd_unit_path('25-qdisc-clsact-and-htb.network', '12-dummy.netdev',