test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V2 1/2] framework/test_case: add skip_unsupported_host_driver decorator
@ 2022-12-15  8:54 Lingli Chen
  2022-12-15  8:54 ` [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases Lingli Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Lingli Chen @ 2022-12-15  8:54 UTC (permalink / raw)
  To: dts; +Cc: zhiminx.huang, Lingli Chen

add decorator

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
V2: reformat framework/test_case.py

 framework/test_case.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/framework/test_case.py b/framework/test_case.py
index 2831cb36..86f5bbbf 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -606,3 +606,25 @@ def check_supported_nic(nics):
         return wrapper
 
     return decorator
+
+
+def skip_unsupported_host_driver(drivers):
+    """
+    Skip case which are not supported by the host driver(vfio-pci/igb_uio etc.)
+    """
+    if isinstance(drivers, str):
+        drivers = [drivers]
+
+    def decorator(func):
+        @wraps(func)
+        def wrapper(*args, **kwargs):
+            test_case = args[0]
+            if test_case.drivername in drivers:
+                raise VerifySkip(
+                    "{} do not support this case".format(test_case.drivername)
+                )
+            return func(*args, **kwargs)
+
+        return wrapper
+
+    return decorator
-- 
2.17.1


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

* [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases
  2022-12-15  8:54 [dts][PATCH V2 1/2] framework/test_case: add skip_unsupported_host_driver decorator Lingli Chen
@ 2022-12-15  8:54 ` Lingli Chen
  2022-12-22  8:35   ` Li, WeiyuanX
  2022-12-22  8:51   ` lijuan.tu
  0 siblings, 2 replies; 4+ messages in thread
From: Lingli Chen @ 2022-12-15  8:54 UTC (permalink / raw)
  To: dts; +Cc: zhiminx.huang, Lingli Chen

7 suits (external_memory/ip_pipeline/qinq_filter/veb_switch/vf_interrupt_pmd/vf_macfilter/vf_packet_rxtx) skip igb_uio cases.

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
V2: reformat tests/TestSuite_vf_interrupt_pmd.py

 tests/TestSuite_external_memory.py  | 4 +++-
 tests/TestSuite_ip_pipeline.py      | 3 ++-
 tests/TestSuite_qinq_filter.py      | 4 +++-
 tests/TestSuite_veb_switch.py       | 3 ++-
 tests/TestSuite_vf_interrupt_pmd.py | 3 ++-
 tests/TestSuite_vf_macfilter.py     | 4 +++-
 tests/TestSuite_vf_packet_rxtx.py   | 4 +++-
 7 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_external_memory.py b/tests/TestSuite_external_memory.py
index 8163a7ec..c565eba8 100644
--- a/tests/TestSuite_external_memory.py
+++ b/tests/TestSuite_external_memory.py
@@ -12,7 +12,7 @@ import time
 
 import framework.utils as utils
 from framework.pmd_output import PmdOutput
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 
 
 class TestExternalMemory(TestCase):
@@ -62,6 +62,7 @@ class TestExternalMemory(TestCase):
 
             self.dut.bind_interfaces_linux(driver="vfio-pci")
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_IGB_UIO_xmem(self):
         """
         Verifier IGB_UIO and anonymous memory allocation
@@ -75,6 +76,7 @@ class TestExternalMemory(TestCase):
         )
         self.verifier_result()
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_IGB_UIO_xmemhuage(self):
         """
         Verifier IGB_UIO and anonymous hugepage memory allocation
diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline.py
index 80a7dbc8..043516dd 100644
--- a/tests/TestSuite_ip_pipeline.py
+++ b/tests/TestSuite_ip_pipeline.py
@@ -13,7 +13,7 @@ from scapy.utils import hexstr, rdpcap, wrpcap
 
 from framework.exception import VerifyFailure
 from framework.packet import Packet
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 
 
 class TestIPPipeline(TestCase):
@@ -605,6 +605,7 @@ class TestIPPipeline(TestCase):
         cmd = "^C"
         self.dut.send_expect(cmd, "# ", 20)
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_pfdpdk_vf_l2fwd_pipeline(self):
         """
         VF l2fwd pipeline, PF bound to DPDK driver
diff --git a/tests/TestSuite_qinq_filter.py b/tests/TestSuite_qinq_filter.py
index 6b5b756c..87653681 100644
--- a/tests/TestSuite_qinq_filter.py
+++ b/tests/TestSuite_qinq_filter.py
@@ -13,7 +13,7 @@ import time
 
 import framework.utils as utils
 from framework.pmd_output import PmdOutput
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 
 
 class TestQinqFilter(TestCase):
@@ -208,6 +208,7 @@ class TestQinqFilter(TestCase):
 
         self.dut.send_expect("quit", "#")
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_qinq_packet_filter_VF_queues(self):
         """
         qinq filter packet received by assign VF queues
@@ -303,6 +304,7 @@ class TestQinqFilter(TestCase):
 
         self.verify(not error_message, error_message)
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_qinq_filter_with_diffierent_tpid(self):
         """
         qinq filter packet with different tpid  received by assign VF queues
diff --git a/tests/TestSuite_veb_switch.py b/tests/TestSuite_veb_switch.py
index 77ba9559..f391a0ee 100644
--- a/tests/TestSuite_veb_switch.py
+++ b/tests/TestSuite_veb_switch.py
@@ -17,7 +17,7 @@ from framework.packet import Packet
 from framework.pmd_output import PmdOutput
 from framework.project_dpdk import DPDKdut
 from framework.settings import HEADER_SIZE
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 from framework.utils import RED
 from framework.virt_dut import VirtDut
 
@@ -384,6 +384,7 @@ class TestVEBSwitching(TestCase):
             "VF1 didn't receive packets from VF0, the vlan filter doen't work",
         )
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_VEB_switching_inter_vfs_and_pf(self):
         """
         DPDK PF, then create 2VFs, PF in the host running dpdk testpmd, VFs
diff --git a/tests/TestSuite_vf_interrupt_pmd.py b/tests/TestSuite_vf_interrupt_pmd.py
index 5854cb0c..4fdff601 100644
--- a/tests/TestSuite_vf_interrupt_pmd.py
+++ b/tests/TestSuite_vf_interrupt_pmd.py
@@ -13,7 +13,7 @@ import time
 
 import framework.utils as utils
 from framework.packet import Packet
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 from framework.virt_common import VM
 
 
@@ -288,6 +288,7 @@ class TestVfInterruptPmd(TestCase):
             "lcore %s not sleeps" % self.core_user,
         )
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_nic_interrupt_PF_igb_uio(self):
         """
         Check Interrupt for PF with igb_uio driver
diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py
index dc4e1098..974d0e40 100644
--- a/tests/TestSuite_vf_macfilter.py
+++ b/tests/TestSuite_vf_macfilter.py
@@ -7,7 +7,7 @@ import time
 
 from framework.pmd_output import PmdOutput
 from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 from framework.virt_common import VM
 
 VM_CORES_MASK = "all"
@@ -229,6 +229,7 @@ class TestVfMacFilter(TestCase):
         self.setup_2pf_2vf_1vm_env(False, driver="")
         self.send_packet_and_verify()
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_dpdk_2pf_2vf_1vm_mac_add_filter(self):
         """
         test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario.
@@ -253,6 +254,7 @@ class TestVfMacFilter(TestCase):
         self.setup_2pf_2vf_1vm_env(False, driver="igb_uio")
         self.send_packet_and_verify()
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_dpdk_2pf_2vf_1vm_iplink_macfilter(self):
         """
         test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario.
diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py
index 5d57c462..0d52b6d3 100644
--- a/tests/TestSuite_vf_packet_rxtx.py
+++ b/tests/TestSuite_vf_packet_rxtx.py
@@ -7,7 +7,7 @@ import time
 
 from framework.packet import Packet
 from framework.pmd_output import PmdOutput
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 from framework.virt_common import VM
 
 VM_CORES_MASK = "all"
@@ -164,6 +164,7 @@ class TestVfPacketRxtx(TestCase):
         self.packet_rx_tx(driver="")
 
     ######2. test case for dpdk pf and dpdk vf 2pf_2vf_1vm scenario packet rx tx.
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_dpdk_2pf_2vf_1vm(self):
 
         self.packet_rx_tx(driver="igb_uio")
@@ -266,6 +267,7 @@ class TestVfPacketRxtx(TestCase):
         self.setup_3vf_2vm_env(driver="")
         self.vf_reset()
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_dpdk_pf_vf_reset(self):
         self.setup_3vf_2vm_env(driver="igb_uio")
         self.vf_reset()
-- 
2.17.1


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

* RE: [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases
  2022-12-15  8:54 ` [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases Lingli Chen
@ 2022-12-22  8:35   ` Li, WeiyuanX
  2022-12-22  8:51   ` lijuan.tu
  1 sibling, 0 replies; 4+ messages in thread
From: Li, WeiyuanX @ 2022-12-22  8:35 UTC (permalink / raw)
  To: Chen, LingliX, dts; +Cc: Huang, ZhiminX, Chen, LingliX

> -----Original Message-----
> From: Lingli Chen <linglix.chen@intel.com>
> Sent: Thursday, December 15, 2022 4:54 PM
> To: dts@dpdk.org
> Cc: Huang, ZhiminX <zhiminx.huang@intel.com>; Chen, LingliX
> <linglix.chen@intel.com>
> Subject: [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases
> 
> 7 suits
> (external_memory/ip_pipeline/qinq_filter/veb_switch/vf_interrupt_pmd/v
> f_macfilter/vf_packet_rxtx) skip igb_uio cases.
> 
> Signed-off-by: Lingli Chen <linglix.chen@intel.com>
> ---
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>

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

* [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases
  2022-12-15  8:54 ` [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases Lingli Chen
  2022-12-22  8:35   ` Li, WeiyuanX
@ 2022-12-22  8:51   ` lijuan.tu
  1 sibling, 0 replies; 4+ messages in thread
From: lijuan.tu @ 2022-12-22  8:51 UTC (permalink / raw)
  To: dts, Lingli Chen; +Cc: zhiminx.huang, Lingli Chen

On Thu, 15 Dec 2022 03:54:25 -0500, Lingli Chen <linglix.chen@intel.com> wrote:
> 7 suits (external_memory/ip_pipeline/qinq_filter/veb_switch/vf_interrupt_pmd/vf_macfilter/vf_packet_rxtx) skip igb_uio cases.
> 
> Signed-off-by: Lingli Chen <linglix.chen@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks

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

end of thread, other threads:[~2022-12-22  8:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15  8:54 [dts][PATCH V2 1/2] framework/test_case: add skip_unsupported_host_driver decorator Lingli Chen
2022-12-15  8:54 ` [dts][PATCH V2 2/2] tests/TestSuite_*: skip igb_uio cases Lingli Chen
2022-12-22  8:35   ` Li, WeiyuanX
2022-12-22  8:51   ` lijuan.tu

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