From 5845c4b1c50bc0335284cfb3306e0a91de3efd40 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 27 Sep 2025 08:52:13 +0200 Subject: frr: T7875: add pre-apply validation using frr-reload --test Ensures rendered FRR config passes sanity checks before applying. Prevents issues like T7089 where bad template syntax broke routing. Improves robustness and minimizes risk of config-induced outages. --- python/vyos/frrender.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'python') diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index f4ed69205..b3af4bf0a 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -34,6 +34,10 @@ def debug(message): return print(message) +ERROR_RELOAD_TEST: str = 'The system encountered an error while rendering the ' \ + 'new routing daemon configuration. To ensure network stability and avoid ' \ + 'potential connectivity disruptions, the configuration was not applied!' + frr_protocols = ['babel', 'bfd', 'bgp', 'eigrp', 'isis', 'mpls', 'nhrp', 'openfabric', 'ospf', 'ospfv3', 'pim', 'pim6', 'rip', 'ripng', 'rpki', 'segment_routing', 'static'] @@ -748,6 +752,13 @@ class FRRender: return True def apply(self, count_max=5): + # Do a config reload test + cmdline = f'/usr/lib/frr/frr-reload.py --test' + rc, emsg = rc_cmd(f'{cmdline} {self._frr_conf}') + if rc != 0: + debug(emsg) + raise ConfigError(ERROR_RELOAD_TEST) + count = 0 emsg = '' while count < count_max: -- cgit v1.2.3