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 B05C9A0543; Thu, 15 Dec 2022 10:51:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA11140685; Thu, 15 Dec 2022 10:51:38 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 00C8A40223 for ; Thu, 15 Dec 2022 10:51:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671097897; x=1702633897; h=from:to:cc:subject:date:message-id; bh=oPj4J4P3I2rrjTEZL7GMs71M/nw1Bc4MKv45ikYVlUA=; b=AWkwcD4vULO+jPA8zL4YLxE7c5ix8r2MUVhQvvEtXfUMGOkMM0kGa/G3 n8zrZD9W4STNASe+IVk80VYRJjJwzPjEegeBkVMR34XRnod2lVWtgJipP vyb0KV8Px5DaQnbv6OkgC0/T2QdywcTGPL6/v4guEcd7mBuox9bKSHw9w zTmmZYkowXb18rRVdlNMkq4FW12cnByQCicHU8bUcRsf6yyIaEhTnBLLT FU/nVbHO9P2ZH+X18KdZbc942fsMnEeHMp1RgMLJNUB5e8/c9Zf32cSjs x9iWTZS7EkGhFLxVTbGNf00H/bq8rEFV6phhIJ3F/oOlBRLG20NbxQjQs w==; X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="298981782" X-IronPort-AV: E=Sophos;i="5.96,247,1665471600"; d="scan'208";a="298981782" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2022 01:51:36 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="681791964" X-IronPort-AV: E=Sophos;i="5.96,247,1665471600"; d="scan'208";a="681791964" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2022 01:51:34 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 1/2] framework/test_case: add skip_unsupported_host_driver decorator Date: Thu, 15 Dec 2022 03:54:24 -0500 Message-Id: <20221215085425.32477-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 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 add decorator Signed-off-by: Lingli Chen --- 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