summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_router-advert.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-12-26 19:31:38 +0100
committerGitHub <noreply@github.com>2022-12-26 19:31:38 +0100
commit4bab998b4e7fe6eca57a3fe9ffba2d2be8f123b2 (patch)
treeb92f083b70acf6a1fa60ce9ca4cbb6a2201fd633 /smoketest/scripts/cli/test_service_router-advert.py
parenteb313d1ce15b65a5d4f69338f00beeeb5e824652 (diff)
parentdf18e6510bb94d1a3acf018c3a8fc3ffc5b61028 (diff)
downloadvyos-1x-4bab998b4e7fe6eca57a3fe9ffba2d2be8f123b2.tar.gz
vyos-1x-4bab998b4e7fe6eca57a3fe9ffba2d2be8f123b2.zip
Merge pull request #1717 from roedie/1.3-T4809
T4809: radvd: (Backport) Allow the use of AdvRASrcAddress
Diffstat (limited to 'smoketest/scripts/cli/test_service_router-advert.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_router-advert.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_service_router-advert.py b/smoketest/scripts/cli/test_service_router-advert.py
index 4875fb5d1..da08421d3 100755
--- a/smoketest/scripts/cli/test_service_router-advert.py
+++ b/smoketest/scripts/cli/test_service_router-advert.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2020 VyOS maintainers and contributors
+# Copyright (C) 2019-2022 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -27,6 +27,7 @@ RADVD_CONF = '/run/radvd/radvd.conf'
interface = 'eth1'
base_path = ['service', 'router-advert', 'interface', interface]
address_base = ['interfaces', 'ethernet', interface, 'address']
+prefix = '::/64'
def get_config_value(key):
tmp = read_file(RADVD_CONF)
@@ -113,5 +114,38 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase):
tmp = 'DNSSL ' + ' '.join(dnssl) + ' {'
self.assertIn(tmp, config)
+ def test_route(self):
+ route = '2001:db8:1000::/64'
+
+ self.cli_set(base_path + ['prefix', prefix])
+ self.cli_set(base_path + ['route', route])
+
+ # commit changes
+ self.cli_commit()
+
+ config = read_file(RADVD_CONF)
+
+ tmp = f'route {route}' + ' {'
+ self.assertIn(tmp, config)
+
+ self.assertIn('AdvRouteLifetime 1800;', config)
+ self.assertIn('AdvRoutePreference medium;', config)
+ self.assertIn('RemoveRoute on;', config)
+
+ def test_rasrcaddress(self):
+ ra_src = ['fe80::1', 'fe80::2']
+
+ self.cli_set(base_path + ['prefix', prefix])
+ for src in ra_src:
+ self.cli_set(base_path + ['source-address', src])
+
+ # commit changes
+ self.cli_commit()
+
+ config = read_file(RADVD_CONF)
+ self.assertIn('AdvRASrcAddress {', config)
+ for src in ra_src:
+ self.assertIn(f' {src};', config)
+
if __name__ == '__main__':
unittest.main(verbosity=2)