From: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
To: dts@dpdk.org
Cc: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
Subject: [dts] [PATCH V4] tests/port_control:modify e1000 part
Date: Fri, 17 Jan 2020 15:37:18 +0800 [thread overview]
Message-ID: <1579246638-172212-1-git-send-email-xiaoxiaox.zeng@intel.com> (raw)
*.e1000 device not support port stop and port reset.
Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
---
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
next reply other threads:[~2020-01-17 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 7:37 Zeng Xiaoxiao [this message]
2020-02-18 5:17 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1579246638-172212-1-git-send-email-xiaoxiaox.zeng@intel.com \
--to=xiaoxiaox.zeng@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).