X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FSFC%2FVerifyPacket.py;fp=resources%2Flibraries%2Fpython%2FSFC%2FVerifyPacket.py;h=fd72bb296b716e5c1c3b5872a125af8359e57007;hp=66bd09899d19c012c27c7b51ca708c5df319f9b9;hb=050ece3a87fbbad7d04e69ed951c48118edf0a89;hpb=a097c8748051f82e36b3cc3049bf3e596c2252a4 diff --git a/resources/libraries/python/SFC/VerifyPacket.py b/resources/libraries/python/SFC/VerifyPacket.py index 66bd09899d..fd72bb296b 100644 --- a/resources/libraries/python/SFC/VerifyPacket.py +++ b/resources/libraries/python/SFC/VerifyPacket.py @@ -20,7 +20,6 @@ import ipaddress from scapy.layers.inet import IP, UDP from scapy.all import Raw -from scapy.utils import rdpcap from resources.libraries.python.constants import Constants as con from resources.libraries.python.SFC.SFCConstants import SFCConstants as sfccon from resources.libraries.python.SFC.TunnelProtocol import VxLAN, VxLANGPE, NSH @@ -157,31 +156,23 @@ class VerifyPacket(object): @staticmethod - def check_the_nsh_sfc_packet(frame_size, test_type): + def check_the_nsh_sfc_packet(ether, frame_size, test_type): """ verify the NSH SFC functional test loopback packet field is correct. - :param frame_size: the origin frame size. - :param test_type: the test type. + :param ether: The Ethernet packet data. + :param frame_size: The origin frame size. + :param test_type: The test type. (Classifier, Proxy Inbound, Proxy Outbound, SFF). + + :type ether: scapy.Ether :type frame_size: Integer :type test_type: str :returns: none :raises RuntimeError: If the packet field verify fails. """ - rx_pcapfile = '{0}/nsh_sfc_tests/sfc_scripts/temp_packet.pcap' \ - .format(con.REMOTE_FW_DIR) - - logger.trace('read pcap file:{0}'.format(rx_pcapfile)) - - packets = rdpcap(rx_pcapfile) - if len(packets) < 1: - raise RuntimeError("No packet is received!") - - ether = packets[0] - origin_size = int(frame_size) if test_type == "Classifier": expect_pkt_len = origin_size + 74 - 4