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 AE3B0A051A; Fri, 17 Jan 2020 08:36:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9F6FF1D16B; Fri, 17 Jan 2020 08:36:54 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id F049D1D16A for ; Fri, 17 Jan 2020 08:36:52 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2020 23:36:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,329,1574150400"; d="scan'208";a="261665801" Received: from unknown (HELO dpdk-xiaoqimai-tester.sh.intel.com) ([10.239.250.12]) by fmsmga001.fm.intel.com with ESMTP; 16 Jan 2020 23:36:49 -0800 From: Zeng Xiaoxiao To: dts@dpdk.org Cc: Zeng Xiaoxiao Date: Fri, 17 Jan 2020 15:37:18 +0800 Message-Id: <1579246638-172212-1-git-send-email-xiaoxiaox.zeng@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V4] tests/port_control:modify e1000 part 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" *.e1000 device not support port stop and port reset. Signed-off-by: Zeng Xiaoxiao --- tests/TestSuite_port_control.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py index f006ddb..8d63fe7 100644 --- a/tests/TestSuite_port_control.py +++ b/tests/TestSuite_port_control.py @@ -82,7 +82,6 @@ class TestPortControl(TestCase): self.host_intf = self.dut.ports_info[self.used_dut_port]['intf'] self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 1, driver=driver) self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]['vfs_port'] - self.dut.send_expect("ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# ") try: for port in self.sriov_vfs_port: port.bind_driver(self.vf_assign_method) @@ -95,6 +94,8 @@ class TestPortControl(TestCase): self.vm_dut = self.vm.start() if self.vm_dut is None: raise Exception("Set up VM ENV failed!") + else: + self.start_vf_pmd(self.vm_dut) self.vm_testpmd = PmdOutput(self.vm_dut) @@ -148,6 +149,17 @@ class TestPortControl(TestCase): if driver != driver_now: netdev.bind_driver(driver=driver) + def start_vf_pmd(self, terminal): + + drive_info = terminal.send_expect("./usertools/dpdk-devbind.py -s", "#") + vf_if = re.findall(r"if=(\w+)", drive_info.split("kernel")[1]) + vf_pci = re.findall(r"(\d+.\d+.\d+.\d+)", drive_info.split("kernel")[1]) + terminal.send_expect("ifconfig %s hw ether %s" % (vf_if[1], self.vf_mac), "#") + terminal.send_expect("ifconfig %s up" % vf_if[1], "#") + terminal.send_expect("./usertools/dpdk-devbind.py -b %s %s" % (self.pf_default_driver, vf_pci[1]), "#") + cmd = "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_pci[1]) + terminal.send_expect(cmd, "testpmd>", 10) + def start_testpmd(self, terminal): terminal.start_testpmd(ports=[0], socket=self.socket) res = terminal.wait_link_status_up('all', timeout=5) @@ -166,7 +178,7 @@ class TestPortControl(TestCase): terminal.execute_cmd("stop") terminal.execute_cmd("port stop all") ret = terminal.get_port_link_status(self.port_id_0) - if self.nic.startswith('columbiaville'): + if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd: self.verify(ret != "", "port status error!") else: self.verify(ret == "down", "port not down!") @@ -174,7 +186,7 @@ class TestPortControl(TestCase): def reset_pmd_port(self, terminal): terminal.execute_cmd("port reset all") ret = terminal.get_port_link_status(self.port_id_0) - if self.nic.startswith('columbiaville'): + if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd: self.verify(ret != "", "port status error!") else: self.verify(ret == "down", "port not down!") @@ -230,19 +242,15 @@ class TestPortControl(TestCase): def test_e1000_start_stop_reset_close(self): self.setup_vm_env() - self.start_testpmd(self.vm_testpmd) # start port self.start_pmd_port(self.vm_testpmd) - self.send_and_verify_packets(self.vm_testpmd) # stop port and start port self.stop_pmd_port(self.vm_testpmd) self.start_pmd_port(self.vm_testpmd) - self.send_and_verify_packets(self.vm_testpmd) # reset port self.stop_pmd_port(self.vm_testpmd) self.reset_pmd_port(self.vm_testpmd) self.start_pmd_port(self.vm_testpmd) - self.send_and_verify_packets(self.vm_testpmd) # close all port self.stop_pmd_port(self.vm_testpmd) self.close_pmd_port(self.vm_testpmd) -- 1.8.3.1