diff options
author | Fangyin Hu <fangyinx.hu@intel.com> | 2017-06-26 20:34:56 -0700 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2017-07-05 05:54:29 +0000 |
commit | 050ece3a87fbbad7d04e69ed951c48118edf0a89 (patch) | |
tree | 66ed8e4ede224e60e277cb366844f3edb1079539 /resources/libraries/python/SFC/VerifyPacket.py | |
parent | a097c8748051f82e36b3cc3049bf3e596c2252a4 (diff) |
Change the bootstrap script file and test the CI-management.
Debug the NSH SFC functional test.
Change the test cases and not use the tcpdump.
Delete the unused code.
Change the directory structure.
Change-Id: I52486b9ba4b02e305f702ffc8cdb84e941cb18ff
Signed-off-by: Fangyin Hu <fangyinx.hu@intel.com>
Diffstat (limited to 'resources/libraries/python/SFC/VerifyPacket.py')
-rw-r--r-- | resources/libraries/python/SFC/VerifyPacket.py | 21 |
1 files changed, 6 insertions, 15 deletions
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 |