Skip to content
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
29 changes: 26 additions & 3 deletions ansible/roles/test/files/ptftests/py3/advanced-reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,10 @@ def handle_post_reboot_test_reports(self):
self.assertTrue(is_good, errors)

def runTest(self):
# Set LACP timer multiplier to 5 for cEOS peers
if self.test_params['neighbor_type'] == "eos":
self.ceos_set_lacp_all_neighs(5)

self.pre_reboot_test_setup()
try:
self.log("Check that device is alive and pinging")
Expand Down Expand Up @@ -1453,8 +1457,29 @@ def runTest(self):
traceback_msg = traceback.format_exc()
self.fails['dut'].add(traceback_msg)
finally:
# Restore cEOS LACP timer multiplier to default (3)
if self.test_params['neighbor_type'] == "eos":
self.ceos_set_lacp_all_neighs(3)

self.handle_post_reboot_test_reports()

def ceos_set_lacp_all_neighs(self, multiplier):
for neigh in self.ssh_targets:
self.neigh_handle = HostDevice.getHostDeviceInstance(
self.test_params['neighbor_type'], neigh, None, self.test_params)
self.neigh_handle.connect()

raw_json = self.neigh_handle.do_cmd("show lacp interface | json")
neigh_int_json = json.loads(raw_json[raw_json.find("{"):raw_json.rfind("}")+1])

self.neigh_handle.do_cmd("config")
for lag in neigh_int_json["portChannels"]:
for neigh_int in neigh_int_json["portChannels"][lag]['interfaces']:
self.neigh_handle.do_cmd(f"interface {neigh_int}")
self.neigh_handle.do_cmd(f"lacp timer multiplier {multiplier}")

self.neigh_handle.disconnect()

def neigh_lag_status_check(self):
"""
Ensure there are no interface flaps after warm-boot
Expand Down Expand Up @@ -1720,9 +1745,7 @@ def peer_state_check(self, ip, queue):

# in the list of all LACPDUs received by T1, find the largest time gap between two consecutive LACPDUs
max_lacp_session_wait = None
max_allowed_lacp_session_wait = 90
if self.test_params['neighbor_type'] == "sonic":
max_allowed_lacp_session_wait = 150
max_allowed_lacp_session_wait = 150
if lacp_pdu_all_times and len(lacp_pdu_all_times) > 1:
lacp_pdu_all_times.sort()
max_lacp_session_wait = 0
Expand Down
Loading