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 4/5] framework/test_case: add skip_unsupported_host_driver decorator
Date: Fri,  9 Dec 2022 02:08:06 -0500	[thread overview]
Message-ID: <20221209070807.1134-5-linglix.chen@intel.com> (raw)
In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com>

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


  parent reply	other threads:[~2022-12-09  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  7:08 [dts][PATCH V2 0/5] use decorator to skip igb_uio cases Lingli Chen
2022-12-09  7:08 ` [dts][PATCH V2 1/5] test_plans/generic_flow_api: add pf action subcase Lingli Chen
2022-12-09  7:08 ` [dts][PATCH V2 2/5] tests/generic_flow_api: " Lingli Chen
2022-12-09  7:08 ` [dts][PATCH V2 3/5] conf/test_case_*: " Lingli Chen
2022-12-09  7:08 ` Lingli Chen [this message]
2022-12-09  7:08 ` [dts][PATCH V2 5/5] tests/TestSuite_*: skip igb_uio cases Lingli Chen

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=20221209070807.1134-5-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).