test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/hotplug: fix some failure cases
@ 2017-10-16 10:22 Phil Yang
  2017-10-17  7:44 ` Jianbo Liu
  2017-10-18  8:41 ` [dts] [PATCH v2] " Phil Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Phil Yang @ 2017-10-16 10:22 UTC (permalink / raw)
  To: dts; +Cc: nd, Jianbo.Liu, Herbert.Guan, huilongx.xu

1. Updated testpmd path for multiarch.
2. Fix port binding timeout in tear-down process.
3. Modified acceptance criteria to avoid test errors caused by
broadcast packets.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 tests/TestSuite_hotplug.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py
index 7704253..99d3f3b 100644
--- a/tests/TestSuite_hotplug.py
+++ b/tests/TestSuite_hotplug.py
@@ -69,8 +69,8 @@ class TestPortHotPlug(TestCase):
         """
         attach port
         """
-        # dpdk hotplug discern NIC by pci bus not include domid
-        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'][len("0000:"):],"is attached",60)
+        # dpdk hotplug discern NIC by pci bus and include domid
+        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'],"is attached",60)
         self.dut.send_expect("port start %s" % port,"Configuring Port",120)
         # sleep 10 seconds for fortville update link stats
         time.sleep(10)
@@ -90,7 +90,7 @@ class TestPortHotPlug(TestCase):
         """
         first run testpmd after attach port
         """
-        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
+        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
         self.dut.send_expect(cmd,"testpmd>",60)
         session_secondary = self.dut.new_session()
         session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
@@ -104,11 +104,12 @@ class TestPortHotPlug(TestCase):
    
         self.dut.send_expect("start","testpmd>",60)
         self.dut.send_expect("port detach %s" % self.port,"Please close port first",60)
+        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
         self.send_packet(self.port)
         out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
         packet = re.search("RX-packets:\s*(\d*)",out)
         sum_packet = packet.group(1)
-        self.verify(int(sum_packet) == 1, "Insufficient the received package")
+        self.verify(int(sum_packet) > 0, "Insufficient the received package")
         self.dut.send_expect("quit","#",60)
      
     def send_packet(self, port):
@@ -129,17 +130,19 @@ class TestPortHotPlug(TestCase):
         session_secondary = self.dut.new_session()
         session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
         self.dut.close_session(session_secondary)
-        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
+        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
         self.dut.send_expect(cmd,"testpmd>",60)
         self.detach(self.port)
         self.attach(self.port)
+
         self.dut.send_expect("start","testpmd>",60)
         self.dut.send_expect("port detach %s" % self.port, "Please close port first",60)
+        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
         self.send_packet(self.port)
         out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
         packet = re.search("RX-packets:\s*(\d*)",out)
         sum_packet = packet.group(1)
-        self.verify(int(sum_packet) == 1, "Insufficient the received package")
+        self.verify(int(sum_packet) > 0, "Insufficient the received package")
         self.dut.send_expect("quit","#",60)
 
 
@@ -147,8 +150,8 @@ class TestPortHotPlug(TestCase):
         """
         Run after each test case.
         """
-        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'],"#",60)
         self.dut.kill_all()
+        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'],"#",60)
         time.sleep(2)
         
 
-- 
2.7.4

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

* Re: [dts] [PATCH] tests/hotplug: fix some failure cases
  2017-10-16 10:22 [dts] [PATCH] tests/hotplug: fix some failure cases Phil Yang
@ 2017-10-17  7:44 ` Jianbo Liu
  2017-10-18  8:41 ` [dts] [PATCH v2] " Phil Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Jianbo Liu @ 2017-10-17  7:44 UTC (permalink / raw)
  To: Phil Yang; +Cc: dts, nd, Jianbo Liu, Herbert Guan, xu,huilong

On 16 October 2017 at 18:22, Phil Yang <phil.yang@arm.com> wrote:
> 1. Updated testpmd path for multiarch.
> 2. Fix port binding timeout in tear-down process.
> 3. Modified acceptance criteria to avoid test errors caused by
> broadcast packets.
>
> Signed-off-by: Phil Yang <phil.yang@arm.com>
> ---
>  tests/TestSuite_hotplug.py | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py
> index 7704253..99d3f3b 100644
> --- a/tests/TestSuite_hotplug.py
> +++ b/tests/TestSuite_hotplug.py
> @@ -69,8 +69,8 @@ class TestPortHotPlug(TestCase):
>          """
>          attach port
>          """
> -        # dpdk hotplug discern NIC by pci bus not include domid
> -        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'][len("0000:"):],"is attached",60)
> +        # dpdk hotplug discern NIC by pci bus and include domid
> +        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'],"is attached",60)
>          self.dut.send_expect("port start %s" % port,"Configuring Port",120)
>          # sleep 10 seconds for fortville update link stats
>          time.sleep(10)
> @@ -90,7 +90,7 @@ class TestPortHotPlug(TestCase):
>          """
>          first run testpmd after attach port
>          """
> -        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
> +        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
>          self.dut.send_expect(cmd,"testpmd>",60)
>          session_secondary = self.dut.new_session()
>          session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
> @@ -104,11 +104,12 @@ class TestPortHotPlug(TestCase):
>
>          self.dut.send_expect("start","testpmd>",60)
>          self.dut.send_expect("port detach %s" % self.port,"Please close port first",60)
> +        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
>          self.send_packet(self.port)
>          out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
>          packet = re.search("RX-packets:\s*(\d*)",out)
>          sum_packet = packet.group(1)
> -        self.verify(int(sum_packet) == 1, "Insufficient the received package")
> +        self.verify(int(sum_packet) > 0, "Insufficient the received package")

Maybe it's environment issue, you should still check the packet number == 1.

>          self.dut.send_expect("quit","#",60)
>
>      def send_packet(self, port):
> @@ -129,17 +130,19 @@ class TestPortHotPlug(TestCase):
>          session_secondary = self.dut.new_session()
>          session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
>          self.dut.close_session(session_secondary)
> -        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
> +        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
>          self.dut.send_expect(cmd,"testpmd>",60)
>          self.detach(self.port)
>          self.attach(self.port)
> +
>          self.dut.send_expect("start","testpmd>",60)
>          self.dut.send_expect("port detach %s" % self.port, "Please close port first",60)
> +        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
>          self.send_packet(self.port)
>          out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
>          packet = re.search("RX-packets:\s*(\d*)",out)
>          sum_packet = packet.group(1)
> -        self.verify(int(sum_packet) == 1, "Insufficient the received package")
> +        self.verify(int(sum_packet) > 0, "Insufficient the received package")
>          self.dut.send_expect("quit","#",60)
>
>
> @@ -147,8 +150,8 @@ class TestPortHotPlug(TestCase):
>          """
>          Run after each test case.
>          """
> -        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'],"#",60)
>          self.dut.kill_all()
> +        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'],"#",60)

I think you should consider vfio-pci as well.

>          time.sleep(2)
>
>
> --
> 2.7.4
>

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

* [dts] [PATCH v2] tests/hotplug: fix some failure cases
  2017-10-16 10:22 [dts] [PATCH] tests/hotplug: fix some failure cases Phil Yang
  2017-10-17  7:44 ` Jianbo Liu
@ 2017-10-18  8:41 ` Phil Yang
  2017-10-19 10:12   ` Liu, Yong
  1 sibling, 1 reply; 4+ messages in thread
From: Phil Yang @ 2017-10-18  8:41 UTC (permalink / raw)
  To: dts; +Cc: nd, Jianbo.Liu, Herber.Guan, huilongx.xu, phil.yang

1. Updated testpmd path for multiarch.
2. Fix port binding timeout in tear-down process.
3. Add vfio-pci and vfio-pci:noiommu support.
3. Clear packets stats before packet send to avoid test errors caused by
broadcast packets.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 tests/TestSuite_hotplug.py | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py
index 7704253..c0e1741 100644
--- a/tests/TestSuite_hotplug.py
+++ b/tests/TestSuite_hotplug.py
@@ -47,7 +47,7 @@ from packet import Packet, sniff_packets, load_sniff_packets
 
 class TestPortHotPlug(TestCase):
     """
-    This feature only supports igb_uio now and not support freebsd
+    This feature supports igb_uio, vfio-pci and vfio-pci:noiommu now and not support freebsd
     """
     def set_up_all(self):
         """
@@ -58,6 +58,10 @@ class TestPortHotPlug(TestCase):
         cores = self.dut.get_core_list("1S/4C/1T")
         self.coremask = utils.create_mask(cores)
         self.port = len(self.dut_ports) - 1
+        if self.drivername == "vfio-pci:noiommu":
+            self.driver_name = "vfio-pci"
+        else:
+            self.driver_name = self.drivername
 
     def set_up(self):
         """
@@ -69,8 +73,8 @@ class TestPortHotPlug(TestCase):
         """
         attach port
         """
-        # dpdk hotplug discern NIC by pci bus not include domid
-        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'][len("0000:"):],"is attached",60)
+        # dpdk hotplug discern NIC by pci bus and include domid
+        self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'],"is attached",60)
         self.dut.send_expect("port start %s" % port,"Configuring Port",120)
         # sleep 10 seconds for fortville update link stats
         time.sleep(10)
@@ -90,10 +94,10 @@ class TestPortHotPlug(TestCase):
         """
         first run testpmd after attach port
         """
-        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
+        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
         self.dut.send_expect(cmd,"testpmd>",60)
         session_secondary = self.dut.new_session()
-        session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
+        session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=%s %s" % (self.driver_name, self.dut.ports_info[self.port]['pci']), "#", 60)
         self.dut.close_session(session_secondary)
         self.attach(self.port)
         self.dut.send_expect("start","testpmd>",60)
@@ -104,6 +108,7 @@ class TestPortHotPlug(TestCase):
    
         self.dut.send_expect("start","testpmd>",60)
         self.dut.send_expect("port detach %s" % self.port,"Please close port first",60)
+        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
         self.send_packet(self.port)
         out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
         packet = re.search("RX-packets:\s*(\d*)",out)
@@ -127,14 +132,16 @@ class TestPortHotPlug(TestCase):
         first attach port after run testpmd
         """
         session_secondary = self.dut.new_session()
-        session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
+        session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=%s %s" % (self.driver_name, self.dut.ports_info[self.port]['pci']), "#", 60)
         self.dut.close_session(session_secondary)
-        cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
+        cmd = "./%s/app/testpmd -c %s -n %s -- -i" % (self.target,self.coremask,self.dut.get_memory_channels())
         self.dut.send_expect(cmd,"testpmd>",60)
         self.detach(self.port)
         self.attach(self.port)
+
         self.dut.send_expect("start","testpmd>",60)
         self.dut.send_expect("port detach %s" % self.port, "Please close port first",60)
+        self.dut.send_expect("clear port stats %s" % self.port ,"testpmd>",60)
         self.send_packet(self.port)
         out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
         packet = re.search("RX-packets:\s*(\d*)",out)
@@ -147,8 +154,8 @@ class TestPortHotPlug(TestCase):
         """
         Run after each test case.
         """
-        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'],"#",60)
         self.dut.kill_all()
+        self.dut.send_expect("./usertools/dpdk-devbind.py --bind=%s %s" % (self.driver_name, self.dut.ports_info[self.port]['pci']), "#", 60)
         time.sleep(2)
         
 
-- 
2.7.4

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

* Re: [dts] [PATCH v2] tests/hotplug: fix some failure cases
  2017-10-18  8:41 ` [dts] [PATCH v2] " Phil Yang
@ 2017-10-19 10:12   ` Liu, Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2017-10-19 10:12 UTC (permalink / raw)
  To: Phil Yang, dts; +Cc: nd, Jianbo.Liu, Herber.Guan, huilongx.xu

Thanks Phil, applied in.

On 10/18/2017 04:41 PM, Phil Yang wrote:
> 1. Updated testpmd path for multiarch.
> 2. Fix port binding timeout in tear-down process.
> 3. Add vfio-pci and vfio-pci:noiommu support.
> 3. Clear packets stats before packet send to avoid test errors caused by
> broadcast packets.
>
> Signed-off-by: Phil Yang<phil.yang@arm.com>

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

end of thread, other threads:[~2017-10-19  2:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 10:22 [dts] [PATCH] tests/hotplug: fix some failure cases Phil Yang
2017-10-17  7:44 ` Jianbo Liu
2017-10-18  8:41 ` [dts] [PATCH v2] " Phil Yang
2017-10-19 10:12   ` Liu, Yong

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