* [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, other threads:[~2019-10-22 9:02 UTC | newest]
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
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).