summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-11-14 12:32:47 +0200
committerGitHub <noreply@github.com>2025-11-14 12:32:47 +0200
commitdac6ca177f3229ed42b4028420a4522b2bb600c6 (patch)
tree18aed92a99627a241352fbf773be7405f9c82fb5 /smoketest/scripts/cli
parent0447d71a7c77890bbedb105f28fb6ebc067b7778 (diff)
parentb63388c8125f542e58e961722ded84b137fb4bdf (diff)
downloadvyos-1x-dac6ca177f3229ed42b4028420a4522b2bb600c6.tar.gz
vyos-1x-dac6ca177f3229ed42b4028420a4522b2bb600c6.zip
Merge pull request #4841 from alexandr-san4ez/T7255-current
VRF: T7255: Impossible to delete protocols under VRF
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index f941867e1..468b859c3 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -326,6 +326,48 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
self.cli_delete(['interfaces', 'dummy', interface])
self.cli_commit()
+ def test_delete_vrf_protocols_should_not_crash(self):
+ # Testcase for issue T7255:
+ # - verify that deleting the 'protocols' node under a VRF does not crash.
+
+ table = '3000'
+ vrf = 'purple'
+ interface = 'dum3000'
+ router_id = '10.2.0.2'
+
+ # Configure dummy interface and assign to VRF
+ self.cli_set(['interfaces', 'dummy', interface, 'address', '10.1.0.254/24'])
+ self.cli_set(['interfaces', 'dummy', interface, 'vrf', vrf])
+
+ # Configure OSPF under the VRF
+ base_ospf_path = base_path + ['name', vrf, 'protocols', 'ospf']
+ self.cli_set(base_ospf_path + ['interface', interface, 'area', '0'])
+ self.cli_set(base_ospf_path + ['parameters', 'router-id', router_id])
+ self.cli_set(['protocols', 'ospf'])
+
+ # Assign routing table number to the VRF
+ self.cli_set(base_path + ['name', vrf, 'table', table])
+
+ # Commit configuration and verify VRF was successfully created
+ self.cli_commit()
+ self.assertTrue(interface_exists(vrf))
+ frrconfig = self.getFRRconfig(f'router ospf vrf {vrf}', stop_section='^exit')
+ self.assertIn(f'ospf router-id {router_id}', frrconfig)
+
+ try:
+ # Attempt to delete the entire 'protocols' subtree under VRF
+ self.cli_delete(base_path + ['name', vrf, 'protocols'])
+ self.cli_commit()
+
+ # Verify result of deleting 'protocols' subtree
+ frrconfig = self.getFRRconfig(f'router ospf vrf {vrf}', stop_section='^exit')
+ self.assertNotIn(f'ospf router-id {router_id}', frrconfig)
+ finally:
+ # Clean up dummy interface and VRF and re-commit
+ self.cli_delete(['interfaces', 'dummy', interface])
+ self.cli_delete(base_path + ['name', vrf])
+ self.cli_commit()
+
def test_vrf_disable_forwarding(self):
table = '2000'
for vrf in vrfs: