test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/checksum_offload and uni_pkt: update scapy 2.4.4
@ 2020-11-02  3:16 Xia Yan
  2020-11-03  4:21 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Xia Yan @ 2020-11-02  3:16 UTC (permalink / raw)
  To: dts; +Cc: Xia Yan

scapy has been upgraded to version 2.4.4, suite need sync update.

Signed-off-by: Xia Yan <yanx.xia@intel.com>
---
 tests/TestSuite_checksum_offload.py |  2 +-
 tests/TestSuite_uni_pkt.py          | 29 ++++++++++++++---------------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py
index c917a15..89abf04 100644
--- a/tests/TestSuite_checksum_offload.py
+++ b/tests/TestSuite_checksum_offload.py
@@ -315,7 +315,7 @@ class TestChecksumOffload(TestCase):
         csum = pkt[layer].chksum
         del pkt[layer].chksum
         # Converting it to raw will calculate the checksum
-        return layer(Raw(pkt[layer])).chksum == csum
+        return layer(bytes(Raw(pkt[layer]))).chksum == csum
 
     def scapy_exec(self, cmd: str, timeout=1) -> str:
         return self.tester.send_expect(cmd, ">>>", timeout=timeout)
diff --git a/tests/TestSuite_uni_pkt.py b/tests/TestSuite_uni_pkt.py
index 6770f18..9a3200a 100644
--- a/tests/TestSuite_uni_pkt.py
+++ b/tests/TestSuite_uni_pkt.py
@@ -425,21 +425,20 @@ class TestUniPacket(TestCase):
         """
         self.verify(self.kdriver == 'i40e', "NSH packet detection only supported by i40e driver nic")
 
-        nsh_packets = {'ether+nsh': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x0,NSP=0x000002,NSI=0xff)', \
-                       'ether+nsh+ip': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP()', \
-                       'ether+nsh+ip+icmp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP()/ICMP()', \
-                       'ether+nsh+ip_frag': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP(frag=1,flags="MF")', \
-                       'ether+nsh+ip+tcp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP()/TCP()', \
-                       'ether+nsh+ip+udp': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP()/UDP()', \
-                       'ether+nsh+ip+sctp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x1,NSP=0x000002,NSI=0xff)/IP()/SCTP(tag=1)/SCTPChunkData(data=\'X\' * 16)', \
-                       'ether+nsh+ipv6': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6()', \
-                       'ether+nsh+ipv6+icmp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6(src="2001::1",dst="2003::2",nh=0x3A)/ICMP()',
-                       'ether+nsh+ipv6_frag': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6()/IPv6ExtHdrFragment()', \
-                       'ether+nsh+ipv6+tcp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6()/TCP()', \
-                       'ether+nsh+ipv6+udp': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6()/UDP()', \
-                       'ether+nsh+ipv6+sctp': 'Ether(type=0x894f)/NSH(Len=0x6,NextProto=0x2,NSP=0x000002,NSI=0xff)/IPv6(nh=0x84)/SCTP(tag=1)/SCTPChunkData("x" * 16)'
-                       }
-
+        nsh_packets = {'ether+nsh': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x0,spi=0x000002,si=0xff)', \
+                       'ether+nsh+ip': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP()', \
+                       'ether+nsh+ip+icmp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP()/ICMP()', \
+                       'ether+nsh+ip_frag': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP(frag=1,flags="MF")', \
+                       'ether+nsh+ip+tcp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP()/TCP()', \
+                       'ether+nsh+ip+udp': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP()/UDP()', \
+                       'ether+nsh+ip+sctp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x1,spi=0x000002,si=0xff)/IP()/SCTP(tag=1)/SCTPChunkData(data=\'X\' * 16)', \
+                       'ether+nsh+ipv6': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6()', \
+                       'ether+nsh+ipv6+icmp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6(src="2001::1",dst="2003::2",nh=0x3A)/ICMP()',
+                       'ether+nsh+ipv6_frag': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6()/IPv6ExtHdrFragment()', \
+                       'ether+nsh+ipv6+tcp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6()/TCP()', \
+                       'ether+nsh+ipv6+udp': 'Ether(dst="00:00:00:00:01:00",type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6()/UDP()', \
+                       'ether+nsh+ipv6+sctp': 'Ether(type=0x894f)/NSH(length=0x6,nextproto=0x2,spi=0x000002,si=0xff)/IPv6(nh=0x84)/SCTP(tag=1)/SCTPChunkData(b"x" * 16)'
+                       } 
         nsh_detect_message = {"ether+nsh": "L2_ETHER_NSH", \
                               "ether+nsh+ip": "L2_ETHER_NSH L3_IPV4_EXT_UNKNOWN L4_NONFRAG", \
                               "ether+nsh+ip+icmp": "L2_ETHER_NSH L3_IPV4_EXT_UNKNOWN L4_ICMP", \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V1] tests/checksum_offload and uni_pkt: update scapy 2.4.4
  2020-11-02  3:16 [dts] [PATCH V1] tests/checksum_offload and uni_pkt: update scapy 2.4.4 Xia Yan
@ 2020-11-03  4:21 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-11-03  4:21 UTC (permalink / raw)
  To: Xia, YanX, dts; +Cc: Xia, YanX

> scapy has been upgraded to version 2.4.4, suite need sync update.
> 
> Signed-off-by: Xia Yan <yanx.xia@intel.com>

Applied

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-03  4:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  3:16 [dts] [PATCH V1] tests/checksum_offload and uni_pkt: update scapy 2.4.4 Xia Yan
2020-11-03  4:21 ` Tu, Lijuan

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).