summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-24 21:52:15 +0100
committerGitHub <noreply@github.com>2024-03-24 21:52:15 +0100
commit52f88721f78f0f8bf9e97bb23c7cebfdd3884269 (patch)
tree168308d0f5ac6db8d7cd64168e540e9ecca84e75 /smoketest/scripts/cli
parent5f02e434e62d9829e11bd5bb3ed5f6737a9ed5e1 (diff)
parent8fa9c929a3436a73110312322d45405cbb49bccb (diff)
downloadvyos-1x-52f88721f78f0f8bf9e97bb23c7cebfdd3884269.tar.gz
vyos-1x-52f88721f78f0f8bf9e97bb23c7cebfdd3884269.zip
Merge pull request #3186 from vyos/mergify/bp/sagitta/pr-3185
ospf: T6066: can not define the same network in different areas (backport #3185)
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index 82fb96754..1b9cc50fe 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -540,5 +540,25 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
for router_id in router_ids:
self.assertIn(f' graceful-restart helper enable {router_id}', frrconfig)
+ def test_ospf_17_duplicate_area_network(self):
+ area0 = '0'
+ area1 = '1'
+ network = '10.0.0.0/8'
+
+ self.cli_set(base_path + ['area', area0, 'network', network])
+
+ # we can not have the same network defined on two areas
+ self.cli_set(base_path + ['area', area1, 'network', network])
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+ self.cli_delete(base_path + ['area', area0])
+
+ self.cli_commit()
+
+ # Verify FRR ospfd configuration
+ frrconfig = self.getFRRconfig('router ospf', daemon=PROCESS_NAME)
+ self.assertIn(f'router ospf', frrconfig)
+ self.assertIn(f' network {network} area {area1}', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2)