Merge pull request #16895 from opensourcerouting/fix/dual_as_topotest

tests: Simplify BGP dual-as topotest
This commit is contained in:
Russ White 2024-09-24 10:13:14 -04:00 committed by GitHub
commit 74aef8aabd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 33 deletions

View File

@ -4,7 +4,7 @@ interface r2-eth0
!
router bgp 65002
no bgp ebgp-requires-policy
neighbor 10.0.0.1 remote-as 65001
neighbor 10.0.0.1 remote-as 65000
neighbor 10.0.0.1 timers 3 10
neighbor 10.0.0.1 timers connect 1
!

View File

@ -54,38 +54,6 @@ def test_bgp_dual_as():
pytest.skip(tgen.errors)
r1 = tgen.gears["r1"]
r2 = tgen.gears["r2"]
def _bgp_converge_65001():
output = json.loads(r1.vtysh_cmd("show bgp ipv4 summary json"))
expected = {
"ipv4Unicast": {
"as": 65000,
"peers": {
"10.0.0.2": {
"hostname": "r2",
"remoteAs": 65002,
"localAs": 65001,
"state": "Established",
"peerState": "OK",
}
},
}
}
return topotest.json_cmp(output, expected)
test_func = functools.partial(_bgp_converge_65001)
_, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
assert result is None, "Can't establish BGP session using local-as AS 65001"
step("Change remote-as from r2 to use global AS 65000")
r2.vtysh_cmd(
"""
configure terminal
router bgp
neighbor 10.0.0.1 remote-as 65000
"""
)
def _bgp_converge_65000():
output = json.loads(r1.vtysh_cmd("show bgp ipv4 summary json"))