Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test_macsec]: Increase bgp test timeout #6261

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/macsec/test_macsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def test_bgp(self, duthost, ctrl_links, upstream_links, profile_name):
"BGP_NEIGHBOR"].values()[0]
BGP_KEEPALIVE = int(bgp_config["keepalive"])
BGP_HOLDTIME = int(bgp_config["holdtime"])
BGP_TIMEOUT = 90

def check_bgp_established(up_link):
command = "sonic-db-cli STATE_DB HGETALL 'NEIGH_STATE_TABLE|{}'".format(
Expand All @@ -441,32 +442,32 @@ def check_bgp_established(up_link):

# Ensure the BGP sessions have been established
for ctrl_port in ctrl_links.keys():
assert wait_until(30, 5, 0,
assert wait_until(BGP_TIMEOUT, 5, 0,
check_bgp_established, upstream_links[ctrl_port])

# Check the BGP sessions are present after port macsec disabled
for ctrl_port, nbr in ctrl_links.items():
disable_macsec_port(duthost, ctrl_port)
disable_macsec_port(nbr["host"], nbr["port"])
wait_until(20, 3, 0,
wait_until(BGP_TIMEOUT, 3, 0,
lambda: not duthost.iface_macsec_ok(ctrl_port) and
not nbr["host"].iface_macsec_ok(nbr["port"]))
# BGP session should keep established even after holdtime
assert wait_until(BGP_HOLDTIME * 2, BGP_KEEPALIVE, BGP_HOLDTIME,
assert wait_until(BGP_TIMEOUT, BGP_KEEPALIVE, BGP_HOLDTIME,
check_bgp_established, upstream_links[ctrl_port])

# Check the BGP sessions are present after port macsec enabled
for ctrl_port, nbr in ctrl_links.items():
enable_macsec_port(duthost, ctrl_port, profile_name)
enable_macsec_port(nbr["host"], nbr["port"], profile_name)
wait_until(20, 3, 0,
wait_until(BGP_TIMEOUT, 3, 0,
lambda: duthost.iface_macsec_ok(ctrl_port) and
nbr["host"].iface_macsec_ok(nbr["port"]))
# Wait PortChannel up, which might flap if having one port member
wait_until(20, 5, 5, lambda: find_portchannel_from_member(
wait_until(BGP_TIMEOUT, 5, 5, lambda: find_portchannel_from_member(
ctrl_port, get_portchannel(duthost))["status"] == "Up")
# BGP session should keep established even after holdtime
assert wait_until(BGP_HOLDTIME * 2, BGP_KEEPALIVE, BGP_HOLDTIME,
assert wait_until(BGP_TIMEOUT, BGP_KEEPALIVE, BGP_HOLDTIME,
check_bgp_established, upstream_links[ctrl_port])

def test_snmp(self, duthost, ctrl_links, upstream_links, creds):
Expand Down