Current implementation of the checksum offload test suite contains a section in the verify checksum method that causes NameError exceptions when the packet is dropped. Add a try block to encapsulate this section and handle any errors created.
Fixes: 8c9a7471a0e6 ("dts: add checksum offload test suite") Signed-off-by: Dean Marx <dm...@iol.unh.edu> --- dts/tests/TestSuite_checksum_offload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dts/tests/TestSuite_checksum_offload.py b/dts/tests/TestSuite_checksum_offload.py index b03c3d46ed..9dfbcb8028 100644 --- a/dts/tests/TestSuite_checksum_offload.py +++ b/dts/tests/TestSuite_checksum_offload.py @@ -89,8 +89,11 @@ def send_packet_and_verify_checksum( if testpmd_packet.l4_dport == id: is_IP = PacketOffloadFlag.RTE_MBUF_F_RX_IP_CKSUM_GOOD in testpmd_packet.ol_flags is_L4 = PacketOffloadFlag.RTE_MBUF_F_RX_L4_CKSUM_GOOD in testpmd_packet.ol_flags - self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.") - self.verify(is_IP == good_IP, "IP checksum flag did not match expected checksum flag.") + try: + self.verify(is_L4 == good_L4, "Layer 4 checksum flag did not match expected checksum flag.") + self.verify(is_IP == good_IP, "IP checksum flag did not match expected checksum flag.") + except NameError: + self.verify(False, "Test packet was dropped when it should have been received.") def setup_hw_offload(self, testpmd: TestPmdShell) -> None: """Sets IP, UDP, and TCP layers to hardware offload. -- 2.50.1