test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts framework.
@ 2019-10-15  6:38 zhu,shuai
  2019-10-22  9:02 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: zhu,shuai @ 2019-10-15  6:38 UTC (permalink / raw)
  To: dts; +Cc: zhu,shuai

The method of modifying the function.

Signed-off-by: zhu,shuai <shuaix.zhu@intel.com>
---
 tests/TestSuite_tso.py | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py
index 3ee2a21..ac94cc8 100644
--- a/tests/TestSuite_tso.py
+++ b/tests/TestSuite_tso.py
@@ -44,7 +44,7 @@ import os
 from test_case import TestCase
 from settings import HEADER_SIZE
 from pktgen import PacketGeneratorHelper
-from packet import load_pcapfile, save_packets
+from packet import Packet
 
 DEFAULT_MUT = 1500
 TSO_MTU = 9000
@@ -154,7 +154,7 @@ class TestTSO(TestCase):
         """
         Execute scanner to return results
         """
-        scanner_result = self.tester.send_expect(scanner, '#')
+        scanner_result = self.tester.send_expect(scanner, '#', 60)
         fially_result = re.findall(r'length( \d+)', scanner_result)
         return list(fially_result)
 
@@ -166,23 +166,24 @@ class TestTSO(TestCase):
         return self.tcpdump_scanner(scanner.format(**locals()))
 
     def get_chksum_value_and_verify(self, dump_pcap, save_file, Nic_list):
-        self.pks = load_pcapfile(dump_pcap)
+        packet = Packet()
+        self.pks = packet.read_pcapfile(dump_pcap, self.tester)
         for i in range(len(self.pks)):
-            self.pks = load_pcapfile(dump_pcap)
+            self.pks = packet.read_pcapfile(dump_pcap, self.tester)
             pks = self.pks[i]
-            out = pks.pktgen.pkt.show
+            out = pks.show
             chksum_list = re.findall(r'chksum=(0x\w+)', str(out))
-            pks.pktgen.pkt['IP'].chksum=None
+            pks['IP'].chksum=None
             if "VXLAN" in str(out):
-                pks.pktgen.pkt['UDP'].chksum=None
-                pks.pktgen.pkt['VXLAN']['IP'].chksum=None
-                pks.pktgen.pkt['VXLAN']['TCP'].chksum=None
+                pks['UDP'].chksum=None
+                pks['VXLAN']['IP'].chksum=None
+                pks['VXLAN']['TCP'].chksum=None
             elif "GRE" in str(out):
-                pks.pktgen.pkt['GRE']['IP'].chksum=None
-                pks.pktgen.pkt['GRE']['TCP'].chksum=None
-            save_packets(self.pks, save_file)
-            self.pks1 = load_pcapfile(save_file)
-            out1 = self.pks1[i].pktgen.pkt.show
+                pks['GRE']['IP'].chksum=None
+                pks['GRE']['TCP'].chksum=None
+            packet.save_pcapfile(self.tester, filename=save_file)
+            self.pks1 = packet.read_pcapfile(save_file, self.tester)
+            out1 = self.pks1[i].show
             chksum_list1 = re.findall(r'chksum=(0x\w+)', str(out1))
             self.tester.send_expect("rm -rf %s" % save_file, "#")
             if self.nic in Nic_list and "VXLAN" in str(out):
-- 
2.17.2


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

* Re: [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts framework.
  2019-10-15  6:38 [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts framework zhu,shuai
@ 2019-10-22  9:02 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-10-22  9:02 UTC (permalink / raw)
  To: Zhu, ShuaiX, dts; +Cc: Zhu, ShuaiX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhu,shuai
> Sent: Tuesday, October 15, 2019 2:38 PM
> To: dts@dpdk.org
> Cc: Zhu, ShuaiX <shuaix.zhu@intel.com>
> Subject: [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts
> framework.
> 
> The method of modifying the function.
> 
> Signed-off-by: zhu,shuai <shuaix.zhu@intel.com>
> ---
>  tests/TestSuite_tso.py | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py index
> 3ee2a21..ac94cc8 100644
> --- a/tests/TestSuite_tso.py
> +++ b/tests/TestSuite_tso.py
> @@ -44,7 +44,7 @@ import os
>  from test_case import TestCase
>  from settings import HEADER_SIZE
>  from pktgen import PacketGeneratorHelper -from packet import
> load_pcapfile, save_packets
> +from packet import Packet
> 
>  DEFAULT_MUT = 1500
>  TSO_MTU = 9000
> @@ -154,7 +154,7 @@ class TestTSO(TestCase):
>          """
>          Execute scanner to return results
>          """
> -        scanner_result = self.tester.send_expect(scanner, '#')
> +        scanner_result = self.tester.send_expect(scanner, '#', 60)
>          fially_result = re.findall(r'length( \d+)', scanner_result)
>          return list(fially_result)
> 
> @@ -166,23 +166,24 @@ class TestTSO(TestCase):
>          return self.tcpdump_scanner(scanner.format(**locals()))
> 
>      def get_chksum_value_and_verify(self, dump_pcap, save_file, Nic_list):
> -        self.pks = load_pcapfile(dump_pcap)
> +        packet = Packet()
> +        self.pks = packet.read_pcapfile(dump_pcap, self.tester)
>          for i in range(len(self.pks)):
> -            self.pks = load_pcapfile(dump_pcap)
> +            self.pks = packet.read_pcapfile(dump_pcap, self.tester)
>              pks = self.pks[i]
> -            out = pks.pktgen.pkt.show
> +            out = pks.show
>              chksum_list = re.findall(r'chksum=(0x\w+)', str(out))
> -            pks.pktgen.pkt['IP'].chksum=None
> +            pks['IP'].chksum=None
>              if "VXLAN" in str(out):
> -                pks.pktgen.pkt['UDP'].chksum=None
> -                pks.pktgen.pkt['VXLAN']['IP'].chksum=None
> -                pks.pktgen.pkt['VXLAN']['TCP'].chksum=None
> +                pks['UDP'].chksum=None
> +                pks['VXLAN']['IP'].chksum=None
> +                pks['VXLAN']['TCP'].chksum=None
>              elif "GRE" in str(out):
> -                pks.pktgen.pkt['GRE']['IP'].chksum=None
> -                pks.pktgen.pkt['GRE']['TCP'].chksum=None
> -            save_packets(self.pks, save_file)
> -            self.pks1 = load_pcapfile(save_file)
> -            out1 = self.pks1[i].pktgen.pkt.show
> +                pks['GRE']['IP'].chksum=None
> +                pks['GRE']['TCP'].chksum=None
> +            packet.save_pcapfile(self.tester, filename=save_file)
> +            self.pks1 = packet.read_pcapfile(save_file, self.tester)
> +            out1 = self.pks1[i].show
>              chksum_list1 = re.findall(r'chksum=(0x\w+)', str(out1))
>              self.tester.send_expect("rm -rf %s" % save_file, "#")
>              if self.nic in Nic_list and "VXLAN" in str(out):
> --
> 2.17.2


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15  6:38 [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts framework zhu,shuai
2019-10-22  9:02 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox