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 V1 4/5] framework/test_case: add skip_unsupported_host_driver decorator
Date: Wed, 30 Nov 2022 03:04:38 -0500 [thread overview]
Message-ID: <20221130080439.65529-5-linglix.chen@intel.com> (raw)
In-Reply-To: <20221130080439.65529-1-linglix.chen@intel.com>
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
framework/test_case.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/framework/test_case.py b/framework/test_case.py
index 2831cb36..88a60db7 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -606,3 +606,23 @@ 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
next prev parent reply other threads:[~2022-11-30 9:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 8:04 [dts][PATCH V1 0/5] use decorator to skip igb_uio cases Lingli Chen
2022-11-30 8:04 ` [dts][PATCH V1 1/5] test_plans/generic_flow_api: add pf action subcase Lingli Chen
2022-12-06 3:21 ` Huang, ZhiminX
2022-11-30 8:04 ` [dts][PATCH V1 2/5] tests/generic_flow_api: " Lingli Chen
2022-12-06 3:24 ` Huang, ZhiminX
2022-11-30 8:04 ` [dts][PATCH V1 3/5] conf/test_case_*: " Lingli Chen
2022-11-30 8:04 ` Lingli Chen [this message]
2022-11-30 8:04 ` [dts][PATCH V1 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=20221130080439.65529-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).