test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lingli Chen <linglix.chen@intel.com>
To: dts@dpdk.org
Cc: zhiminx.huang@intel.com, Lingli Chen <linglix.chen@intel.com>
Subject: [dts][PATCH V2 1/2] framework/test_case: add skip_unsupported_host_driver decorator
Date: Thu, 15 Dec 2022 03:54:24 -0500	[thread overview]
Message-ID: <20221215085425.32477-1-linglix.chen@intel.com> (raw)

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


             reply	other threads:[~2022-12-15  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  8:54 Lingli Chen [this message]
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

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=20221215085425.32477-1-linglix.chen@intel.com \
    --to=linglix.chen@intel.com \
    --cc=dts@dpdk.org \
    --cc=zhiminx.huang@intel.com \
    /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).