summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2017-07-25 22:43:35 -0400
committerMarvin Liu <yong.liu@intel.com>2017-07-26 21:40:56 +0800
commit5fb103121dab603fad738484490413e5cfb4d941 (patch)
treec831928e7f2e9f323b5b0ca5bdfce3941dcbe1bd
parent054480cf8d828bbc05f84709989e9298aa2dcf28 (diff)
framework tester: enhance check function with packets sequence check
If enabled sequence check, packets check funtion will return error if packets sequence is not correct. Signed-off-by: Marvin Liu <yong.liu@intel.com>
-rw-r--r--framework/tester.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/framework/tester.py b/framework/tester.py
index 5e1afeb..576403a 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -539,7 +539,7 @@ class Tester(Crb):
print GREEN("Transmitting and sniffing packets, please wait few minutes...")
send_f(intf=intf, pkts=pkts, interval=interval)
- def check_random_pkts(self, portList, pktnum=2000, interval=0.01, allow_miss=True, params=None):
+ def check_random_pkts(self, portList, pktnum=2000, interval=0.01, allow_miss=True, seq_check=False, params=None):
"""
Send several random packets and check rx packets matched
"""
@@ -610,6 +610,7 @@ class Tester(Crb):
transmit_proc.join()
# Verify all packets
+ prev_id = -1
for txport, rxport in portList:
recv_pkts = load_f(rx_inst[rxport])
@@ -638,6 +639,13 @@ class Tester(Crb):
else:
continue
+ if seq_check:
+ if t_idx <= prev_id:
+ print "Packet %d sequence not correct" % t_idx
+ return False
+ else:
+ prev_id = t_idx
+
if compare_f(tx_pkts[txport][t_idx], recv_pkts[idx], "L4") is False:
print "Pkt recevied index %d not match original " \
"index %d" % (idx, t_idx)