From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EBAFAA00E6 for ; Tue, 14 May 2019 09:20:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE31F4D27; Tue, 14 May 2019 09:20:31 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1D8864CA6 for ; Tue, 14 May 2019 09:20:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2019 00:20:29 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 14 May 2019 00:20:28 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 14 May 2019 00:20:28 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 14 May 2019 00:20:28 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.249]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.126]) with mapi id 14.03.0415.000; Tue, 14 May 2019 15:20:19 +0800 From: "Zhang, YanX A" To: "Zhao, MeijuanX" , "dts@dpdk.org" CC: "Zhao, MeijuanX" Thread-Topic: [dts][PATCH V1] tests/sriov_kvm Thread-Index: AQHVCiUuwcd5QtBUh0CgcLiceqFLE6ZqNiEw Date: Tue, 14 May 2019 07:20:18 +0000 Message-ID: <2C49E4B25FAD1D419F7564D633EF72E158376C@shsmsx102.ccr.corp.intel.com> References: <20190514151908.24314-1-meijuanx.zhao@intel.com> In-Reply-To: <20190514151908.24314-1-meijuanx.zhao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 V1] tests/sriov_kvm 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" tested-by: Zhang, YanX A -----Original Message----- From: Zhao, MeijuanX=20 Sent: Tuesday, May 14, 2019 11:19 PM To: Zhang, YanX A Cc: Zhao, MeijuanX Subject: [dts][PATCH V1] tests/sriov_kvm=20 change code structure to cut running time resume vlan status after set vlan= everytime Signed-off-by: zhaomeijuan --- tests/TestSuite_sriov_kvm.py | 69 ++++++++++-------------------------- 1 file changed, 19 insertions(+), 50 deletions(-) diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py in= dex 43ed1b5..eadeb05 100644 --- a/tests/TestSuite_sriov_kvm.py +++ b/tests/TestSuite_sriov_kvm.py @@ -51,15 +51,16 @@ class TestSriovKvm(TestCase): else: self.vf_assign_method =3D 'vfio-pci' self.dut.send_expect('modprobe vfio-pci', '#') - - def set_up(self): self.setup_2vm_2pf_env_flag =3D 0 - self.setup_2vm_2vf_env_flag =3D 0 self.setup_2vm_prerequisite_flag =3D 0 - self.setup_4vm_4vf_env_flag =3D 0 self.setup_4vm_prerequisite_flag =3D 0 + self.setup_2vm_2vf_env() + + def set_up(self): + + self.setup_two_vm_common_prerequisite() =20 def get_stats(self, dut, portid, rx_tx): """ @@ -637,13 +638,9 @@ class TestSriovKvm(TestCase): self.setup_2vm_prerequisite_flag =3D 1 =20 def destroy_two_vm_common_prerequisite(self): - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('quit', '# ') self.vm0_testpmd =3D None self.vm0_dut_ports =3D None =20 - self.vm1_testpmd.execute_cmd('stop') - self.vm1_testpmd.execute_cmd('quit', '# ') self.vm0_testpmd =3D None self.vm1_dut_ports =3D None =20 @@ -667,8 +664,9 @@ class TestSriovKvm(TestCase): self.destroy_2vm_2pf_env() =20 def test_two_vms_intervm_communication(self): - self.setup_2vm_2vf_env() - + if self.setup_2vm_prerequisite_flag =3D=3D 1: + self.vm0_testpmd.execute_cmd('quit', '# ') + self.vm1_testpmd.execute_cmd('quit', '# ') self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') self.vm1_dut_ports =3D self.vm_dut_1.get_ports('any') port_id_0 =3D 0 @@ -712,9 +710,6 @@ class TestSriovKvm(TestCase): return ret_stats =20 def test_two_vms_pool_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() - port_id_0 =3D 0 packet_num =3D 10 =20 @@ -733,9 +728,6 @@ class TestSriovKvm(TestCase): self.reset_port_mirror_rule(port_id_0, rule_id) =20 def test_two_vms_uplink_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() - port_id_0 =3D 0 packet_num =3D 10 =20 @@ -754,9 +746,6 @@ class TestSriovKvm(TestCase): self.reset_port_mirror_rule(port_id_0, rule_id) =20 def test_two_vms_downlink_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() - self.vm0_testpmd.execute_cmd('stop') self.vm1_testpmd.execute_cmd('stop') =20 @@ -781,8 +770,6 @@ class TestSriovKvm(TestCase): self.reset_port_mirror_rule(port_id_0, rule_id) =20 def test_two_vms_vlan_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() self.vm1_testpmd.execute_cmd('vlan set strip on 0') port_id_0 =3D 0 vlan_id =3D 0 @@ -809,12 +796,11 @@ class TestSriovKvm(TestCase): self.verify(vm1_ret_stats['RX-packets'] =3D=3D packet_num and vm1_ret_stats['TX-packets'] =3D=3D packet_num, "Vlan mirror failed between VM0 and VM1!") - + self.host_testpmd.execute_cmd( + 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0,=20 + vf_mask)) self.reset_port_mirror_rule(port_id_0, rule_id) =20 def test_two_vms_vlan_and_pool_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() 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 @@ -857,13 +843,11 @@ class TestSriovKvm(TestCase): =20 self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX-pack= ets'], 10 * packet_num), "Vlan mirror failed between VM0 and VM1 when set vlan = and pool mirror!") - + self.host_testpmd.execute_cmd( + 'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0,=20 + vf_mask)) self.reset_port_all_mirror_rule(port_id_0) =20 def test_two_vms_uplink_and_downlink_mirror(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() - self.vm0_testpmd.execute_cmd('stop') self.vm1_testpmd.execute_cmd('stop') =20 @@ -909,8 +893,6 @@ class TestSriovKvm(TestCase): self.reset_port_all_mirror_rule(port_id_0) =20 def test_two_vms_vlan_and_pool_and_uplink_and_downlink(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() self.vm0_testpmd.execute_cmd('vlan set strip on 0') self.vm1_testpmd.execute_cmd('vlan set strip on 0') self.vm0_testpmd.execute_cmd('stop') @@ -990,13 +972,11 @@ class TestSriovKvm(TestCase): vm1_ret_stats['RX-packets'] =3D=3D 2 * packet_num, "Vlan and downlink mirror failed between VM0 and VM1 "= + "when set vlan, pool, uplink and downlink 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) =20 def test_two_vms_add_multi_exact_mac_on_vf(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() - port_id_0 =3D 0 vf_num =3D 0 packet_num =3D 10 @@ -1031,8 +1011,6 @@ class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 port_id_0 =3D 0 vf_mac =3D "00:11:22:33:44:55" @@ -1081,8 +1059,6 @@ class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 port_id_0 =3D 0 packet_num =3D 10 @@ -1113,8 +1089,6 @@ class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 port_id_0 =3D 0 vf_mac =3D "00:55:44:33:22:11" @@ -1152,8 +1126,6 @@ class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 port_id_0 =3D 0 packet_num =3D 10 @@ -1188,8 +1160,6 @@ class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 self.vm0_testpmd.execute_cmd("stop") self.vm0_testpmd.execute_cmd("set fwd mac") @@ -1227,8 +1197,6 @@ = class TestSriovKvm(TestCase): if self.nic.startswith('fortville'): self.dut.logger.warning("NIC is [%s], skip this case" %self.ni= c) return - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() =20 port_id_0 =3D 0 vf_mac =3D "FF:FF:FF:FF:FF:FF" @@ -1262,8 +1230,6 @@ class TestSriovKvm(TestCase): "when enable or pause TX queues on VF!") =20 def test_two_vms_negative_input_commands(self): - self.setup_2vm_2vf_env() - self.setup_two_vm_common_prerequisite() for command in ["set port 0 vf 65 tx on", "set port 2 vf -1 tx off", "set port 0 vf 0 rx oneee", @@ -1291,6 +1257,11 @@= class TestSriovKvm(TestCase): error, "Execute command '%s' successfully, it should be fa= iled!" % command) =20 def tear_down(self): + self.vm0_testpmd.execute_cmd('quit', '# ') + self.vm1_testpmd.execute_cmd('quit', '# ') + time.sleep(1) + + def tear_down_all(self): if self.setup_2vm_prerequisite_flag =3D=3D 1: self.destroy_two_vm_common_prerequisite() if self.setup_2vm_2vf_env_flag =3D=3D 1: @@ -1303,8 +1274,6 @@ class TestSriovKvm(TestCase): self.destroy_four_vm_common_prerequisite() if self.setup_4vm_4vf_env_flag =3D=3D 1: self.destroy_4vm_4vf_env() - - def tear_down_all(self): if getattr(self, 'vm0', None): self.vm0.stop() if getattr(self, 'vm1', None): -- 2.17.1