summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-10-14 11:29:27 +0200
committerGitHub <noreply@github.com>2022-10-14 11:29:27 +0200
commit427ea592ae8d92d29aca245683832b5bd75b643d (patch)
treeef4232e3e88c642bd469eb12d2747007451d2095
parent783f5e24b1c5f15f1d7e91f892051312a2a5c6c3 (diff)
parente3d66e7eb61c4fd5d29b64370a993d583f597639 (diff)
downloadvyos-1x-427ea592ae8d92d29aca245683832b5bd75b643d.tar.gz
vyos-1x-427ea592ae8d92d29aca245683832b5bd75b643d.zip
Merge pull request #1595 from Cheeze-It/current
isis, ospf: T4739: ISIS and OSPF segment routing being refactored
-rw-r--r--data/templates/frr/isisd.frr.j214
-rw-r--r--interface-definitions/include/isis/protocol-common-config.xml.i4
-rw-r--r--interface-definitions/include/ospf/protocol-common-config.xml.i4
-rw-r--r--interface-definitions/include/segment-routing-label-value.xml.i (renamed from interface-definitions/include/isis/high-low-label-value.xml.i)4
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_isis.py8
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py13
6 files changed, 17 insertions, 30 deletions
diff --git a/data/templates/frr/isisd.frr.j2 b/data/templates/frr/isisd.frr.j2
index 194dbcb07..8df1e9513 100644
--- a/data/templates/frr/isisd.frr.j2
+++ b/data/templates/frr/isisd.frr.j2
@@ -121,22 +121,12 @@ router isis VyOS {{ 'vrf ' + vrf if vrf is vyos_defined }}
{% for prefix, prefix_config in segment_routing.prefix.items() %}
{% if prefix_config.absolute is vyos_defined %}
{% if prefix_config.absolute.value is vyos_defined %}
- segment-routing prefix {{ prefix }} absolute {{ prefix_config.absolute.value }}
-{% if prefix_config.absolute.explicit_null is vyos_defined %}
- segment-routing prefix {{ prefix }} absolute {{ prefix_config.absolute.value }} explicit-null
-{% elif prefix_config.absolute.no_php_flag is vyos_defined %}
- segment-routing prefix {{ prefix }} absolute {{ prefix_config.absolute.value }} no-php-flag
-{% endif %}
+ segment-routing prefix {{ prefix }} absolute {{ prefix_config.absolute.value }} {{ 'explicit-null' if prefix_config.absolute.explicit_null is vyos_defined }} {{ 'no-php-flag' if prefix_config.absolute.no_php_flag is vyos_defined }}
{% endif %}
{% endif %}
{% if prefix_config.index is vyos_defined %}
{% if prefix_config.index.value is vyos_defined %}
- segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }}
-{% if prefix_config.index.explicit_null is vyos_defined %}
- segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} explicit-null
-{% elif prefix_config.index.no_php_flag is vyos_defined %}
- segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} no-php-flag
-{% endif %}
+ segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} {{ 'explicit-null' if prefix_config.index.explicit_null is vyos_defined }} {{ 'no-php-flag' if prefix_config.index.no_php_flag is vyos_defined }}
{% endif %}
{% endif %}
{% endfor %}
diff --git a/interface-definitions/include/isis/protocol-common-config.xml.i b/interface-definitions/include/isis/protocol-common-config.xml.i
index 57ee19300..42bda7a80 100644
--- a/interface-definitions/include/isis/protocol-common-config.xml.i
+++ b/interface-definitions/include/isis/protocol-common-config.xml.i
@@ -238,7 +238,7 @@
<help>Segment Routing Global Block label range</help>
</properties>
<children>
- #include <include/isis/high-low-label-value.xml.i>
+ #include <include/segment-routing-label-value.xml.i>
</children>
</node>
<node name="local-block">
@@ -246,7 +246,7 @@
<help>Segment Routing Local Block label range</help>
</properties>
<children>
- #include <include/isis/high-low-label-value.xml.i>
+ #include <include/segment-routing-label-value.xml.i>
</children>
</node>
<leafNode name="maximum-label-depth">
diff --git a/interface-definitions/include/ospf/protocol-common-config.xml.i b/interface-definitions/include/ospf/protocol-common-config.xml.i
index 28e3b473b..0615063af 100644
--- a/interface-definitions/include/ospf/protocol-common-config.xml.i
+++ b/interface-definitions/include/ospf/protocol-common-config.xml.i
@@ -631,7 +631,7 @@
<help>Segment Routing Global Block label range</help>
</properties>
<children>
- #include <include/isis/high-low-label-value.xml.i>
+ #include <include/segment-routing-label-value.xml.i>
</children>
</node>
<node name="local-block">
@@ -639,7 +639,7 @@
<help>Segment Routing Local Block label range</help>
</properties>
<children>
- #include <include/isis/high-low-label-value.xml.i>
+ #include <include/segment-routing-label-value.xml.i>
</children>
</node>
<leafNode name="maximum-label-depth">
diff --git a/interface-definitions/include/isis/high-low-label-value.xml.i b/interface-definitions/include/segment-routing-label-value.xml.i
index f30b5af3a..05e1edd78 100644
--- a/interface-definitions/include/isis/high-low-label-value.xml.i
+++ b/interface-definitions/include/segment-routing-label-value.xml.i
@@ -1,10 +1,10 @@
-<!-- include start from isis/high-low-label-value.xml.i -->
+<!-- include start from segment-routing-label-value.xml.i -->
<leafNode name="low-label-value">
<properties>
<help>MPLS label lower bound</help>
<valueHelp>
<format>u32:16-1048575</format>
- <description>Label value (recommended minimum value: 100)</description>
+ <description>Label value (recommended minimum value: 300)</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 16-1048575"/>
diff --git a/smoketest/scripts/cli/test_protocols_isis.py b/smoketest/scripts/cli/test_protocols_isis.py
index c26028253..d11d80a1f 100755
--- a/smoketest/scripts/cli/test_protocols_isis.py
+++ b/smoketest/scripts/cli/test_protocols_isis.py
@@ -263,10 +263,10 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' isis bfd profile {bfd_profile}', tmp)
def test_isis_07_segment_routing_configuration(self):
- global_block_low = "100"
- global_block_high = "199"
- local_block_low = "200"
- local_block_high = "299"
+ global_block_low = "300"
+ global_block_high = "399"
+ local_block_low = "400"
+ local_block_high = "499"
interface = 'lo'
maximum_stack_size = '5'
prefix_one = '192.168.0.1/32'
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index 93bb761c1..51c947537 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -382,10 +382,10 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
def test_ospf_14_segment_routing_configuration(self):
- global_block_low = "100"
- global_block_high = "199"
- local_block_low = "200"
- local_block_high = "299"
+ global_block_low = "300"
+ global_block_high = "399"
+ local_block_low = "400"
+ local_block_high = "499"
interface = 'lo'
maximum_stack_size = '5'
prefix_one = '192.168.0.1/32'
@@ -408,16 +408,13 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.cli_commit()
# Verify all changes
-
frrconfig = self.getFRRconfig('router ospf')
+ self.assertIn(f' segment-routing on', frrconfig)
self.assertIn(f' segment-routing global-block {global_block_low} {global_block_high} local-block {local_block_low} {local_block_high}', frrconfig)
self.assertIn(f' segment-routing node-msd {maximum_stack_size}', frrconfig)
self.assertIn(f' segment-routing prefix {prefix_one} index {prefix_one_value} explicit-null', frrconfig)
self.assertIn(f' segment-routing prefix {prefix_two} index {prefix_two_value} no-php-flag', frrconfig)
- self.skipTest('https://github.com/FRRouting/frr/issues/12007')
- self.assertIn(f' segment-routing on', frrconfig)
-
if __name__ == '__main__':
unittest.main(verbosity=2)