summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-11-08 09:11:41 +0200
committerGitHub <noreply@github.com>2024-11-08 09:11:41 +0200
commita85dce2c6652cbe4ec4dbc2bc6ad7cbf9737265e (patch)
treea712a2c9ce19e4f5e819be85146693af21fd19e1 /tests
parentaf9a2cb875e699078a307e119a0009ae18eb26eb (diff)
parent9fa56a03c7568cb9b74f31386baef5252c5b66ce (diff)
Merge pull request #17341 from zice312963205/zly_tcpmss
bgpd:support tcp-mss for neighbor group
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/bgp_tcp_mss/r1/bgpd.conf3
-rw-r--r--tests/topotests/bgp_tcp_mss/r1/zebra.conf3
-rw-r--r--tests/topotests/bgp_tcp_mss/r2/bgpd.conf3
-rw-r--r--tests/topotests/bgp_tcp_mss/r2/zebra.conf3
-rw-r--r--tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py34
5 files changed, 40 insertions, 6 deletions
diff --git a/tests/topotests/bgp_tcp_mss/r1/bgpd.conf b/tests/topotests/bgp_tcp_mss/r1/bgpd.conf
index 07cfe2e2f1..12e5df28ee 100644
--- a/tests/topotests/bgp_tcp_mss/r1/bgpd.conf
+++ b/tests/topotests/bgp_tcp_mss/r1/bgpd.conf
@@ -1,5 +1,8 @@
router bgp 65000
no bgp ebgp-requires-policy
+ neighbor aaa peer-group
+ neighbor aaa remote-as 65001
+ neighbor 192.168.254.2 peer-group aaa
neighbor 192.168.255.2 remote-as 65001
neighbor 192.168.255.2 timers 3 10
exit-address-family
diff --git a/tests/topotests/bgp_tcp_mss/r1/zebra.conf b/tests/topotests/bgp_tcp_mss/r1/zebra.conf
index 6e9b0b4a7e..57958c4420 100644
--- a/tests/topotests/bgp_tcp_mss/r1/zebra.conf
+++ b/tests/topotests/bgp_tcp_mss/r1/zebra.conf
@@ -2,5 +2,8 @@
interface r1-eth0
ip address 192.168.255.1/24
!
+interface r1-eth1
+ ip address 192.168.254.1/24
+!
ip forwarding
!
diff --git a/tests/topotests/bgp_tcp_mss/r2/bgpd.conf b/tests/topotests/bgp_tcp_mss/r2/bgpd.conf
index b2d945583c..8a5a4062a4 100644
--- a/tests/topotests/bgp_tcp_mss/r2/bgpd.conf
+++ b/tests/topotests/bgp_tcp_mss/r2/bgpd.conf
@@ -1,5 +1,8 @@
router bgp 65001
no bgp ebgp-requires-policy
+ neighbor aaa peer-group
+ neighbor aaa remote-as 65000
+ neighbor 192.168.254.1 peer-group aaa
neighbor 192.168.255.1 remote-as 65000
neighbor 192.168.255.1 timers 3 10
exit-address-family
diff --git a/tests/topotests/bgp_tcp_mss/r2/zebra.conf b/tests/topotests/bgp_tcp_mss/r2/zebra.conf
index 6c14de583b..f2daa523ac 100644
--- a/tests/topotests/bgp_tcp_mss/r2/zebra.conf
+++ b/tests/topotests/bgp_tcp_mss/r2/zebra.conf
@@ -2,5 +2,8 @@
interface r2-eth0
ip address 192.168.255.2/24
!
+interface r2-eth1
+ ip address 192.168.254.2/24
+!
ip forwarding
!
diff --git a/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py b/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py
index 37949cdc99..30449a3920 100644
--- a/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py
+++ b/tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py
@@ -45,6 +45,10 @@ def build_topo(tgen):
switch.add_link(tgen.gears["r1"])
switch.add_link(tgen.gears["r2"])
+ switch = tgen.add_switch("s2")
+ switch.add_link(tgen.gears["r1"])
+ switch.add_link(tgen.gears["r2"])
+
def setup_module(mod):
tgen = Topogen(build_topo, mod.__name__)
@@ -78,12 +82,16 @@ def test_bgp_tcp_mss():
router2 = tgen.gears["r2"]
def _bgp_converge(router):
- output = json.loads(router.vtysh_cmd("show ip bgp neighbor 192.168.255.2 json"))
+ output = json.loads(router.vtysh_cmd("show ip bgp neighbor json"))
expected = {
"192.168.255.2": {
"bgpState": "Established",
"addressFamilyInfo": {"ipv4Unicast": {"acceptedPrefixCounter": 0}},
- }
+ },
+ "192.168.254.2": {
+ "bgpState": "Established",
+ "addressFamilyInfo": {"ipv4Unicast": {"acceptedPrefixCounter": 0}},
+ },
}
return topotest.json_cmp(output, expected)
@@ -108,7 +116,7 @@ def test_bgp_tcp_mss():
logger.info("Check if neighbor sessions are up in {}".format(router1.name))
test_func = functools.partial(_bgp_converge, router1)
- _, result = topotest.run_and_expect(test_func, None, count=15, wait=0.5)
+ _, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
assert result is None, 'Failed to see BGP convergence in "{}"'.format(router1.name)
logger.info("BGP neighbor session is up in {}".format(router1.name))
@@ -117,19 +125,21 @@ def test_bgp_tcp_mss():
"Configure tcp-mss 500 on {} and reset the session".format(router1.name)
)
_bgp_conf_tcp_mss(router1, "65000", "192.168.255.2")
+ _bgp_conf_tcp_mss(router1, "65000", "aaa")
_bgp_clear_session(router1)
logger.info(
"Configure tcp-mss 500 on {} and reset the session".format(router2.name)
)
_bgp_conf_tcp_mss(router2, "65001", "192.168.255.1")
+ _bgp_conf_tcp_mss(router2, "65001", "aaa")
_bgp_clear_session(router2)
logger.info(
"Check if neighbor session is up after reset in {}".format(router1.name)
)
test_func = functools.partial(_bgp_converge, router1)
- _, result = topotest.run_and_expect(test_func, None, count=15, wait=0.5)
+ _, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
assert result is None, 'Failed to see BGP convergence after reset in "{}"'.format(
router1.name
)
@@ -138,7 +148,13 @@ def test_bgp_tcp_mss():
"Verify if TCP MSS value is synced with neighbor in {}".format(router1.name)
)
test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router1, "192.168.255.2")
- _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ _, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
+ assert (
+ result is None
+ ), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router1.name)
+
+ test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router1, "192.168.254.2")
+ success, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
assert (
result is None
), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router1.name)
@@ -148,7 +164,13 @@ def test_bgp_tcp_mss():
"Verify if TCP MSS value is synced with neighbor in {}".format(router2.name)
)
test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router2, "192.168.255.1")
- _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ _, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
+ assert (
+ result is None
+ ), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router2.name)
+
+ test_func = functools.partial(_bgp_check_neighbor_tcp_mss, router2, "192.168.254.1")
+ success, result = topotest.run_and_expect(test_func, None, count=15, wait=1)
assert (
result is None
), 'Failed to sync TCP MSS value over BGP session in "{}"'.format(router2.name)