mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 22:37:49 +00:00
bgp-ecmp-topo: test BGP convergence
Add a test that waits for BGP convergence.
This commit is contained in:
parent
62271fe3fa
commit
35a00f240f
112
tests/topotests/bgp-ecmp-topo1/r1/summary.txt
Normal file
112
tests/topotests/bgp-ecmp-topo1/r1/summary.txt
Normal file
@ -0,0 +1,112 @@
|
||||
{
|
||||
"ipv4Unicast":{
|
||||
"routerId":"10.0.255.1",
|
||||
"as":100,
|
||||
"vrfId":0,
|
||||
"vrfName":"Default",
|
||||
"peerCount":20,
|
||||
"peers":{
|
||||
"10.0.1.101":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.1.102":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.1.103":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.1.104":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.1.105":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.2.106":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.2.107":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.2.108":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.2.109":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.2.110":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.3.111":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.3.112":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.3.113":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.3.114":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.3.115":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.4.116":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.4.117":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.4.118":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.4.119":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
},
|
||||
"10.0.4.120":{
|
||||
"outq":0,
|
||||
"inq":0,
|
||||
"state":"Established"
|
||||
}
|
||||
},
|
||||
"totalPeers":20
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@
|
||||
test_bgp_ecmp_topo1.py: Test BGP topology with ECMP (Equal Cost MultiPath).
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import pytest
|
||||
@ -114,6 +115,30 @@ def teardown_module(module):
|
||||
tgen = get_topogen()
|
||||
tgen.stop_topology()
|
||||
|
||||
def test_bgp_convergence():
|
||||
"Test for BGP topology convergence"
|
||||
tgen = get_topogen()
|
||||
|
||||
# Skip if previous fatal error condition is raised
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
|
||||
topotest.sleep(20, 'waiting for bgp convergence')
|
||||
|
||||
# Expected result
|
||||
reffile = os.path.join(CWD, 'r1/summary.txt')
|
||||
expected = json.loads(open(reffile).read())
|
||||
|
||||
# Define test function and call it
|
||||
router = tgen.gears['r1']
|
||||
def _convergence_test():
|
||||
output = router.vtysh_cmd('show ip bgp summary json', isjson=True)
|
||||
return topotest.json_cmp(output, expected)
|
||||
|
||||
_, res = topotest.run_and_expect(_convergence_test, None, count=10, wait=1)
|
||||
assertmsg = 'BGP router network did not converge'
|
||||
assert res is None, assertmsg
|
||||
|
||||
def test_bgp_ecmp():
|
||||
tgen = get_topogen()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user