summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-24 15:55:16 +0200
committerChristian Breunig <christian@breunig.cc>2023-08-24 15:55:16 +0200
commit3baba6b477409163fd3520dd8bf806790d4edd6e (patch)
tree1b14c910901babf6f647856fd25dfe1897bae7a5 /smoketest/scripts/cli/test_vrf.py
parentbf7e94a6606c9245721194b7d5c18c24a9f8baef (diff)
downloadvyos-1x-3baba6b477409163fd3520dd8bf806790d4edd6e.tar.gz
vyos-1x-3baba6b477409163fd3520dd8bf806790d4edd6e.zip
system: T5505: fix zebra route-map is not removed from FRR
Configuring "set system ip protocol ospf|bgp route-map foo" and commit it installs the route-map into FRR. Removing the CLI configuration "delete system ip protocol" does not remove the route-map from FRR - it stays active. This commit adds the fix and appropriate smoketests extenstion.
Diffstat (limited to 'smoketest/scripts/cli/test_vrf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 5fb599a87..0f658f366 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -315,6 +315,19 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for protocol in v4_protocols:
self.assertIn(f' ip protocol {protocol} route-map route-map-{vrf}-{protocol}', frrconfig)
+ # Delete route-maps
+ for vrf in vrfs:
+ base = base_path + ['name', vrf]
+ self.cli_delete(['policy', 'route-map', f'route-map-{vrf}-{protocol}'])
+ self.cli_delete(base + ['ip', 'protocol'])
+
+ self.cli_commit()
+
+ # Verify route-map properly is removed from FRR
+ for vrf in vrfs:
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ self.assertNotIn(f'vrf {vrf}', frrconfig)
+
def test_vrf_ip_ipv6_protocol_non_existing_route_map(self):
table = '6100'
non_existing = 'non-existing'
@@ -369,6 +382,19 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
route_map = f'route-map-{vrf}-{protocol}'
self.assertIn(f' ipv6 protocol {protocol} route-map {route_map}', frrconfig)
+ # Delete route-maps
+ for vrf in vrfs:
+ base = base_path + ['name', vrf]
+ self.cli_delete(['policy', 'route-map', f'route-map-{vrf}-{protocol}'])
+ self.cli_delete(base + ['ipv6', 'protocol'])
+
+ self.cli_commit()
+
+ # Verify route-map properly is removed from FRR
+ for vrf in vrfs:
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ self.assertNotIn(f'vrf {vrf}', frrconfig)
+
def test_vrf_vni_duplicates(self):
base_table = '6300'
table = base_table
@@ -463,4 +489,4 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
if __name__ == '__main__':
- unittest.main(verbosity=2)
+ unittest.main(verbosity=2, failfast=True)