From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 70DF22986 for ; Thu, 3 Mar 2016 02:22:53 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Mar 2016 17:22:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,531,1449561600"; d="scan'208";a="899891570" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.238.55.12]) by orsmga001.jf.intel.com with ESMTP; 02 Mar 2016 17:22:51 -0800 From: Lijuan Tu To: dts@dpdk.org, yulong.pei@intel.com, qian.q.xu@intel.com Date: Thu, 3 Mar 2016 09:18:30 +0800 Message-Id: <1456967910-18349-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH v2]tests vf_port_start_stop: update test case 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: Thu, 03 Mar 2016 01:22:54 -0000 Forwarding checking RX-packets, RX-Bytes, Tx-packets, Tx-bytes, Do not checking Rx-errors fortville NIC: when not start, the port is ready to RX but NOT RX packets, if you send 119 packets at 64B, then it will be RXed at the NIC's hardware buffer if the buffer is full, it will show in RX-errors so we do not verify Rx-errors. Signed-off-by: Lijuan Tu --- tests/TestSuite_vf_port_start_stop.py | 47 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/TestSuite_vf_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py index 0cc7ffd..4aa8de7 100644 --- a/tests/TestSuite_vf_port_start_stop.py +++ b/tests/TestSuite_vf_port_start_stop.py @@ -114,11 +114,19 @@ class TestVfPortStartStop(TestCase): testpmd.execute_cmd('port stop all') testpmd.execute_cmd('clear port stats all') - def check_port_start_stop(self, testpmd, times=10): + def check_port_start_stop(self, testpmd, times=1000): """ VF port start/stop several times , check if it work well. """ + port_id_0 = 0 + port_id_1 = 1 + for i in range(times): + vf0_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) + b_vf0_rx_pkts, b_vf0_rx_bytes = vf0_stats['RX-packets'], vf0_stats['RX-bytes'] + vf1_stats = self.vm0_testpmd.get_pmd_stats(port_id_1) + b_vf1_tx_pkts, b_vf1_tx_bytes = vf1_stats['TX-packets'], vf1_stats['TX-bytes'] + out = testpmd.execute_cmd('port start all') self.verify("Checking link statuses" in out, "ERROR: port start all") testpmd.execute_cmd('start') @@ -127,22 +135,24 @@ class TestVfPortStartStop(TestCase): out = testpmd.execute_cmd('port stop all') self.verify("Checking link statuses" in out, "ERROR: port stop all") - port_id_0 = 0 - port_id_1 = 1 - vf0_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) - vf1_stats = self.vm0_testpmd.get_pmd_stats(port_id_1) - - vf0_rx_cnt = vf0_stats['RX-packets'] - self.verify(vf0_rx_cnt != 0, "no packet was received by vm0_VF0") - - vf0_rx_err = vf0_stats['RX-errors'] - self.verify(vf0_rx_err == 0, "vm0_VF0 rx-errors") - - vf1_tx_cnt = vf1_stats['TX-packets'] - self.verify(vf1_tx_cnt != 0, "no packet was transmitted by vm0_VF1") - - vf1_tx_err = vf1_stats['TX-errors'] - self.verify(vf1_tx_err == 0, "vm0_VF0 tx-errors") + vf0_stats = self.vm0_testpmd.get_pmd_stats(port_id_0) + c_vf0_rx_pkts, c_vf0_rx_bytes, vf0_rx_errors = vf0_stats['RX-packets'], vf0_stats['RX-bytes'], vf0_stats['RX-errors'] + vf1_stats = self.vm0_testpmd.get_pmd_stats(port_id_1) + c_vf1_tx_pkts, c_vf1_tx_bytes, vf1_tx_errors = vf1_stats['TX-packets'], vf1_stats['TX-bytes'], vf1_stats['TX-errors'] + + #Fortville NIC :when not start, the port is ready to RX but NOT RX packets, + #if you send packets , then it will be RXed at the NIC's hardware buffer + #if buffer is full ,it will show RX-errors + #so, we do not check RX-errors + if self.kdriver != "i40e": + self.verify(vf0_rx_errors == 0, "vm0_VF0 rx-errors") + self.verify(vf1_tx_errors == 0, "vm0_VF1 tx-errors") + + #compare vf0 RX-packets RX-bytes ,vf1 Tx-packets TX-bytes + self.verify(c_vf0_rx_pkts > b_vf0_rx_pkts, "Packets received error") + self.verify(c_vf0_rx_bytes > b_vf0_rx_bytes, "Bytes received error") + self.verify(c_vf1_tx_pkts > b_vf1_tx_pkts, "Packets forwarding error") + self.verify(c_vf1_tx_bytes > b_vf1_tx_bytes, "Bytes forvwarding error") def setup_1pf_2vf_1vm_env(self, driver='default'): @@ -219,7 +229,8 @@ class TestVfPortStartStop(TestCase): time.sleep(2) - dst_mac = self.vm_dut_0.get_mac_address(self.vm0_dut_ports[0]) + port_id_0 = 0 + dst_mac = self.vm0_testpmd.get_port_mac(port_id_0) self.send_and_verify(dst_mac, self.vm0_testpmd) def tear_down(self): -- 2.5.0