From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED9A2A04F0; Thu, 19 Dec 2019 08:42:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A95D31BC25; Thu, 19 Dec 2019 08:42:00 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9A8BD1F5 for ; Thu, 19 Dec 2019 08:41:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2019 23:41:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,330,1571727600"; d="scan'208";a="206114482" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 18 Dec 2019 23:41:58 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Dec 2019 23:41:58 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Dec 2019 23:41:58 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.19]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.71]) with mapi id 14.03.0439.000; Thu, 19 Dec 2019 15:41:56 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V2] tests/sriov_kvm: restart testpmd if execute special cmd in cases Thread-Index: AQHVqxGdg+mxrcOcmUimqgbKYYM+l6fBKWWg Date: Thu, 19 Dec 2019 07:41:55 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB897D7@SHSMSX101.ccr.corp.intel.com> References: <1575485245-9041-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1575485245-9041-1-git-send-email-lihongx.ma@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjIwNWJjZTctYTQ1OS00ZTdhLWFkNjYtMmRlZTBhZjNmODk1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVNiYXNHaXVGQm4zRVZPdnJtODUwRk03OXB3Y2RmSzdMdHFcL0VBQ09KSVpTWDJGNEFPUmtsUlprajVIVEVDZ1wvIn0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2] tests/sriov_kvm: restart testpmd if execute special cmd in cases 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Thursday, December 5, 2019 2:47 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V2] tests/sriov_kvm: restart testpmd if execute spe= cial > cmd in cases >=20 > if testpmd execute special cmd which maybe effect other cases, restart > testpmd >=20 > Signed-off-by: lihong > --- > tests/TestSuite_sriov_kvm.py | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) >=20 > diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py > index 546b01c..54148af 100644 > --- a/tests/TestSuite_sriov_kvm.py > +++ b/tests/TestSuite_sriov_kvm.py > @@ -51,6 +51,8 @@ class TestSriovKvm(TestCase): > self.dut.send_expect('modprobe vfio-pci', '#') > self.setup_2vm_2vf_env_flag =3D 0 > self.setup_2vm_prerequisite_flag =3D 0 > + self.vm0_testpmd =3D None > + self.vm1_testpmd =3D None > self.setup_2vm_2vf_env() >=20 > def set_up(self): > @@ -482,6 +484,12 @@ class TestSriovKvm(TestCase): > self.vm0_testpmd.execute_cmd('stop') > self.vm1_testpmd.execute_cmd('stop') > else: > + if self.vm0_testpmd: > + self.vm0_testpmd.quit() > + self.vm0_testpmd =3D None > + if self.vm1_testpmd: > + self.vm1_testpmd.quit() > + self.vm1_testpmd =3D None > self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > self.vm0_testpmd.start_testpmd(VM_CORES_MASK) > @@ -532,7 +540,8 @@ class TestSriovKvm(TestCase): > self.vm0_testpmd.execute_cmd("set promisc all off") > self.vm0_testpmd.execute_cmd('start') >=20 > - self.setup_2vm_prerequisite_flag =3D 1 > + # restart testpmd after this cases, because in this case have se= t some > special cmd > + self.setup_2vm_prerequisite_flag =3D 0 > time.sleep(2) >=20 > vm1_start_stats =3D self.vm1_testpmd.get_pmd_stats(port_id_0) > @@ -715,6 +724,7 @@ class TestSriovKvm(TestCase): > self.verify(vm1_ret_stats['RX-packets'] =3D=3D packet_num * 2, "= Vlan mirror > failed between VM0 and VM1!") >=20 > def test_two_vms_vlan_and_pool_mirror(self): > + self.setup_2vm_prerequisite_flag =3D 0 > self.vm0_testpmd.execute_cmd('vlan set strip on 0') > self.vm1_testpmd.execute_cmd('vlan set strip on 0') > port_id_0 =3D 0 > @@ -755,11 +765,11 @@ class TestSriovKvm(TestCase): >=20 > vm0_ret_stats =3D self.calculate_stats(vm0_start_stats, vm0_end_= stats) >=20 > - self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX- > packets'], 10 * packet_num), > - "Vlan mirror failed between VM0 and VM1 when set vla= n and > pool mirror!") > self.host_testpmd.execute_cmd( > 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, vf_mask= )) > self.reset_port_all_mirror_rule(port_id_0) > + self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX- > packets'], 10 * packet_num), > + "Vlan mirror failed between VM0 and VM1 when set > + vlan and pool mirror!") >=20 > def test_two_vms_uplink_and_downlink_mirror(self): > """ > @@ -893,6 +903,7 @@ class TestSriovKvm(TestCase): > vf_num =3D 0 > packet_num =3D 10 >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > for vf_mac in ["00:11:22:33:44:55", "00:55:44:33:22:11"]: > if self.nic.startswith('niantic') or self.nic.startswith('sa= ge'): > set_mac_cmd =3D "mac_addr add port %d vf %d %s" > @@ -924,6 +935,7 @@ class TestSriovKvm(TestCase): > self.dut.logger.warning("NIC is [%s], skip this case" % self= .nic) > return >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > port_id_0 =3D 0 > vf_mac =3D "00:11:22:33:44:55" > packet_num =3D 10 > @@ -975,6 +987,7 @@ class TestSriovKvm(TestCase): > port_id_0 =3D 0 > packet_num =3D 10 >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > for vf_mac in ["00:55:44:33:22:11", "00:55:44:33:22:66"]: > self.host_testpmd.execute_cmd("set port %d uta %s on" % > (port_id_0, vf_mac)) @@ -1002,= 6 +1015,7 @@ class > TestSriovKvm(TestCase): > self.dut.logger.warning("NIC is [%s], skip this case" % self= .nic) > return >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > port_id_0 =3D 0 > vf_mac =3D "00:55:44:33:22:11" > packet_num =3D 10 > @@ -1039,6 +1053,7 @@ class TestSriovKvm(TestCase): > self.dut.logger.warning("NIC is [%s], skip this case" % self= .nic) > return >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > port_id_0 =3D 0 > packet_num =3D 10 >=20 > @@ -1080,6 +1095,7 @@ class TestSriovKvm(TestCase): > port_id_0 =3D 0 > packet_num =3D 10 >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > for switch in ['on', 'off', 'on']: > self.host_testpmd.execute_cmd("set port %d vf 0 tx %s" % > (port_id_0, switch)) @@ -1114,= 6 +1130,7 @@ class > TestSriovKvm(TestCase): > vf_mac =3D "FF:FF:FF:FF:FF:FF" > packet_num =3D 10 >=20 > + self.setup_2vm_prerequisite_flag =3D 0 > for switch in ['on', 'off', 'on']: > self.host_testpmd.execute_cmd("set port %d vf 0 rxmode BAM %= s" % > (port_id_0, switch)) > -- > 2.7.4