test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1]framework/tester: workaround random packet check issue.
@ 2017-05-10  6:49 Lijuan Tu
  2017-05-15  1:07 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Lijuan Tu @ 2017-05-10  6:49 UTC (permalink / raw)
  To: dts; +Cc: Lijuan Tu

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

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

end of thread, other threads:[~2017-05-15  1:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10  6:49 [dts] [PATCH V1]framework/tester: workaround random packet check issue Lijuan Tu
2017-05-15  1:07 ` Liu, Yong

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