From: sunqin <qinx.sun@intel.com>
To: dts@dpdk.org
Cc: sunqin <qinx.sun@intel.com>
Subject: [dts] [PATCH V1] tests/l2tp_esp_coverage adapt scapy2.4.4
Date: Mon, 2 Nov 2020 18:01:28 +0000 [thread overview]
Message-ID: <20201102180128.31222-1-qinx.sun@intel.com> (raw)
modify L2TP format as byte type to adapt scapy2.4.4
Signed-off-by: sunqin <qinx.sun@intel.com>
---
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
next reply other threads:[~2020-11-02 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 18:01 sunqin [this message]
2020-11-03 1:54 ` Sun, QinX
2020-11-03 4:33 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201102180128.31222-1-qinx.sun@intel.com \
--to=qinx.sun@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).