test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes
@ 2017-01-12  8:46 xu,huilong
  2017-01-12  8:46 ` [dts] [patch V2 2/2] used check_tx_bytes for check tx_bytes in test case xu,huilong
  2017-01-16  2:28 ` [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes Liu, Yong
  0 siblings, 2 replies; 3+ messages in thread
From: xu,huilong @ 2017-01-12  8:46 UTC (permalink / raw)
  To: dts; +Cc: xu,huilong

changlist:
1. add PROTOCOL_PACKET_SIZE value in setting mode
2. add check_tx_bytes function in testpmd output mode

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 framework/pmd_output.py | 10 ++++++++--
 framework/settings.py   |  7 ++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index d982c89..13dcaef 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,7 +31,7 @@
 
 import os
 import re
-from settings import TIMEOUT
+from settings import TIMEOUT,PROTOCOL_PACKET_SIZE
 from utils import create_mask
 
 
@@ -192,7 +192,13 @@ class PmdOutput():
         Get the allmulticast mode of port.
         """
         return self.get_detail_from_port_info("Allmulticast mode: ", "\S+", port_id)
-
+    def check_tx_bytes(self, tx_bytes, exp_bytes = 0):
+        """
+        fortville nic will send lldp packet when nic setup with testpmd.
+        so should used (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
+        for check tx_bytes count right
+        """
+        return not (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
     def get_port_vlan_offload(self, port_id):
         """
         Function: get the port vlan settting info.
diff --git a/framework/settings.py b/framework/settings.py
index df2a491..acffa34 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -161,7 +161,12 @@ HEADER_SIZE = {
     'tcp': 20,
     'vxlan': 8,
 }
-
+"""
+dpdk send protocol packet size.
+"""
+PROTOCOL_PACKET_SIZE = {
+    'lldp': 110,
+}
 
 """
 Default session timeout.
-- 
1.9.3

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

end of thread, other threads:[~2017-01-16  2:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-12  8:46 [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes xu,huilong
2017-01-12  8:46 ` [dts] [patch V2 2/2] used check_tx_bytes for check tx_bytes in test case xu,huilong
2017-01-16  2:28 ` [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes 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).