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

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