From 687462972361af3d91047721f1d7bd02da7f9dd5 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 May 2022 10:35:37 +0200 Subject: rip: T4448: remove default version for RIP Commit f9e38622 ("rip: T4448: add support to set protocol version on an interface level") also added the versionspecified on a per interface level. the RIp version carried a default value of 2 which makes RIPv1 and RIPv2 no longer working which is dthe default for FRR. Remove the default "2" from the RIP version specifier to make this behavior work again. --- interface-definitions/include/rip/version.xml.i | 7 +++---- smoketest/scripts/cli/test_protocols_rip.py | 16 ++++++++-------- src/conf_mode/protocols_rip.py | 15 --------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/interface-definitions/include/rip/version.xml.i b/interface-definitions/include/rip/version.xml.i index f7d3eab0d..a35350aee 100644 --- a/interface-definitions/include/rip/version.xml.i +++ b/interface-definitions/include/rip/version.xml.i @@ -1,19 +1,18 @@ - RIP protocol version + Limit RIP protocol version 1 - RIPv1 + Allow RIPv1 only 2 - RIPv2 + Allow RIPv2 only - 2 diff --git a/smoketest/scripts/cli/test_protocols_rip.py b/smoketest/scripts/cli/test_protocols_rip.py index 8c100d537..11385adb5 100755 --- a/smoketest/scripts/cli/test_protocols_rip.py +++ b/smoketest/scripts/cli/test_protocols_rip.py @@ -159,24 +159,24 @@ class TestProtocolsRIP(VyOSUnitTestSHIM.TestCase): self.assertNotIn(zebra_route_map, frrconfig) def test_rip_03_version(self): - version = '1' + rx_version = '1' + tx_version = '2' interface = 'eth0' - self.cli_set(base_path + ['version', version]) - self.cli_set(base_path + ['interface', interface, 'send', 'version', version]) - self.cli_set(base_path + ['interface', interface, 'receive', 'version', version]) + self.cli_set(base_path + ['version', tx_version]) + self.cli_set(base_path + ['interface', interface, 'send', 'version', tx_version]) + self.cli_set(base_path + ['interface', interface, 'receive', 'version', rx_version]) # commit changes self.cli_commit() # Verify FRR configuration frrconfig = self.getFRRconfig('router rip') - self.assertIn(f'version {version}', frrconfig) + self.assertIn(f'version {tx_version}', frrconfig) frrconfig = self.getFRRconfig(f'interface {interface}') - self.assertIn(f' ip rip receive version {version}', frrconfig) - self.assertIn(f' ip rip send version {version}', frrconfig) - + self.assertIn(f' ip rip receive version {rx_version}', frrconfig) + self.assertIn(f' ip rip send version {tx_version}', frrconfig) if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py index e29b23765..c78d90396 100755 --- a/src/conf_mode/protocols_rip.py +++ b/src/conf_mode/protocols_rip.py @@ -56,24 +56,9 @@ def get_config(config=None): # We have gathered the dict representation of the CLI, but there are default # options which we need to update into the dictionary retrived. default_values = defaults(base) - - # T2665: we can not blend in default values of tagNodes - delete and add - # individual values later on ... - if 'interface' in default_values: - del default_values['interface'] # merge in remaining default values rip = dict_merge(default_values, rip) - # T2665: add individual per interface defaults - - # T2665: blend in per interface defaults - if 'interface' in rip: - default_values = defaults(base + ['interface']) - for interface in rip['interface']: - # merge in default values - rip['interface'][interface] = dict_merge(default_values, - rip['interface'][interface]) - # We also need some additional information from the config, prefix-lists # and route-maps for instance. They will be used in verify(). # -- cgit v1.2.3