From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 495B83B5 for ; Mon, 15 May 2017 09:08:54 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2017 00:08:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,343,1491289200"; d="scan'208";a="1147822438" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by fmsmga001.fm.intel.com with ESMTP; 15 May 2017 00:08:52 -0700 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Mon, 15 May 2017 15:10:17 +0800 Message-Id: <1494832217-48917-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: make adjustment to dpdk1705 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: Mon, 15 May 2017 07:08:54 -0000 1, check the result always in the testing because of testing may failed any time 2, config the mac before start qemu ,because create 2 vfs from 1 pf ,the auto mac may not invild 3, remove crc-strip parameter 4, fortville: the value of Rx-Error include discarded packet. so we don't check it. Signed-off-by: Lijuan Tu --- tests/TestSuite_vf_port_start_stop.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_vf_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py index a272033..05c4582 100644 --- a/tests/TestSuite_vf_port_start_stop.py +++ b/tests/TestSuite_vf_port_start_stop.py @@ -122,6 +122,24 @@ class TestVfPortStartStop(TestCase): self.verify("Checking link statuses" in out, "ERROR: port start all") testpmd.execute_cmd('start') time.sleep(.5) + + # we should check the result always in the testing. + 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") + if self.kdriver == "i40e": + 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") testpmd.execute_cmd('stop') out = testpmd.execute_cmd('port stop all') self.verify("Checking link statuses" in out, "ERROR: port stop all") @@ -134,8 +152,9 @@ class TestVfPortStartStop(TestCase): 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") + if self.kdriver == "i40e": + 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") @@ -148,6 +167,10 @@ class TestVfPortStartStop(TestCase): self.used_dut_port = self.dut_ports[0] self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 2, driver=driver) self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]['vfs_port'] + # create 2 vfs from 0 ,the auto mac may not invild. + pf_intf0 = self.dut.ports_info[0]['port'].get_interface_name() + self.pf0_vf0_mac = "00:12:34:56:78:01" + self.dut.send_expect("ip link set %s vf 0 mac %s" %(pf_intf0, self.pf0_vf0_mac), "#") try: @@ -189,6 +212,7 @@ class TestVfPortStartStop(TestCase): self.vm0_dut_ports = None #destroy vm0 self.vm0.stop() + time.sleep(3) self.vm0 = None if getattr(self, 'host_testpmd', None): @@ -214,7 +238,7 @@ class TestVfPortStartStop(TestCase): self.vm0_dut_ports = self.vm_dut_0.get_ports('any') self.vm0_testpmd = PmdOutput(self.vm_dut_0) - self.vm0_testpmd.start_testpmd(VM_CORES_MASK, '--crc-strip') + self.vm0_testpmd.start_testpmd(VM_CORES_MASK) self.vm0_testpmd.execute_cmd('set fwd mac') time.sleep(2) -- 1.9.3