summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-05-28 08:17:56 +0200
committerChristian Poessinger <christian@poessinger.com>2022-05-28 08:17:56 +0200
commite7b000032be1188d96732b47a43a73c468910a44 (patch)
tree2b551182c88ac4f9b070cdb9ffdd6f7932127d28
parent283276d457a09c100416c0d4ffccd4f94ccd2540 (diff)
downloadvyos-1x-e7b000032be1188d96732b47a43a73c468910a44.tar.gz
vyos-1x-e7b000032be1188d96732b47a43a73c468910a44.zip
rip: T4448: add support for explicit version selection
-rw-r--r--data/templates/frr/ripd.frr.j23
-rw-r--r--interface-definitions/protocols-rip.xml.in18
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_rip.py11
3 files changed, 32 insertions, 0 deletions
diff --git a/data/templates/frr/ripd.frr.j2 b/data/templates/frr/ripd.frr.j2
index df35150ca..e884ed85f 100644
--- a/data/templates/frr/ripd.frr.j2
+++ b/data/templates/frr/ripd.frr.j2
@@ -84,6 +84,9 @@ router rip
{% endif %}
{% endif %}
{% include 'frr/rip_ripng.frr.j2' %}
+{% if version is vyos_defined %}
+ version {{ version }}
+{% endif %}
exit
!
{% if route_map is vyos_defined %}
diff --git a/interface-definitions/protocols-rip.xml.in b/interface-definitions/protocols-rip.xml.in
index bbb88aef1..ed2153ff2 100644
--- a/interface-definitions/protocols-rip.xml.in
+++ b/interface-definitions/protocols-rip.xml.in
@@ -226,8 +226,26 @@
</leafNode>
#include <include/rip/rip-timers.xml.i>
#include <include/route-map.xml.i>
+ <leafNode name="version">
+ <properties>
+ <help>RIP protocol version</help>
+ <valueHelp>
+ <format>u32:1</format>
+ <description>RIPv1</description>
+ </valueHelp>
+ <valueHelp>
+ <format>u32:2</format>
+ <description>RIPv2</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-2"/>
+ </constraint>
+ </properties>
+ <defaultValue>2</defaultValue>
+ </leafNode>
</children>
</node>
</children>
</node>
</interfaceDefinition>
+
diff --git a/smoketest/scripts/cli/test_protocols_rip.py b/smoketest/scripts/cli/test_protocols_rip.py
index 80d4e79f9..68df913f0 100755
--- a/smoketest/scripts/cli/test_protocols_rip.py
+++ b/smoketest/scripts/cli/test_protocols_rip.py
@@ -146,5 +146,16 @@ class TestProtocolsRIP(VyOSUnitTestSHIM.TestCase):
frrconfig = self.getFRRconfig(zebra_route_map)
self.assertNotIn(zebra_route_map, frrconfig)
+ def test_rip_03_version(self):
+ version = '1'
+
+ self.cli_set(base_path + ['version', version])
+ # commit changes
+ self.cli_commit()
+
+ # Verify FRR configuration
+ frrconfig = self.getFRRconfig('router rip')
+ self.assertIn(f'version {version}', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2)