Tests: Refactor payload_to_info()

All callers of payload_to_info were required to wrap payload with str().
Refactor to call scapy's payload.load for raw payloads or specify the
specific fieldname.

Change-Id: I1c80599d4df8dc129dbb8274733afaad406d5bcf
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:
Paul Vinciguerra
2019-03-06 11:58:06 -08:00
committed by Ole Trøan
parent ea2450fa2d
commit eaea421e1f
22 changed files with 34 additions and 32 deletions

View File

@@ -138,7 +138,7 @@ class TestECMP(VppTestCase):
for packet in capture:
try:
ip_received = packet[ip_l]
payload_info = self.payload_to_info(str(packet[Raw]))
payload_info = self.payload_to_info(packet[Raw])
packet_index = payload_info.index
ip_sent = self._packet_infos[packet_index].data[ip_l]
self.logger.debug("Got packet on port %s: src=%u (id=%u)" %