From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F55B10E440 for ; Tue, 14 Nov 2023 06:16:05 +0000 (UTC) From: sai.gowtham.ch@intel.com To: igt-dev@lists.freedesktop.org, sai.gowtham.ch@intel.com Date: Tue, 14 Nov 2023 11:45:28 +0530 Message-Id: <20231114061528.16147-1-sai.gowtham.ch@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t] tests/intel/xe_exec_queue_property: Negative tests for get exec_queue property ioctl List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Sai Gowtham Ch Add Negative tests for get exec_queue property ioctl. Signed-off-by: Sai Gowtham Ch --- tests/intel/xe_exec_queue_property.c | 36 +++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/intel/xe_exec_queue_property.c b/tests/intel/xe_exec_queue_property.c index 4e32aefa5..bdd0648b9 100644 --- a/tests/intel/xe_exec_queue_property.c +++ b/tests/intel/xe_exec_queue_property.c @@ -4,7 +4,7 @@ */ /** - * TEST: Basic tests to check exec_queue set property functionality + * TEST: Basic tests to check exec_queue set/get property functionality * Category: Software building block * Sub-category: exec queue property * Functionality: exec queue set property @@ -108,6 +108,34 @@ static void test_property_min_max(int xe, int engine, const char **property) test_set_property(xe, property_name, min - 1, -EINVAL); } +/** + * SUBTEST: Invalid-exec-queue + * Description: Negative test to check the expected behaviour with invalid exec_queue_id. + * Test category: functionality test + */ +static void Invalid_exec_queue_id(int xe) +{ + struct drm_xe_exec_queue_get_property args = { + .exec_queue_id = 0xffff, + }; + + do_ioctl_err(xe, DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY, &args, ENOENT); +} + +/** + * SUBTEST: non-zero-reserved + * Description: Negative test to check the expected behaviour with non-zero reserved. + * Test category: functionality test + */ +static void non_zero_reserved(int xe) +{ + struct drm_xe_exec_queue_get_property args = { + .reserved[0] = 0xffff, + }; + + do_ioctl_err(xe, DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY, &args, EINVAL); +} + igt_main { static const struct { @@ -182,6 +210,12 @@ igt_main } } + igt_subtest("Invalid-exec-queue") + Invalid_exec_queue_id(xe); + + igt_subtest("non-zero-reserved") + non_zero_reserved(xe); + igt_fixture { xe_device_put(xe); drm_close_driver(xe); -- 2.39.1