diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-01-21 20:45:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-21 20:45:55 +0100 |
| commit | 774de4b11330e7d3d30ddf6af0ad75e8be0f7bb3 (patch) | |
| tree | 92725d5ed66c015476ca0ee348d3f71dab82b512 | |
| parent | 0868f3dc7246ea44a1765cee04649cd08c188982 (diff) | |
| parent | 2471f686979fd83bd015f124b6faa66f27b8c9ba (diff) | |
| download | vyos-1x-774de4b11330e7d3d30ddf6af0ad75e8be0f7bb3.tar.gz vyos-1x-774de4b11330e7d3d30ddf6af0ad75e8be0f7bb3.zip | |
Merge pull request #4921 from hedrok/T7664-update-smoketest-script
T7664: support FRR 10.5
| -rw-r--r-- | data/templates/frr/bgpd.frr.j2 | 2 | ||||
| -rw-r--r-- | interface-definitions/include/system-ip-protocol.xml.i | 14 | ||||
| -rw-r--r-- | interface-definitions/include/system-ipv6-protocol.xml.i | 12 | ||||
| -rw-r--r-- | interface-definitions/include/version/system-version.xml.i | 2 | ||||
| -rw-r--r-- | interface-definitions/include/version/vrf-version.xml.i | 2 | ||||
| -rw-r--r-- | smoketest/configs/assert/basic-system-ip-protocol | 30 | ||||
| -rw-r--r-- | smoketest/configs/basic-system-ip-protocol | 302 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_bgp.py | 10 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_segment-routing.py | 22 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_system_ip.py | 3 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_system_ipv6.py | 3 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_vrf.py | 4 | ||||
| -rw-r--r-- | src/migration-scripts/system/30-to-31 | 42 | ||||
| -rw-r--r-- | src/migration-scripts/vrf/3-to-4 | 50 |
14 files changed, 463 insertions, 35 deletions
diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index c952fb0ec..44022f738 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -652,6 +652,8 @@ bgp route-reflector allow-outbound-policy {% endif %} {% if parameters.reject_as_sets is vyos_defined %} bgp reject-as-sets +{% else %} + no bgp reject-as-sets {% endif %} {% if parameters.router_id is vyos_defined and parameters.router_id is not none %} bgp router-id {{ parameters.router_id }} diff --git a/interface-definitions/include/system-ip-protocol.xml.i b/interface-definitions/include/system-ip-protocol.xml.i index c630eb3f7..30d7ab04e 100644 --- a/interface-definitions/include/system-ip-protocol.xml.i +++ b/interface-definitions/include/system-ip-protocol.xml.i @@ -3,7 +3,7 @@ <properties> <help>Filter routing info exchanged between routing protocol and zebra</help> <completionHelp> - <list>any babel bgp connected eigrp isis kernel ospf rip static table</list> + <list>any babel bgp eigrp isis ospf rip static</list> </completionHelp> <valueHelp> <format>any</format> @@ -18,10 +18,6 @@ <description>Border Gateway Protocol</description> </valueHelp> <valueHelp> - <format>connected</format> - <description>Connected routes (directly attached subnet or host)</description> - </valueHelp> - <valueHelp> <format>eigrp</format> <description>Enhanced Interior Gateway Routing Protocol</description> </valueHelp> @@ -30,10 +26,6 @@ <description>Intermediate System to Intermediate System</description> </valueHelp> <valueHelp> - <format>kernel</format> - <description>Kernel routes (not installed via the zebra RIB)</description> - </valueHelp> - <valueHelp> <format>ospf</format> <description>Open Shortest Path First (OSPFv2)</description> </valueHelp> @@ -46,11 +38,11 @@ <description>Statically configured routes</description> </valueHelp> <constraint> - <regex>(any|babel|bgp|connected|eigrp|isis|kernel|ospf|rip|static|table)</regex> + <regex>(any|babel|bgp|eigrp|isis|ospf|rip|static)</regex> </constraint> </properties> <children> #include <include/route-map.xml.i> </children> </tagNode> -<!-- include end -->
\ No newline at end of file +<!-- include end --> diff --git a/interface-definitions/include/system-ipv6-protocol.xml.i b/interface-definitions/include/system-ipv6-protocol.xml.i index 485776a71..1a8123cb2 100644 --- a/interface-definitions/include/system-ipv6-protocol.xml.i +++ b/interface-definitions/include/system-ipv6-protocol.xml.i @@ -3,7 +3,7 @@ <properties> <help>Filter routing info exchanged between routing protocol and zebra</help> <completionHelp> - <list>any babel bgp connected isis kernel ospfv3 ripng static table</list> + <list>any babel bgp isis ospfv3 ripng static</list> </completionHelp> <valueHelp> <format>any</format> @@ -18,18 +18,10 @@ <description>Border Gateway Protocol</description> </valueHelp> <valueHelp> - <format>connected</format> - <description>Connected routes (directly attached subnet or host)</description> - </valueHelp> - <valueHelp> <format>isis</format> <description>Intermediate System to Intermediate System</description> </valueHelp> <valueHelp> - <format>kernel</format> - <description>Kernel routes (not installed via the zebra RIB)</description> - </valueHelp> - <valueHelp> <format>ospfv3</format> <description>Open Shortest Path First (OSPFv3)</description> </valueHelp> @@ -42,7 +34,7 @@ <description>Statically configured routes</description> </valueHelp> <constraint> - <regex>(any|babel|bgp|connected|isis|kernel|ospfv3|ripng|static|table)</regex> + <regex>(any|babel|bgp|isis|ospfv3|ripng|static)</regex> </constraint> </properties> <children> diff --git a/interface-definitions/include/version/system-version.xml.i b/interface-definitions/include/version/system-version.xml.i index a9987e8e4..55764fc40 100644 --- a/interface-definitions/include/version/system-version.xml.i +++ b/interface-definitions/include/version/system-version.xml.i @@ -1,3 +1,3 @@ <!-- include start from include/version/system-version.xml.i --> -<syntaxVersion component='system' version='30'></syntaxVersion> +<syntaxVersion component='system' version='31'></syntaxVersion> <!-- include end --> diff --git a/interface-definitions/include/version/vrf-version.xml.i b/interface-definitions/include/version/vrf-version.xml.i index 9d7ff35fe..1c7c81155 100644 --- a/interface-definitions/include/version/vrf-version.xml.i +++ b/interface-definitions/include/version/vrf-version.xml.i @@ -1,3 +1,3 @@ <!-- include start from include/version/vrf-version.xml.i --> -<syntaxVersion component='vrf' version='3'></syntaxVersion> +<syntaxVersion component='vrf' version='4'></syntaxVersion> <!-- include end --> diff --git a/smoketest/configs/assert/basic-system-ip-protocol b/smoketest/configs/assert/basic-system-ip-protocol new file mode 100644 index 000000000..870ffa8f5 --- /dev/null +++ b/smoketest/configs/assert/basic-system-ip-protocol @@ -0,0 +1,30 @@ +set system ip protocol any route-map 'stub' +set system ip protocol babel route-map 'stub' +set system ip protocol bgp route-map 'stub' +set system ip protocol eigrp route-map 'stub' +set system ip protocol isis route-map 'stub' +set system ip protocol ospf route-map 'stub' +set system ip protocol rip route-map 'stub' +set system ip protocol static route-map 'stub' +set system ipv6 protocol any route-map 'stub' +set system ipv6 protocol babel route-map 'stub' +set system ipv6 protocol bgp route-map 'stub' +set system ipv6 protocol isis route-map 'stub' +set system ipv6 protocol ospfv3 route-map 'stub' +set system ipv6 protocol ripng route-map 'stub' +set system ipv6 protocol static route-map 'stub' +set vrf name red ip protocol any route-map 'stub' +set vrf name red ip protocol babel route-map 'stub' +set vrf name red ip protocol bgp route-map 'stub' +set vrf name red ip protocol eigrp route-map 'stub' +set vrf name red ip protocol isis route-map 'stub' +set vrf name red ip protocol ospf route-map 'stub' +set vrf name red ip protocol rip route-map 'stub' +set vrf name red ip protocol static route-map 'stub' +set vrf name red ipv6 protocol any route-map 'stub' +set vrf name red ipv6 protocol babel route-map 'stub' +set vrf name red ipv6 protocol bgp route-map 'stub' +set vrf name red ipv6 protocol isis route-map 'stub' +set vrf name red ipv6 protocol ospfv3 route-map 'stub' +set vrf name red ipv6 protocol ripng route-map 'stub' +set vrf name red ipv6 protocol static route-map 'stub' diff --git a/smoketest/configs/basic-system-ip-protocol b/smoketest/configs/basic-system-ip-protocol new file mode 100644 index 000000000..84c2c8da7 --- /dev/null +++ b/smoketest/configs/basic-system-ip-protocol @@ -0,0 +1,302 @@ +interfaces { + ethernet eth0 { + address "192.168.0.1/24" + address "fe88::1/56" + duplex "auto" + offload { + gro + gso + sg + tso + } + speed "auto" + } + loopback lo { + } +} +policy { + route-map stub { + } +} +protocols { + static { + arp { + interface eth0 { + address 192.168.0.20 { + mac "00:50:00:00:00:20" + } + address 192.168.0.30 { + mac "00:50:00:00:00:30" + } + address 192.168.0.40 { + mac "00:50:00:00:00:40" + } + } + interface eth2.100 { + address 100.100.0.2 { + mac "00:50:00:00:02:02" + } + address 100.100.0.3 { + mac "00:50:00:00:02:03" + } + address 100.100.0.4 { + mac "00:50:00:00:02:04" + } + } + interface eth2.200 { + address 100.64.200.1 { + mac "00:50:00:00:00:01" + } + address 100.64.200.2 { + mac "00:50:00:00:00:02" + } + } + interface eth2.200.201 { + address 100.64.201.10 { + mac "00:50:00:00:00:10" + } + address 100.64.201.20 { + mac "00:50:00:00:00:20" + } + } + interface eth2.200.202 { + address 100.64.202.30 { + mac "00:50:00:00:00:30" + } + address 100.64.202.40 { + mac "00:50:00:00:00:40" + } + } + } + route 0.0.0.0/0 { + next-hop 100.64.0.1 { + } + } + } +} +system { + config-management { + commit-revisions "100" + } + conntrack { + ignore { + ipv4 { + rule 1 { + destination { + address "192.0.2.2" + } + source { + address "192.0.2.1" + } + } + } + } + modules { + ftp + h323 + nfs + pptp + sip + sqlnet + tftp + } + } + console { + device ttyS0 { + speed "115200" + } + } + host-name "vyos" + ip { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol eigrp { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospf { + route-map "stub" + } + protocol rip { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + ipv6 { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospfv3 { + route-map "stub" + } + protocol ripng { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + login { + user vyos { + authentication { + encrypted-password "$6$O5gJRlDYQpj$MtrCV9lxMnZPMbcxlU7.FI793MImNHznxGoMFgm3Q6QP3vfKJyOSRCt3Ka/GzFQyW1yZS4NS616NLHaIPPFHc0" + plaintext-password "" + } + } + } + name-server "192.168.0.1" + syslog { + console { + facility all { + level "emerg" + } + facility mail { + level "info" + } + } + global { + facility all { + level "info" + } + facility auth { + level "info" + } + facility local7 { + level "debug" + } + marker { + interval "1000" + } + preserve-fqdn + } + host syslog.vyos.net { + facility auth { + level "warning" + } + facility local7 { + level "notice" + } + format { + octet-counted + } + port "8000" + protocol "tcp" + } + } + time-zone "Europe/Berlin" +} +vrf { + name red { + ip { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol eigrp { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospf { + route-map "stub" + } + protocol rip { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + ipv6 { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospfv3 { + route-map "stub" + } + protocol ripng { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + table "1234" + } +} + + +// Warning: Do not remove the following line. +// vyos-config-version: "bgp@6:broadcast-relay@1:cluster@2:config-management@1:conntrack@6:conntrack-sync@2:container@2:dhcp-relay@2:dhcp-server@8:dhcpv6-server@1:dns-dynamic@4:dns-forwarding@4:firewall@15:flow-accounting@1:https@6:ids@1:interfaces@32:ipoe-server@3:ipsec@13:isis@3:l2tp@9:lldp@2:mdns@1:monitoring@1:nat@8:nat66@3:ntp@3:openconnect@3:ospf@2:pim@1:policy@8:pppoe-server@10:pptp@5:qos@2:quagga@11:reverse-proxy@1:rip@1:rpki@2:salt@1:snmp@3:ssh@2:sstp@6:system@27:vrf@3:vrrp@4:vyos-accel-ppp@2:wanloadbalance@3:webproxy@2" +// Release version: 1.4.3 diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index d7c2a924f..06377eee3 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -398,7 +398,9 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.assertIn(f' bgp bestpath compare-routerid', frrconfig) self.assertIn(f' bgp bestpath peer-type multipath-relax', frrconfig) self.assertIn(f' bgp minimum-holdtime {min_hold_time}', frrconfig) - self.assertIn(f' bgp reject-as-sets', frrconfig) + self.assertNotIn( + f'bgp reject-as-sets', frrconfig + ) # default was changed in FRR 10.5 to 'reject-as-sets' self.assertIn(f' bgp route-reflector allow-outbound-policy', frrconfig) self.assertIn(f' no bgp ipv6-auto-ra', frrconfig) self.assertIn(f' bgp shutdown', frrconfig) @@ -425,6 +427,12 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.assertIn(f' maximum-paths {max_path_v6}', afiv6_config) self.assertIn(f' maximum-paths ibgp {max_path_v6ibgp}', afiv6_config) + # Verify reject-as-sets + self.cli_delete(base_path + ['parameters', 'reject-as-sets']) + self.cli_commit() + frrconfig = self.getFRRconfig(f'router bgp {ASN}', stop_section='^exit') + self.assertIn(f'no bgp reject-as-sets', frrconfig) + def test_bgp_02_neighbors(self): # Test out individual neighbor configuration items, not all of them are # also available to a peer-group! diff --git a/smoketest/scripts/cli/test_protocols_segment-routing.py b/smoketest/scripts/cli/test_protocols_segment-routing.py index 8d826f07c..a5c0d5983 100755 --- a/smoketest/scripts/cli/test_protocols_segment-routing.py +++ b/smoketest/scripts/cli/test_protocols_segment-routing.py @@ -57,7 +57,7 @@ class TestProtocolsSegmentRouting(VyOSUnitTestSHIM.TestCase): 'prefix': '2001:d::/48', 'block-len': '32', 'node-len': '16', - 'func-bits': '16', + 'func-bits': '12', 'usid': {}, 'format': 'usid-f3216', }, @@ -131,13 +131,25 @@ class TestProtocolsSegmentRouting(VyOSUnitTestSHIM.TestCase): self.assertIn(' locators', frrconfig) for locator, locator_config in locators.items(): prefix = locator_config['prefix'] - block_len = locator_config.get('block-len', '40') - node_len = locator_config.get('node-len', '24') - func_bits = locator_config.get('func-bits', '16') + block_len = ( + f' block-len {locator_config["block-len"]}' + if 'block-len' in locator_config + else '' + ) + node_len = ( + f' node-len {locator_config["node-len"]}' + if 'node-len' in locator_config + else '' + ) + func_bits = ( + f' func-bits {locator_config["func-bits"]}' + if 'func-bits' in locator_config + else '' + ) self.assertIn(f' locator {locator}', frrconfig) self.assertIn( - f' prefix {prefix} block-len {block_len} node-len {node_len} func-bits {func_bits}', + f' prefix {prefix}{block_len}{node_len}{func_bits}', frrconfig, ) diff --git a/smoketest/scripts/cli/test_system_ip.py b/smoketest/scripts/cli/test_system_ip.py index 3784d4630..25dbeef1d 100755 --- a/smoketest/scripts/cli/test_system_ip.py +++ b/smoketest/scripts/cli/test_system_ip.py @@ -83,8 +83,7 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase): _verify_gc_thres(size) def test_system_ip_protocol_route_map(self): - protocols = ['any', 'babel', 'bgp', 'connected', 'eigrp', 'isis', - 'kernel', 'ospf', 'rip', 'static', 'table'] + protocols = ['any', 'babel', 'bgp', 'eigrp', 'isis', 'ospf', 'rip', 'static'] rule_num = '10' diff --git a/smoketest/scripts/cli/test_system_ipv6.py b/smoketest/scripts/cli/test_system_ipv6.py index 0f94765bd..f7d74eb58 100755 --- a/smoketest/scripts/cli/test_system_ipv6.py +++ b/smoketest/scripts/cli/test_system_ipv6.py @@ -97,8 +97,7 @@ class TestSystemIPv6(VyOSUnitTestSHIM.TestCase): _verify_gc_thres(size) def test_system_ipv6_protocol_route_map(self): - protocols = ['any', 'babel', 'bgp', 'connected', 'isis', - 'kernel', 'ospfv3', 'ripng', 'static', 'table'] + protocols = ['any', 'babel', 'bgp', 'isis', 'ospfv3', 'ripng', 'static'] for protocol in protocols: route_map = 'route-map-' + protocol.replace('ospfv3', 'ospf6') diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py index 9349f43c6..2b364dea3 100755 --- a/smoketest/scripts/cli/test_vrf.py +++ b/smoketest/scripts/cli/test_vrf.py @@ -40,8 +40,8 @@ from vyos.xml_ref import default_value base_path = ['vrf'] vrfs = ['red', 'green', 'blue', 'foo-bar', 'baz_foo'] -v4_protocols = ['any', 'babel', 'bgp', 'connected', 'eigrp', 'isis', 'kernel', 'ospf', 'rip', 'static', 'table'] -v6_protocols = ['any', 'babel', 'bgp', 'connected', 'isis', 'kernel', 'ospfv3', 'ripng', 'static', 'table'] +v4_protocols = ['any', 'babel', 'bgp', 'eigrp', 'isis', 'ospf', 'rip', 'static'] +v6_protocols = ['any', 'babel', 'bgp', 'isis', 'ospfv3', 'ripng', 'static'] class VRFTest(VyOSUnitTestSHIM.TestCase): _interfaces = [] diff --git a/src/migration-scripts/system/30-to-31 b/src/migration-scripts/system/30-to-31 new file mode 100644 index 000000000..3e57b3db6 --- /dev/null +++ b/src/migration-scripts/system/30-to-31 @@ -0,0 +1,42 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7644: +# FRR 10.5 doesn't have ip protocols: +# - connected +# - kernel +# - table +# +# Remove them from +# - system ip protocol +# - system ipv6 protocol + +from vyos.configtree import ConfigTree + +bases = [ + ['system', 'ip', 'protocol'], + ['system', 'ipv6', 'protocol'], +] +remove_ip_protocols = ['connected', 'kernel', 'table'] + +def migrate(config: ConfigTree) -> None: + for base in bases: + if not config.exists(base): + continue + + # Iterate over all ip protocols to remove + for protocol in remove_ip_protocols: + if config.exists(base + [protocol]): + config.delete(base + [protocol]) diff --git a/src/migration-scripts/vrf/3-to-4 b/src/migration-scripts/vrf/3-to-4 new file mode 100644 index 000000000..959b736e5 --- /dev/null +++ b/src/migration-scripts/vrf/3-to-4 @@ -0,0 +1,50 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7664: +# FRR 10.5 doesn't have ip protocols: +# - connected +# - kernel +# - table +# +# Remove them from +# - vrf name VRF ip protocol +# - vrf name VRF ipv6 protocol + +from vyos.configtree import ConfigTree + +subbases = [ + ['ip', 'protocol'], + ['ipv6', 'protocol'], +] +remove_ip_protocols = ['connected', 'kernel', 'table'] + +base = ['vrf', 'name'] + +def migrate(config: ConfigTree) -> None: + if not config.exists(base): + # Nothing to do + return + + for vrf in config.list_nodes(base): + for subbase in subbases: + protocol_base = base + [vrf] + subbase + + if not config.exists(protocol_base): + continue + + for protocol in remove_ip_protocols: + if config.exists(protocol_base + [protocol]): + config.delete(protocol_base + [protocol]) |
