[V1,4/5] framework/test_case: add skip_unsupported_host_driver decorator
Commit Message
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
framework/test_case.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
@@ -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