diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-15 14:53:54 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-15 14:53:54 +0200 |
commit | 22b6c055c193a99db40f036bfe6c485b411a8abb (patch) | |
tree | 7534a444fdb519ad92b7465e12efcf5d3cce1cb8 | |
parent | 6f87d8c910964fd0ebe9724183baa12861caa419 (diff) | |
download | vyos-1x-22b6c055c193a99db40f036bfe6c485b411a8abb.tar.gz vyos-1x-22b6c055c193a99db40f036bfe6c485b411a8abb.zip |
smoketest: ospf: T3757: test interface area configuration
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_ospf.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 59862ca3d..c4fd15c93 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -20,6 +20,7 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM +from vyos.configsession import ConfigSessionError from vyos.ifconfig import Section from vyos.util import process_named_running from vyos.util import cmd @@ -349,6 +350,30 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): frrconfig = self.getFRRconfig(zebra_route_map) self.assertNotIn(zebra_route_map, frrconfig) + def test_ospf_13_interface_area(self): + area = '0' + interfaces = Section.interfaces('ethernet') + + self.cli_set(base_path + ['area', area, 'network', '10.0.0.0/8']) + for interface in interfaces: + self.cli_set(base_path + ['interface', interface, 'area', area]) + + # we can not have bot area network and interface area set + with self.assertRaises(ConfigSessionError): + self.cli_commit() + self.cli_delete(base_path + ['area', area, 'network']) + + self.cli_commit() + + # Verify FRR ospfd configuration + frrconfig = self.getFRRconfig('router ospf') + self.assertIn(f'router ospf', frrconfig) + + for interface in interfaces: + config = self.getFRRconfig(f'interface {interface}') + self.assertIn(f'interface {interface}', config) + self.assertIn(f' ip ospf area {area}', config) + if __name__ == '__main__': logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) unittest.main(verbosity=2) |