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 58BEDA0519; Fri, 3 Jul 2020 05:24:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BE931D727; Fri, 3 Jul 2020 05:24:05 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E0FAE1D725 for ; Fri, 3 Jul 2020 05:24:03 +0200 (CEST) IronPort-SDR: uwF6HAsga13nVSvYYfRE6/wRZe5XTpkiYVXdNnD1V8TBKDSFkVoXD3XoWz3NgLRpEbky4ATKgK VwZArfMUWTQQ== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="135362798" X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="135362798" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 20:24:03 -0700 IronPort-SDR: rV2fVZklJj+jKr0I/2qYLljbSck6UAg3nSCeEgJa9gbOP7q/AEBDxD7RDbq8Kiz98CLzQ3R62o zJdup7tO29pA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="296088774" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.182.150]) by orsmga002.jf.intel.com with ESMTP; 02 Jul 2020 20:24:01 -0700 From: xizhan4x To: dts@dpdk.org Cc: xizhan4x Date: Fri, 3 Jul 2020 11:25:16 +0800 Message-Id: <1593746716-29771-1-git-send-email-xix.zhang@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] tests/TestSuite_ddp_gtp:modify pf case not start vm 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" modify pf case not start vm env Signed-off-by: xizhan4x --- tests/TestSuite_ddp_gtp.py | 61 +++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py index e7aa96e..972c401 100644 --- a/tests/TestSuite_ddp_gtp.py +++ b/tests/TestSuite_ddp_gtp.py @@ -43,10 +43,39 @@ class TestDdpGtp(TestCase): else: self.vf_assign_method = 'vfio-pci' self.dut.send_expect('modprobe vfio-pci', '#') + def insmod_modprobe(self,modename=''): + """ + Insmod modProbe before run test case + """ + if modename == "igb_uio": + self.dut.send_expect("modprobe uio", "#", 10) + out = self.dut.send_expect("lsmod | grep igb_uio", "#") + if "igb_uio" in out: + self.dut.send_expect("rmmod -f igb_uio", "#", 10) + self.dut.send_expect("insmod ./" + self.target + "/kmod/igb_uio.ko", "#", 10) + + out = self.dut.send_expect("lsmod | grep igb_uio", "#") + assert ("igb_uio" in out), "Failed to insmod igb_uio" def set_up(self): - self.setup_vm_env() - self.load_profile() + self.dut_testpmd = PmdOutput(self.dut) + self.used_dut_port = self.dut_ports[0] + tester_port = self.tester.get_local_port(self.used_dut_port) + self.tester_intf = self.tester.get_interface(tester_port) + if "vf" in self._suite_result.test_case: + self.insmod_modprobe("igb_uio") + self.bind_nic_driver(self.dut_ports,"igb_uio") + self.setup_vm_env() + self.load_profile() + self.vm0_testpmd.start_testpmd( + VM_CORES_MASK, "--port-topology=chained --txq=%s --rxq=%s" + % (self.VF_QUEUE, self.VF_QUEUE)) + self.vm0_testpmd.execute_cmd('set fwd rxonly') + self.vm0_testpmd.execute_cmd('set verbose 1') + self.vm0_testpmd.execute_cmd('start') + else: + self.load_profile() + def search_queue_number(self, Q_strip): """ @@ -91,10 +120,6 @@ class TestDdpGtp(TestCase): Create testing environment with VF generated from 1PF """ if self.env_done is False: - self.bind_nic_driver(self.dut_ports[:1], driver="igb_uio") - self.used_dut_port = self.dut_ports[0] - tester_port = self.tester.get_local_port(self.used_dut_port) - self.tester_intf = self.tester.get_interface(tester_port) self.dut.generate_sriov_vfs_by_port( self.used_dut_port, 1, driver=driver) self.sriov_vfs_port = self.dut.ports_info[ @@ -102,8 +127,6 @@ class TestDdpGtp(TestCase): for port in self.sriov_vfs_port: port.bind_driver(self.vf_driver) time.sleep(1) - self.dut_testpmd = PmdOutput(self.dut) - time.sleep(1) vf0_prop = {'opt_host': self.sriov_vfs_port[0].pci} # set up VM0 ENV self.vm0 = QEMUKvm(self.dut, 'vm0', 'ddp_gtp') @@ -119,6 +142,7 @@ class TestDdpGtp(TestCase): self.vm0_testpmd = PmdOutput(self.vm0_dut) self.env_done = True + def destroy_vm_env(self): if getattr(self, 'vm0', None): @@ -146,9 +170,7 @@ class TestDdpGtp(TestCase): "Default", "--pkt-filter-mode=perfect --port-topology=chained \ --txq=%s --rxq=%s" % (self.PF_QUEUE, self.PF_QUEUE)) - self.vm0_testpmd.start_testpmd( - VM_CORES_MASK, "--port-topology=chained --txq=%s --rxq=%s" - % (self.VF_QUEUE, self.VF_QUEUE)) + self.dut_testpmd.execute_cmd('port stop all') time.sleep(1) out = self.dut_testpmd.execute_cmd('ddp get list 0') @@ -161,9 +183,9 @@ class TestDdpGtp(TestCase): self.dut_testpmd.execute_cmd('set fwd rxonly') self.dut_testpmd.execute_cmd('set verbose 1') self.dut_testpmd.execute_cmd('start') - self.vm0_testpmd.execute_cmd('set fwd rxonly') - self.vm0_testpmd.execute_cmd('set verbose 1') - self.vm0_testpmd.execute_cmd('start') + time.sleep(2) + + def gtp_packets( self, type='fdir', tunnel_pkt='gtpu', inner_L3='ipv4', @@ -409,7 +431,10 @@ class TestDdpGtp(TestCase): type='clfter', port='vf id 0', tunnel_pkt='gtpu', inner_L3='ipv6') def tear_down(self): - self.vm0_testpmd.execute_cmd('stop') + if "vf" in self._suite_result.test_case: + self.destroy_vm_env() + self.vm0_testpmd.execute_cmd('stop') + self.vm0_testpmd.quit() self.dut_testpmd.execute_cmd('stop') out = self.dut_testpmd.execute_cmd('ddp get list 0') if "Profile number is: 0" not in out: @@ -420,8 +445,10 @@ class TestDdpGtp(TestCase): self.verify("Profile number is: 0" in out, "Failed to delete ddp profile!!!") self.dut_testpmd.execute_cmd('port start all') - self.vm0_testpmd.quit() self.dut_testpmd.quit() + def tear_down_all(self): - self.destroy_vm_env() + if self.env_done: + self.destroy_vm_env() + -- 1.8.3.1