[dts] [PATCH V2] tests/tx_preparation:Modify the verification parameters.

zhu,shuai shuaix.zhu at intel.com
Mon Oct 21 04:40:37 CEST 2019



Signed-off-by: zhu,shuai <shuaix.zhu at intel.com>
---
 tests/TestSuite_tx_preparation.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_tx_preparation.py b/tests/TestSuite_tx_preparation.py
index 6d12724..cea3777 100644
--- a/tests/TestSuite_tx_preparation.py
+++ b/tests/TestSuite_tx_preparation.py
@@ -57,6 +57,7 @@ import random
 Normal_mtu = 1500
 Max_mtu = 9000
 TSO_value = 1460
+count = 4
 
 
 class TestTX_preparation(TestCase):
@@ -139,7 +140,7 @@ class TestTX_preparation(TestCase):
         for packet_type in pkts.keys():
             self.start_tcpdump(self.tester_intf)
             self.tester.scapy_append(
-                'sendp([%s], iface="%s", count=4)' % (pkts[packet_type], self.tester_intf))
+                'sendp([%s], iface="%s", count=%d)' % (pkts[packet_type], self.tester_intf, count))
             self.tester.scapy_execute()
             out = self.get_tcpdump_package()
             if packet_type == 'IPv6/cksum UDP':
@@ -156,11 +157,11 @@ class TestTX_preparation(TestCase):
                     segnum = LrgLength / TSO_value 
                     LastLength = LrgLength % TSO_value
                     num = out.count('length %s' %TSO_value)
-                    self.verify("length %s" %TSO_value in out and num == segnum,
+                    self.verify("length %s" %TSO_value in out and num == segnum * count,
                         "Failed to verify TSO correctness for large packets!!!")
                     if LastLength != 0 :
                         num = out.count('length %s' %LastLength)
-                        self.verify("length %s" %LastLength in out and num == 1 , 
+                        self.verify("length %s" %LastLength in out and num == count,
                         "Failed to verify TSO correctness for large packets!!!")
     
 
-- 
2.17.2



More information about the dts mailing list