summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-03-27 22:36:32 +0200
committerChristian Breunig <christian@breunig.cc>2023-03-27 22:47:02 +0200
commit35126e6b41b212aafb2784dee7577b0682bb3af5 (patch)
tree47680dd208b1872cdde9b9e2c89fde6f40a1d700
parentf8522f323ec26a2a1507a6026cbc939bb8960262 (diff)
downloadvyos-1x-35126e6b41b212aafb2784dee7577b0682bb3af5.tar.gz
vyos-1x-35126e6b41b212aafb2784dee7577b0682bb3af5.zip
bgp: T5114: add peer-group "port" CLI command
-rw-r--r--interface-definitions/include/bgp/protocol-common-config.xml.i16
-rw-r--r--interface-definitions/include/bgp/timers-holdtime.xml.i4
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py9
3 files changed, 11 insertions, 18 deletions
diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i
index 9435b45fd..aa9cd5850 100644
--- a/interface-definitions/include/bgp/protocol-common-config.xml.i
+++ b/interface-definitions/include/bgp/protocol-common-config.xml.i
@@ -1008,18 +1008,6 @@
#include <include/bgp/neighbor-passive.xml.i>
#include <include/bgp/neighbor-password.xml.i>
#include <include/bgp/peer-group.xml.i>
- <leafNode name="port">
- <properties>
- <help>Neighbor BGP port</help>
- <valueHelp>
- <format>u32:1-65535</format>
- <description>Neighbor BGP port number</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 1-65535"/>
- </constraint>
- </properties>
- </leafNode>
#include <include/bgp/remote-as.xml.i>
#include <include/bgp/neighbor-shutdown.xml.i>
<leafNode name="solo">
@@ -1061,6 +1049,7 @@
</node>
#include <include/bgp/neighbor-ttl-security.xml.i>
#include <include/bgp/neighbor-update-source.xml.i>
+ #include <include/port-number.xml.i>
</children>
</tagNode>
<node name="parameters">
@@ -1524,10 +1513,11 @@
#include <include/bgp/neighbor-override-capability.xml.i>
#include <include/bgp/neighbor-passive.xml.i>
#include <include/bgp/neighbor-password.xml.i>
- #include <include/bgp/remote-as.xml.i>
#include <include/bgp/neighbor-shutdown.xml.i>
#include <include/bgp/neighbor-ttl-security.xml.i>
#include <include/bgp/neighbor-update-source.xml.i>
+ #include <include/bgp/remote-as.xml.i>
+ #include <include/port-number.xml.i>
</children>
</tagNode>
#include <include/route-map.xml.i>
diff --git a/interface-definitions/include/bgp/timers-holdtime.xml.i b/interface-definitions/include/bgp/timers-holdtime.xml.i
index 9e86ab13d..31e97f6b8 100644
--- a/interface-definitions/include/bgp/timers-holdtime.xml.i
+++ b/interface-definitions/include/bgp/timers-holdtime.xml.i
@@ -1,14 +1,14 @@
<!-- include start from bgp/timers-holdtime.xml.i -->
<leafNode name="holdtime">
<properties>
- <help>BGP hold timer for this neighbor</help>
+ <help>Hold timer</help>
<valueHelp>
<format>u32:1-65535</format>
<description>Hold timer in seconds</description>
</valueHelp>
<valueHelp>
<format>0</format>
- <description>Hold timer disabled</description>
+ <description>Disable hold timer</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 0-65535"/>
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 4047ea8f4..d024ea92a 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -132,7 +132,8 @@ peer_group_config = {
},
'bar' : {
'remote_as' : '111',
- 'graceful_rst_no' : ''
+ 'graceful_rst_no' : '',
+ 'port' : '667',
},
'foo-bar' : {
'advertise_map' : route_map_in,
@@ -237,6 +238,8 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' neighbor {peer} passive', frrconfig)
if 'password' in peer_config:
self.assertIn(f' neighbor {peer} password {peer_config["password"]}', frrconfig)
+ if 'port' in peer_config:
+ self.assertIn(f' neighbor {peer} port {peer_config["port"]}', frrconfig)
if 'remote_as' in peer_config:
self.assertIn(f' neighbor {peer} remote-as {peer_config["remote_as"]}', frrconfig)
if 'solo' in peer_config:
@@ -463,8 +466,6 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
for peer, peer_config in neighbor_config.items():
if 'adv_interv' in peer_config:
self.assertIn(f' neighbor {peer} advertisement-interval {peer_config["adv_interv"]}', frrconfig)
- if 'port' in peer_config:
- self.assertIn(f' neighbor {peer} port {peer_config["port"]}', frrconfig)
if 'cap_strict' in peer_config:
self.assertIn(f' neighbor {peer} strict-capability-match', frrconfig)
@@ -500,6 +501,8 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.cli_set(base_path + ['peer-group', peer_group, 'passive'])
if 'password' in config:
self.cli_set(base_path + ['peer-group', peer_group, 'password', config["password"]])
+ if 'port' in config:
+ self.cli_set(base_path + ['peer-group', peer_group, 'port', config["port"]])
if 'remote_as' in config:
self.cli_set(base_path + ['peer-group', peer_group, 'remote-as', config["remote_as"]])
if 'shutdown' in config: