diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-14 15:19:06 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-21 05:16:27 +0900 |
commit | e2d9bc5cfd7fb1affd665c3f6aa57e408a6ab082 (patch) | |
tree | 66117f75bb7eef57ee686aadb165ce851544a561 /test/test-network/systemd-networkd-tests.py | |
parent | 2ddd52d1e2098c801231b2af1dbcf802e5d01a31 (diff) | |
download | systemd-e2d9bc5cfd7fb1affd665c3f6aa57e408a6ab082.tar.gz |
test-network: add a test for OnLink= in [NextHop] section
Diffstat (limited to 'test/test-network/systemd-networkd-tests.py')
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index a5942ec4ea..38480e1ce5 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -2812,6 +2812,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): 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, 'id 5 via 192.168.10.1 dev veth99 .*onlink') 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') @@ -2822,6 +2823,10 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): print(output) self.assertEqual('10.10.10.11 nhid 2 via inet6 2001:1234:5:8f63::2 proto static', output) + output = check_output('ip route show dev veth99 10.10.10.12') + print(output) + self.assertEqual('10.10.10.12 nhid 5 via 192.168.10.1 proto static onlink', 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) |