From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0855A00C2; Wed, 30 Nov 2022 10:00:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCD0242D0C; Wed, 30 Nov 2022 10:00:28 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 34B6542D15 for ; Wed, 30 Nov 2022 10:00:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669798828; x=1701334828; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ytn4uQkyMY+BcUQ8cz7M3Ka01vAw7GsxiVGwSEpFDcA=; b=QPpupY2jDqIGP/1D9IDsK5DXvdSD67ouF3qhrYyLNYY4wkPuMAvDtEZO YoP923Wb336oXKyVcTcB0L8lSMIsBkBBq9HTGC319kNfkdAMpT3c0JsiH EWQXDOvq2okHSHYo7CmPtYvWURa98dObUUDDmdDTkZEZuNmgWrftSF/H4 nRvBF82ePfm2FP4p7NhoR1XJkvyKTUWdiBRwQ2Lex+bzzabyUVxEGD2gv sILyGdQmFvD+nXCngQirvLFCjyRN+BeSHBHjWnhwjqRM5D74gl2m5MoLy 2QorfAtFMOrLgMwkUBXfBIQAg9S6j14DVfFYL999+PvpCyT53M/E4lzNX g==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="302948066" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="302948066" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 01:00:27 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="707570996" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="707570996" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 01:00:25 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V1 4/5] framework/test_case: add skip_unsupported_host_driver decorator Date: Wed, 30 Nov 2022 03:04:38 -0500 Message-Id: <20221130080439.65529-5-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221130080439.65529-1-linglix.chen@intel.com> References: <20221130080439.65529-1-linglix.chen@intel.com> X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Signed-off-by: Lingli Chen --- 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