summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorPavel Abalikhin <anpavl@gmail.com>2021-01-14 01:19:17 +0300
committerGitHub <noreply@github.com>2021-01-13 16:19:17 -0600
commit9a258eebd96aa5ad4486dba1fe86bea5bcf00c2f (patch)
tree1fa550ce104f5b3b9ad26956a99d14b24a9d9974 /tests/unittests
parent162fb8393555cb14238a352918654a0bbc1030e7 (diff)
downloadvyos-cloud-init-9a258eebd96aa5ad4486dba1fe86bea5bcf00c2f.tar.gz
vyos-cloud-init-9a258eebd96aa5ad4486dba1fe86bea5bcf00c2f.zip
net: Fix static routes to host in eni renderer (#668)
Route '-net' parameter is incompatible with /32 IPv4 addresses so we have to use '-host' in that case.
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_net.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index bf0cdabb..38d934d4 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -4820,6 +4820,9 @@ class TestEniRoundTrip(CiTestCase):
{'type': 'route', 'id': 6,
'metric': 1, 'destination': '10.0.200.0/16',
'gateway': '172.23.31.1'},
+ {'type': 'route', 'id': 7,
+ 'metric': 1, 'destination': '10.0.0.100/32',
+ 'gateway': '172.23.31.1'},
]
files = self._render_and_read(
@@ -4843,6 +4846,10 @@ class TestEniRoundTrip(CiTestCase):
'172.23.31.1 metric 1 || true'),
('pre-down route del -net 10.0.200.0/16 gw '
'172.23.31.1 metric 1 || true'),
+ ('post-up route add -host 10.0.0.100/32 gw '
+ '172.23.31.1 metric 1 || true'),
+ ('pre-down route del -host 10.0.0.100/32 gw '
+ '172.23.31.1 metric 1 || true'),
]
found = files['/etc/network/interfaces'].splitlines()