summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-15 14:53:54 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-15 14:53:54 +0200
commit22b6c055c193a99db40f036bfe6c485b411a8abb (patch)
tree7534a444fdb519ad92b7465e12efcf5d3cce1cb8 /smoketest/scripts
parent6f87d8c910964fd0ebe9724183baa12861caa419 (diff)
downloadvyos-1x-22b6c055c193a99db40f036bfe6c485b411a8abb.tar.gz
vyos-1x-22b6c055c193a99db40f036bfe6c485b411a8abb.zip
smoketest: ospf: T3757: test interface area configuration
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py25
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)