From: Lijuan Tu <lijuanx.a.tu@intel.com>
To: dts@dpdk.org
Cc: Lijuan Tu <lijuanx.a.tu@intel.com>
Subject: [dts] [PATCH V1]framework/tester: workaround random packet check issue.
Date: Wed, 10 May 2017 14:49:16 +0800 [thread overview]
Message-ID: <1494398956-39481-1-git-send-email-lijuanx.a.tu@intel.com> (raw)
Random packet check maybe failed for received misc packets.
Make a workaround of this issue.
When the received-packet not in the sent-packets, continue to check next packet.
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
framework/tester.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/framework/tester.py b/framework/tester.py
index 5cf5e00..8f927ea 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -607,17 +607,21 @@ class Tester(Crb):
recv_pkts = load_f(rx_inst[rxport])
# only report when recevied number not matched
- if len(tx_pkts[txport]) != len(recv_pkts):
- print "Pkt number not matched,%d sent and %d received\n" \
- % (len(tx_pkts[txport]), len(recv_pkts))
+ if len(tx_pkts[txport]) > len(recv_pkts):
+ print ("Pkt number not matched,%d sent and %d received\n" \
+ % (len(tx_pkts[txport]), len(recv_pkts)))
+
if allow_miss is False:
return False
# check each received packet content
print GREEN("Comparing sniffed packets, please wait few minutes...")
for idx in range(len(recv_pkts)):
- l3_type = recv_pkts[idx].strip_element_layer2('type')
- sip = recv_pkts[idx].strip_element_layer3('src')
+ try:
+ l3_type = recv_pkts[idx].strip_element_layer2('type')
+ sip = recv_pkts[idx].strip_element_layer3('src')
+ except:
+ continue
# ipv4 packet
if l3_type == 2048:
t_idx = convert_ip2int(sip, 4)
--
1.9.3
next reply other threads:[~2017-05-10 6:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 6:49 Lijuan Tu [this message]
2017-05-15 1:07 ` Liu, Yong
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=1494398956-39481-1-git-send-email-lijuanx.a.tu@intel.com \
--to=lijuanx.a.tu@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).