From: "zhu,shuai" <shuaix.zhu@intel.com>
To: dts@dpdk.org
Cc: "zhu,shuai" <shuaix.zhu@intel.com>
Subject: [dts] [PATCH V2] tests/tso:Modify the code due to changes in the dts framework.
Date: Tue, 15 Oct 2019 14:38:01 +0800 [thread overview]
Message-ID: <1571121481-141140-1-git-send-email-shuaix.zhu@intel.com> (raw)
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
next reply other threads:[~2019-10-15 6:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 6:38 zhu,shuai [this message]
2019-10-22 9:02 ` 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=1571121481-141140-1-git-send-email-shuaix.zhu@intel.com \
--to=shuaix.zhu@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).