test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts]  [PATCH V4] tests/port_control:modify e1000 part
@ 2020-01-17  7:37 Zeng Xiaoxiao
  2020-02-18  5:17 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Zeng Xiaoxiao @ 2020-01-17  7:37 UTC (permalink / raw)
  To: dts; +Cc: Zeng Xiaoxiao

*.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V4] tests/port_control:modify e1000 part
  2020-01-17  7:37 [dts] [PATCH V4] tests/port_control:modify e1000 part Zeng Xiaoxiao
@ 2020-02-18  5:17 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-02-18  5:17 UTC (permalink / raw)
  To: Zeng, XiaoxiaoX, dts; +Cc: Zeng, XiaoxiaoX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao
> Sent: Friday, January 17, 2020 3:37 PM
> To: dts@dpdk.org
> Cc: Zeng, XiaoxiaoX <xiaoxiaox.zeng@intel.com>
> Subject: [dts] [PATCH V4] tests/port_control:modify e1000 part
> 
> *.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-18  5:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  7:37 [dts] [PATCH V4] tests/port_control:modify e1000 part Zeng Xiaoxiao
2020-02-18  5:17 ` Tu, Lijuan

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).