summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2021-05-19 13:44:41 +0300
committerGitHub <noreply@github.com>2021-05-19 12:44:41 +0200
commita1ab13b533f300353579cf4d23f8e6a77ca02100 (patch)
treea42616905a6d72618f9666370f9fc9baafbe4e81
parentb14b67520e578d1ada8e12f4626f7d82b4cab9b4 (diff)
downloadvyos-1x-a1ab13b533f300353579cf4d23f8e6a77ca02100.tar.gz
vyos-1x-a1ab13b533f300353579cf4d23f8e6a77ca02100.zip
ospfv3: T3554: add area-type "stub"
-rw-r--r--data/templates/frr/ospfv3.frr.tmpl5
-rw-r--r--interface-definitions/protocols-ospfv3.xml.in20
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospfv3.py17
3 files changed, 42 insertions, 0 deletions
diff --git a/data/templates/frr/ospfv3.frr.tmpl b/data/templates/frr/ospfv3.frr.tmpl
index d08972a80..0026c0d2c 100644
--- a/data/templates/frr/ospfv3.frr.tmpl
+++ b/data/templates/frr/ospfv3.frr.tmpl
@@ -50,6 +50,11 @@ router ospf6
interface {{ interface }} area {{ area_id }}
{% endfor %}
{% endif %}
+{% if area_config.area_type is defined and area_config.area_type is not none %}
+{% for type, type_config in area_config.area_type.items() %}
+ area {{ area_id }} {{ type }} {{ 'no-summary' if type_config.no_summary is defined }}
+{% endfor %}
+{% endif %}
{% if area_config.range is defined and area_config.range is not none %}
{% for prefix, prefix_config in area_config.range.items() %}
area {{ area_id }} range {{ prefix }} {{ 'advertise' if prefix_config.advertise is defined }} {{ 'not-advertise' if prefix_config.not_advertise is defined }}
diff --git a/interface-definitions/protocols-ospfv3.xml.in b/interface-definitions/protocols-ospfv3.xml.in
index 99e671b32..7b42c448d 100644
--- a/interface-definitions/protocols-ospfv3.xml.in
+++ b/interface-definitions/protocols-ospfv3.xml.in
@@ -25,6 +25,26 @@
</constraint>
</properties>
<children>
+ <node name="area-type">
+ <properties>
+ <help>OSPFv3 Area type</help>
+ </properties>
+ <children>
+ <node name="stub">
+ <properties>
+ <help>Stub OSPFv3 area</help>
+ </properties>
+ <children>
+ <leafNode name="no-summary">
+ <properties>
+ <help>Do not inject inter-area routes into the stub</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
<leafNode name="export-list">
<properties>
<help>Name of export-list</help>
diff --git a/smoketest/scripts/cli/test_protocols_ospfv3.py b/smoketest/scripts/cli/test_protocols_ospfv3.py
index 6bb551642..0b4b01993 100755
--- a/smoketest/scripts/cli/test_protocols_ospfv3.py
+++ b/smoketest/scripts/cli/test_protocols_ospfv3.py
@@ -150,5 +150,22 @@ class TestProtocolsOSPFv3(VyOSUnitTestSHIM.TestCase):
cost = str(int(cost) + 10)
priority = str(int(priority) + 5)
+
+ def test_ospfv3_05_area_stub(self):
+ area_stub = '23'
+ area_stub_nosum = '26'
+
+ self.cli_set(base_path + ['area', area_stub, 'area-type', 'stub'])
+ self.cli_set(base_path + ['area', area_stub_nosum, 'area-type', 'stub', 'no-summary'])
+
+ # commit changes
+ self.cli_commit()
+
+ # Verify FRR ospfd configuration
+ frrconfig = self.getFRRconfig('router ospf6')
+ self.assertIn(f'router ospf6', frrconfig)
+ self.assertIn(f' area {area_stub} stub', frrconfig)
+ self.assertIn(f' area {area_stub_nosum} stub no-summary', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2)