From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F278A04E7; Mon, 2 Nov 2020 10:23:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95D9CBE49; Mon, 2 Nov 2020 10:23:31 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 60B96AC90 for ; Mon, 2 Nov 2020 10:23:28 +0100 (CET) IronPort-SDR: 01ahG4MteufuicNA2tv02skSZoH5NU6hGzJeP+EzngU69pHm5cNBioQvzzsS3OMMLxkQCNd028 1b6psmK/OvFA== X-IronPort-AV: E=McAfee;i="6000,8403,9792"; a="168990734" X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="168990734" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 01:23:26 -0800 IronPort-SDR: eiy3q10xqBo5i2ILWLPkwTMFFZBxYC6FBWrdWU5pP9jf+KsjDIjC2vwB4VzDWlmaqEOTKmfiP6 ShFFkh5KdWLw== X-IronPort-AV: E=Sophos;i="5.77,444,1596524400"; d="scan'208";a="537948342" Received: from unknown (HELO localhost.localdomain) ([10.240.183.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 01:23:25 -0800 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Mon, 2 Nov 2020 18:01:28 +0000 Message-Id: <20201102180128.31222-1-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/l2tp_esp_coverage adapt scapy2.4.4 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" modify L2TP format as byte type to adapt scapy2.4.4 Signed-off-by: sunqin --- tests/TestSuite_l2tp_esp_coverage.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/TestSuite_l2tp_esp_coverage.py b/tests/TestSuite_l2tp_esp_coverage.py index 3779a5a..89f7cae 100644 --- a/tests/TestSuite_l2tp_esp_coverage.py +++ b/tests/TestSuite_l2tp_esp_coverage.py @@ -38,8 +38,8 @@ import rte_flow_common as rfc vf0_mac = "00:11:22:33:44:55" -tv_MAC_IPV4_L2TPv3_chksum = {'good_checksum': "Ether(dst='%s')/IP(src='192.168.0.3', proto=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('X'*480)" % vf0_mac, - 'bad_checksum': "Ether(dst='%s')/IP(src='192.168.0.3', proto=115, chksum=0x1234)/L2TP('\\x00\\x00\\x00\\x11')/Raw('X'*480)" % vf0_mac} +tv_MAC_IPV4_L2TPv3_chksum = {'good_checksum': "Ether(dst='%s')/IP(src='192.168.0.3', proto=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('X'*480)" % vf0_mac, + 'bad_checksum': "Ether(dst='%s')/IP(src='192.168.0.3', proto=115, chksum=0x1234)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('X'*480)" % vf0_mac} tv_MAC_IPV4_ESP_chksum = {'good_checksum': 'Ether(dst="%s")/IP(src="192.168.0.3", proto=50)/ESP(spi=11)/Raw("X"*480)' % vf0_mac, 'bad_checksum': 'Ether(dst="%s")/IP(src="192.168.0.3", proto=50, chksum=0x1234)/ESP(spi=11)/Raw("X"*480)' % vf0_mac} tv_MAC_IPV4_AH_chksum = {'good_checksum': 'Ether(dst="%s")/IP(src="192.168.0.3", proto=50)/AH(spi=11)/Raw("X"*480)' % vf0_mac, @@ -51,12 +51,12 @@ tv_MAC_IPV4_NAT_T_ESP_chksum = {'good_ip_udp_checksum': 'Ether(dst="%s")/IP(src= tv_MAC_IPV6_NAT_T_ESP_chksum = {'good_udp_checksum': 'Ether(dst="%s")/IPv6(src="1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=4500)/ESP(spi=2)/Raw("x"*480)' % vf0_mac, 'bad_udp_checksum': 'Ether(dst="%s")/IPv6(src="1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=4500,chksum=0x1234)/ESP(spi=2)/Raw("x"*480)' % vf0_mac} -tv_MAC_IPV4_L2TPv3_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IP(proto=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, - 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IP(proto=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, - 'no vlan': "Ether(dst='%s')/IP(proto=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac} -tv_MAC_IPV6_L2TPv3_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IPv6(nh=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, - 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IPv6(nh=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, - 'no vlan': "Ether(dst='%s')/IPv6(nh=115)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac} +tv_MAC_IPV4_L2TPv3_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IP(proto=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, + 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IP(proto=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, + 'no vlan': "Ether(dst='%s')/IP(proto=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac} +tv_MAC_IPV6_L2TPv3_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IPv6(nh=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, + 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IPv6(nh=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac, + 'no vlan': "Ether(dst='%s')/IPv6(nh=115)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" % vf0_mac} tv_MAC_IPV4_ESP_vlan = {'matched vlan': "Ether(dst='%s')/Dot1Q(vlan=1)/IP(proto=50)/ESP(spi=1)/Raw('x'*480)" % vf0_mac, 'dismatched vlan': "Ether(dst='%s')/Dot1Q(vlan=2)/IP(proto=50)/ESP(spi=1)/Raw('x'*480)" % vf0_mac, 'no vlan': "Ether(dst='%s')/IP(proto=50)/ESP(spi=1)/Raw('x'*480)" % vf0_mac} @@ -373,7 +373,7 @@ class L2tpEspCoverage(TestCase): self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 3 / end actions queue index 3 / mark id 2 / end","testpmd> ") self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 4 / end actions queue index 4 / mark id 1 / end","testpmd> ") # matched vlan id + bad checksum + matched session id - pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP('\\x00\\x00\\x00\\x01')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x01')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) # check the fdir rule @@ -386,7 +386,7 @@ class L2tpEspCoverage(TestCase): receive_pkt = re.findall('vlan 1', tcpdump_out) self.verify(len(receive_pkt) == 1, 'vlan id strip on failed') # matched vlan id + bad checksum + mismatched session id - pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) # check the fdir rule @@ -402,7 +402,7 @@ class L2tpEspCoverage(TestCase): # destroy rule self.dut.send_expect("flow flush 0","testpmd> ") # matched vlan id + bad checksum + matched session id - pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP('\\x00\\x00\\x00\\x01')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/Dot1Q(vlan=1)/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x01')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) # check the fdir rule @@ -435,7 +435,7 @@ class L2tpEspCoverage(TestCase): self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 3 / end actions queue index 3 / mark id 2 / end","testpmd> ") self.dut.send_expect("flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 4 / end actions queue index 4 / mark id 1 / end","testpmd> ") # no vlan + matched session id - pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115)/L2TP('\\x00\\x00\\x00\\x01')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115)/L2TP(b'\\x00\\x00\\x00\\x01')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) time.sleep(1) @@ -448,7 +448,7 @@ class L2tpEspCoverage(TestCase): self.enable_sw_checksum() # bad checksum + mismatched session id - pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115,chksum=0x123)/L2TP('\\x00\\x00\\x00\\x11')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x11')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) # check the fdir rule @@ -460,7 +460,7 @@ class L2tpEspCoverage(TestCase): # destroy rule self.dut.send_expect("flow flush 0","testpmd> ") # bad checksum + matched session id - pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115,chksum=0x123)/L2TP('\\x00\\x00\\x00\\x01')/Raw('x'*480)" + pkts="Ether(dst='00:11:22:33:44:55')/IP(proto=115,chksum=0x123)/L2TP(b'\\x00\\x00\\x00\\x01')/Raw('x'*480)" self.start_tcpdump(self.tx_iface) out = self.send_pkts_getouput(pkts) # check the fdir rule -- 2.17.1