Skip to content

Commit

Permalink
[advance-reboot] Fix sad case: don't send traffic through down lag in…
Browse files Browse the repository at this point in the history
…terfaces (#4758)

Fix advance-reboot SAD cases in testcase test_warm_reboot_multi_sad.
The cause for failure was when incorrect participating member interfaces in a LAG are selected.
This issue supposedly started after #3853
As part of PR 3853, some of the SAD case handling was moved out of ptf-tests. Due to this, the port selection for some cases is not done on ptf scripts.
Specifically, presently the traffic is sent through even the LAGs which are brought down. This leads to part of the downstream traffic always being dropped - ultimately leading to warm-up failure.
  • Loading branch information
vaibhavhd authored Nov 28, 2021
1 parent f432e55 commit 2942b97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
8 changes: 6 additions & 2 deletions ansible/roles/test/files/ptftests/advanced-reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,13 @@ def read_vlan_portchannel_ports(self):
ports_in_vlan.append(self.port_indices[ifname])
ports_per_vlan[vlan] = ports_in_vlan

active_portchannels = list()
for neighbor_info in list(self.vm_dut_map.values()):
active_portchannels.append(neighbor_info["dut_portchannel"])

pc_ifaces = []
for pc in portchannel_content.values():
if not pc['name'] in pc_in_vlan:
if not pc['name'] in pc_in_vlan and pc['name'] in active_portchannels:
pc_ifaces.extend([self.port_indices[member] for member in pc['members']])

return ports_per_vlan, pc_ifaces
Expand Down Expand Up @@ -532,12 +536,12 @@ def setUp(self):
self.fails['dut'] = set()
self.port_indices = self.read_port_indices()
self.vlan_ip_range = ast.literal_eval(self.test_params['vlan_ip_range'])
self.build_peer_mapping()
self.ports_per_vlan, self.portchannel_ports = self.read_vlan_portchannel_ports()
self.vlan_ports = []
for ports in self.ports_per_vlan.values():
self.vlan_ports += ports
if self.sad_oper:
self.build_peer_mapping()
self.test_params['vlan_if_port'] = self.build_vlan_if_port_mapping()

self.default_ip_range = self.test_params['default_ip_range']
Expand Down
7 changes: 4 additions & 3 deletions tests/common/fixtures/advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ def runRebootTest(self):
"Advanced-reboot failure. Failed cases: {}".format(failed_list))
return result

def runRebootTestcase(self, prebootList=None, inbootList=None, prebootFiles=None):
def runRebootTestcase(self, prebootList=None, inbootList=None,
prebootFiles='peer_dev_info,neigh_port_info'):
'''
This method validates and prepares test bed for reboot test case. It runs the reboot test case using provided
test arguments
Expand Down Expand Up @@ -518,7 +519,8 @@ def __runPtfRunner(self, rebootOper=None):
"vnet_pkts" : self.vnetPkts,
"bgp_v4_v6_time_diff": self.bgpV4V6TimeDiff,
"asic_type": self.duthost.facts["asic_type"],
"allow_mac_jumping": self.allowMacJump
"allow_mac_jumping": self.allowMacJump,
"preboot_files" : self.prebootFiles
}

if not isinstance(rebootOper, SadOperation):
Expand All @@ -529,7 +531,6 @@ def __runPtfRunner(self, rebootOper=None):
# presence of routing in reboot operation indicates it is during reboot operation (inboot)
inbootOper = rebootOper if rebootOper is not None and 'routing' in rebootOper else None
params.update({
"preboot_files" : self.prebootFiles,
"preboot_oper" : prebootOper,
"inboot_oper" : inbootOper,
})
Expand Down
21 changes: 7 additions & 14 deletions tests/platform_tests/test_advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def test_warm_reboot_sad(request, get_advanced_reboot, verify_dut_health,
]

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)


Expand Down Expand Up @@ -162,8 +161,7 @@ def test_warm_reboot_multi_sad(request, get_advanced_reboot, verify_dut_health,
] if advancedReboot.getTestbedType() in ['t0-64', 't0-116', 't0-64-32'] else [])

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)


Expand All @@ -184,8 +182,7 @@ def test_warm_reboot_multi_sad_inboot(request, get_advanced_reboot, verify_dut_h
]

advancedReboot.runRebootTestcase(
inbootList=inbootList,
prebootFiles='peer_dev_info,neigh_port_info'
inbootList=inbootList
)


Expand All @@ -204,8 +201,7 @@ def test_warm_reboot_sad_bgp(request, get_advanced_reboot, verify_dut_health,
]

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)


Expand Down Expand Up @@ -236,8 +232,7 @@ def test_warm_reboot_sad_lag_member(request, get_advanced_reboot, verify_dut_hea
] if advancedReboot.getTestbedType() in ['t0-64', 't0-116', 't0-64-32'] else [])

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)


Expand All @@ -256,8 +251,7 @@ def test_warm_reboot_sad_lag(request, get_advanced_reboot, verify_dut_health,
]

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)


Expand All @@ -276,6 +270,5 @@ def test_warm_reboot_sad_vlan_port(request, get_advanced_reboot, verify_dut_heal
]

advancedReboot.runRebootTestcase(
prebootList=prebootList,
prebootFiles='peer_dev_info,neigh_port_info'
prebootList=prebootList
)

0 comments on commit 2942b97

Please sign in to comment.