From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3C1BE28F3 for ; Tue, 10 Jan 2017 07:53:49 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 09 Jan 2017 22:53:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,342,1477983600"; d="scan'208";a="28388384" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2017 22:53:48 -0800 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Tue, 10 Jan 2017 14:54:50 +0800 Message-Id: <1484031290-35715-2-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1484031290-35715-1-git-send-email-huilongx.xu@intel.com> References: <1484031290-35715-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [patch V1 2/2] update shutdown_api and jumboframes check tx-packets code X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 06:53:50 -0000 fotville nic will send lldp packet when port setup by dpdk testpmd. so we need update check tx-packets code. used (tx-packets - forward packet size) % lldp packet size replace tx-packets == forward packets size Signed-off-by: "xu,huilong" --- tests/TestSuite_jumboframes.py | 5 ++++- tests/TestSuite_shutdown_api.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_jumboframes.py b/tests/TestSuite_jumboframes.py index 58f2e17..bebee59 100644 --- a/tests/TestSuite_jumboframes.py +++ b/tests/TestSuite_jumboframes.py @@ -39,6 +39,7 @@ import re from time import sleep from test_case import TestCase from pmd_output import PmdOutput +from settings import PROTOCOL_PACKET_SIZE ETHER_HEADER_LEN = 18 IP_HEADER_LEN = 20 @@ -93,7 +94,9 @@ class TestJumboframes(TestCase): rx_err -= rx_err_ori if received: - self.verify((tx_pkts == rx_pkts) and ((tx_bytes + 4) == pktsize) and ((rx_bytes + 4) == pktsize), + self.verify((tx_pkts - rx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0) + and ( (tx_bytes + 4 - pktsize ) % PROTOCOL_PACKET_SIZE['lldp'] == 0) + and ((rx_bytes + 4) == pktsize), "packet pass assert error") else: #self.verify(p0tx_pkts == p1rx_pkts and (p1rx_err == 1 or p1rx_pkts == 0), diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 3dbacf2..5e67bf5 100644 --- a/tests/TestSuite_shutdown_api.py +++ b/tests/TestSuite_shutdown_api.py @@ -42,7 +42,7 @@ import re import os from test_case import TestCase from pmd_output import PmdOutput -from settings import HEADER_SIZE +from settings import HEADER_SIZE, PROTOCOL_PACKET_SIZE from exception import VerifyFailure # @@ -149,14 +149,18 @@ class TestShutdownApi(TestCase): if vlan is True: # vlan strip default is on tx_bytes_exp -= 4 - + + # fortville nic enable send lldp packet function when port setup + # now the tx-packets size is lldp_size(110) * n + forward packe size + # so use (tx-packets - forward packet size) % lldp_size, if it is 0, it means forward packet size right + if received: - self.verify(p0tx_pkts == p1rx_pkts, "Wrong TX pkts p0_tx=%d, p1_rx=%d" % (p0tx_pkts, p1rx_pkts)) + self.verify((p0tx_pkts - p1rx_pkts) % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong TX pkts p0_tx=%d, p1_rx=%d" % (p0tx_pkts, p1rx_pkts)) self.verify(p1rx_bytes == rx_bytes_exp, "Wrong Rx bytes p1_rx=%d, expect=%d" % (p1rx_bytes, rx_bytes_exp)) - self.verify(p0tx_bytes == tx_bytes_exp, "Wrong Tx bytes p0_tx=%d, expect=%d" % (p0tx_bytes, tx_bytes_exp)) + self.verify((p0tx_bytes - tx_bytes_exp) % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Wrong Tx bytes p0_tx=%d, expect=%d" % (p0tx_bytes, tx_bytes_exp)) else: - self.verify(p0tx_pkts == 0, "Packet not dropped p0tx_pkts=%d" % p0tx_pkts) - self.verify(p0tx_bytes == 0, "Packet not dropped p0tx_bytes=%d" % p0tx_bytes) + self.verify(p0tx_pkts % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Packet not dropped p0tx_pkts=%d" % p0tx_pkts) + self.verify(p0tx_bytes % PROTOCOL_PACKET_SIZE['lldp'] == 0, "Packet not dropped p0tx_bytes=%d" % p0tx_bytes) def check_ports(self, status=True): """ -- 1.9.3