From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC6ADA0093; Mon, 7 Mar 2022 08:58:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93AFA4068F; Mon, 7 Mar 2022 08:58:11 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 0330C40040 for ; Mon, 7 Mar 2022 08:58:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646639890; x=1678175890; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=r82Iub1AwhMHbVtyRiUNVrCTyN1L19PlSequbp4X4iw=; b=Oqxwu0SdwZaxbd9U0uvN2yJC6+nXEioPV9rozvqczaO70FphtXlK9Ewb HxlVCrsG+ZaBBdzhb7ZkjAKIk7qHf4D39r2a1mqKSlQPVBoGXKIEqFHdT nMw08exYcrePCcEG5WMAPEtBXu9rPgArtehaAenm7WF0M7uNfHHlMWx2k bgxK/2VlJpiDJRrMOSzneiUIBnzi6EMc0LdzJeyY6/BVTIUvByYIvbexc 9tsTINoXaRE5F9B9zK0tbswcBQrL+LHw06rZgV1EgaZmP9KeWDaOidoXM 1podTt+OGpQrKHm4Kf5X/WZt+FKO57oFhll+eAn6TlYY+nHuiWV8pZPfF A==; X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="315044827" X-IronPort-AV: E=Sophos;i="5.90,161,1643702400"; d="scan'208";a="315044827" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2022 23:58:09 -0800 X-IronPort-AV: E=Sophos;i="5.90,161,1643702400"; d="scan'208";a="687459318" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2022 23:58:07 -0800 From: Jun Dong To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [V1] framework/*: Remove Dot1BR related code Date: Mon, 7 Mar 2022 15:58:01 +0800 Message-Id: <20220307075801.5592-1-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Signed-off-by: Jun Dong --- framework/packet.py | 32 +---------------------------- framework/tester.py | 4 ---- tests/TestSuite_generic_flow_api.py | 8 +------- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/framework/packet.py b/framework/packet.py index 787cfaee..99dc7159 100644 --- a/framework/packet.py +++ b/framework/packet.py @@ -56,7 +56,6 @@ from scapy.packet import Raw from scapy.sendrecv import sendp from scapy.utils import hexstr, rdpcap, wrpcap -from dep.scapy_modules.Dot1BR import Dot1BR from .utils import convert_int2ip, convert_ip2int, get_module_path @@ -69,13 +68,8 @@ TMP_PATH = DTS_PATH[:-1] + '/output/tmp/pcap/' if exec_file.endswith('.pyc') els if not os.path.exists(TMP_PATH): os.system('mkdir -p %s' % TMP_PATH) -# copy dep/Dot1BR to scapy -_contrib_module_path = get_module_path('scapy.contrib') -shutil.copy(DTS_PATH + '/dep/scapy_modules/Dot1BR.py', _contrib_module_path) - scapy_modules_required = {'scapy.contrib.gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'], 'scapy.contrib.lldp': ['LLDPDU', 'LLDPDUManagementAddress'], - 'scapy.contrib.Dot1BR': ['Dot1BR'], 'scapy.contrib.pfcp': ['PFCP'], 'scapy.contrib.nsh': ['NSH'], 'scapy.contrib.igmp': ['IGMP'], @@ -101,7 +95,7 @@ def get_scapy_module_impcmd(): PACKETGEN = "scapy" LayersTypes = { - "L2": ['ether', 'vlan', 'etag', '1588', 'arp', 'lldp', 'mpls', 'nsh'], + "L2": ['ether', 'vlan', '1588', 'arp', 'lldp', 'mpls', 'nsh'], # ipv4_ext_unknown, ipv6_ext_unknown "L3": ['ipv4', 'ipv4ihl', 'ipv6', 'ipv4_ext', 'ipv6_ext', 'ipv6_ext2', 'ipv6_frag'], "L4": ['tcp', 'udp', 'frag', 'sctp', 'icmp', 'nofrag'], @@ -142,7 +136,6 @@ class scapy(object): SCAPY_LAYERS = { 'ether': Ether(dst="ff:ff:ff:ff:ff:ff"), 'vlan': Dot1Q(), - 'etag': Dot1BR(), '1588': Ether(type=0x88f7), 'arp': ARP(), 'ipv4': IP(), @@ -234,24 +227,6 @@ class scapy(object): value = int(str(self.pkts[p_index][Dot1Q].vlan)) return value - def etag(self, pkt_layer, ECIDbase=0, prio=0, type=None): - if pkt_layer.name != "802.1BR": - return - pkt_layer.ECIDbase = int(ECIDbase) - pkt_layer.prio = prio - if type is not None: - pkt_layer.type = type - - def strip_etag(self, element, p_index=0): - value = None - - if self.pkts[p_index].haslayer('Dot1BR') == 0: - return None - - if element == 'ECIDbase': - value = int(str(self.pkts[p_index][Dot1BR].ECIDbase)) - return value - def strip_layer2(self, element, p_index=0): value = None layer = self.pkts[p_index].getlayer(0) @@ -416,7 +391,6 @@ class Packet(object): 'TCP': {'layers': ['ether', 'ipv4', 'tcp', 'raw'], 'cfgload': True}, 'UDP': {'layers': ['ether', 'ipv4', 'udp', 'raw'], 'cfgload': True}, 'VLAN_UDP': {'layers': ['ether', 'vlan', 'ipv4', 'udp', 'raw'], 'cfgload': True}, - 'ETAG_UDP': {'layers': ['ether', 'etag', 'ipv4', 'udp', 'raw'], 'cfgload': True}, 'SCTP': {'layers': ['ether', 'ipv4', 'sctp', 'raw'], 'cfgload': True}, 'IPv6_TCP': {'layers': ['ether', 'ipv6', 'tcp', 'raw'], 'cfgload': True}, 'IPv6_UDP': {'layers': ['ether', 'ipv6', 'udp', 'raw'], 'cfgload': True}, @@ -812,7 +786,6 @@ class Packet(object): name2type = { 'MAC': 'ether', 'VLAN': 'vlan', - 'ETAG': 'etag', 'IP': 'ipv4', 'IPv4-TUNNEL': 'inner_ipv4', 'IPihl': 'ipv4ihl', @@ -936,9 +909,6 @@ class Packet(object): def strip_element_vlan(self, element, p_index=0): return self.pktgen.strip_vlan(element, p_index) - def strip_element_etag(self, element, p_index=0): - return self.pktgen.strip_etag(element, p_index) - def strip_element_layer4(self, element, p_index=0): return self.pktgen.strip_layer4(element, p_index) diff --git a/framework/tester.py b/framework/tester.py index ff3ecb61..43a6a595 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -113,10 +113,6 @@ class Tester(Crb): scapy_module_path = session.session.send_expect("os.path.dirname(sys.modules['scapy'].__file__)", '>>>') contrib_module_path = scapy_module_path.replace("'", "") + '/contrib' - # copy scapy module to tester - scapy_dep_module_path = lib_path + 'Dot1BR.py' - session.copy_file_to(src=scapy_dep_module_path, dst=contrib_module_path) - # import scapy moudle to scapy APP out = session.session.send_expect(get_scapy_module_impcmd(), '>>> ') if 'ImportError' in out: diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index 80dae50d..f46799eb 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -407,7 +407,7 @@ class TestGeneric_flow_api(TestCase): cmd_fmt = "flow %(create)s 0 ingress pattern %(flow)s / end actions %(action)s end" # Record the elements of the rule, ready for the configuration # of packets inconsistent to the rule. - extrapacket = {'vlan': '', 'etag': '', 'ipv4': '', 'ipv6': '', 'sip': '', 'dip': '', 'proto': '', 'tos': '', + extrapacket = {'vlan': '', 'for ': '', 'ipv4': '', 'ipv6': '', 'sip': '', 'dip': '', 'proto': '', 'tos': '', 'ttl': '', 'tcp': '', 'udp': '', 'sctp': '', 'sport': '', 'dport': '', 'vni': '', 'tni': '', 'ineth': '', 'invlan': ''} # Define the packet string, which is consistent to the flow rule. @@ -420,12 +420,6 @@ class TestGeneric_flow_api(TestCase): if 'fuzzy' in flows: thresh = self.generate_random_int(1, 15) flow_str = "fuzzy thresh is %d " % thresh - # L2 tunnel - elif 'etag' in flows: - ecid = self.generate_random_int(4096, 8191) - flow_str = "e_tag grp_ecid_b is %s " % hex(ecid) - pkt += "/Dot1BR(GRP=0x1, ECIDbase=%s)" % hex(ecid - 4096) - extrapacket['etag'] = hex(ecid - 4096) else: flow_str = "eth " # Configure the flow and packet and extrapacket string -- 2.33.1.windows.1