diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-20 14:17:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-20 14:17:17 +0900 |
commit | 7f37ecf7e59f288f0bcd92624da8d8abdac09215 (patch) | |
tree | 10daab336f3764a630c3aa044298d79ff7018d2a /test | |
parent | 6c41cf445912c12e14b1e94414a0fce1fa060ac2 (diff) | |
parent | cee0f719d8db3e131801be3e79cdb91233ba5cbe (diff) | |
download | systemd-7f37ecf7e59f288f0bcd92624da8d8abdac09215.tar.gz |
Merge pull request #18699 from yuwata/network-route-add-nexthop-setting
network: add NextHop= setting in [Route] section
Diffstat (limited to 'test')
-rw-r--r-- | test/fuzz/fuzz-network-parser/directives.network | 1 | ||||
-rw-r--r-- | test/test-network/conf/25-nexthop.network | 12 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network index d20fb78f15..90420f42b5 100644 --- a/test/fuzz/fuzz-network-parser/directives.network +++ b/test/fuzz/fuzz-network-parser/directives.network @@ -166,6 +166,7 @@ Metric= TTLPropagate= MultiPathRoute= TCPAdvertisedMaximumSegmentSize= +NextHop= [Network] IPv6DuplicateAddressDetection= IPMasquerade= diff --git a/test/test-network/conf/25-nexthop.network b/test/test-network/conf/25-nexthop.network index f32cc1a2db..d4c7aa606c 100644 --- a/test/test-network/conf/25-nexthop.network +++ b/test/test-network/conf/25-nexthop.network @@ -25,3 +25,15 @@ Family=ipv4 [NextHop] Gateway=192.168.5.2 + +[Route] +NextHop=1 +Destination=10.10.10.10 + +[Route] +NextHop=2 +Destination=10.10.10.11 + +[Route] +NextHop=2 +Destination=2001:1234:5:8f62::1 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index e9dc185345..12e9a0a4a3 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -2805,6 +2805,18 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertIn('id 4 dev veth99', output) self.assertRegex(output, r'id [0-9]* via 192.168.5.2 dev veth99') + output = check_output('ip route show dev veth99 10.10.10.10') + print(output) + self.assertEqual('10.10.10.10 nhid 1 via 192.168.5.1 proto static', output) + + output = check_output('ip route show dev veth99 10.10.10.11') + print(output) + self.assertEqual('10.10.10.11 nhid 2 via inet6 2001:1234:5:8f63::2 proto static', output) + + output = check_output('ip -6 route show dev veth99 2001:1234:5:8f62::1') + print(output) + self.assertEqual('2001:1234:5:8f62::1 nhid 2 via 2001:1234:5:8f63::2 proto static metric 1024 pref medium', output) + def test_qdisc(self): copy_unit_to_networkd_unit_path('25-qdisc-clsact-and-htb.network', '12-dummy.netdev', '25-qdisc-ingress-netem-compat.network', '11-dummy.netdev') |