From: janga.rahul.kumar@intel.com
To: igt-dev@lists.freedesktop.org, ramadevi.gandi@intel.com,
janga.rahul.kumar@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/3] tests/intel/xe_waitfence: Add invalid-flag subtest
Date: Wed, 8 Nov 2023 14:46:27 +0530 [thread overview]
Message-ID: <20231108091629.814209-2-janga.rahul.kumar@intel.com> (raw)
In-Reply-To: <20231108091629.814209-1-janga.rahul.kumar@intel.com>
From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Negative test to check ioctl returns expected error when invalid
flag param is used.
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
---
tests/intel/xe_waitfence.c | 40 ++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/intel/xe_waitfence.c b/tests/intel/xe_waitfence.c
index e0116f181..32ffc6eca 100644
--- a/tests/intel/xe_waitfence.c
+++ b/tests/intel/xe_waitfence.c
@@ -98,6 +98,43 @@ waitfence(int fd, enum waittype wt)
}
}
+/**
+ * TEST: Negative test for wait ufence ioctl
+ * Category: Software building block
+ * Sub-category: waitfence
+ * Functionality: waitfence
+ * Run type: FULL
+ * Test category: negative test
+ *
+ * SUBTEST: invalid-flag
+ * Description: Check query with invalid flag returns expected error code
+ */
+
+static void
+invalid_flag(int fd)
+{
+ uint32_t bo;
+
+ struct drm_xe_wait_user_fence wait = {
+ .addr = to_user_pointer(&wait_fence),
+ .op = DRM_XE_UFENCE_WAIT_EQ,
+ .flags = -1,
+ .value = 1,
+ .mask = DRM_XE_UFENCE_WAIT_U64,
+ .timeout = -1,
+ .num_engines = 0,
+ .instances = 0,
+ };
+
+ uint32_t vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_DEFAULT, 0);
+
+ bo = xe_bo_create_flags(fd, vm, 0x40000, MY_FLAG);
+
+ do_bind(fd, vm, bo, 0, 0x200000, 0x40000, 1);
+
+ do_ioctl_err(fd, DRM_IOCTL_XE_WAIT_USER_FENCE, &wait, EINVAL);
+}
+
igt_main
{
int fd;
@@ -111,6 +148,9 @@ igt_main
igt_subtest("abstime")
waitfence(fd, ABSTIME);
+ igt_subtest("invalid-flag")
+ invalid_flag(fd);
+
igt_fixture
drm_close_driver(fd);
}
--
2.25.1
next prev parent reply other threads:[~2023-11-08 9:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 9:16 [igt-dev] [PATCH i-g-t 0/3] Add wait fence Negative tests janga.rahul.kumar
2023-11-08 9:16 ` janga.rahul.kumar [this message]
2023-11-08 9:16 ` [igt-dev] [PATCH i-g-t 2/3] tests/intel/xe_waitfence: Add invalid-ops subtest janga.rahul.kumar
2023-11-08 9:16 ` [igt-dev] [PATCH i-g-t 3/3] tests/intel/xe_waitfence: Add invalid-engine subtest janga.rahul.kumar
2023-11-08 9:44 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Add wait fence Negative tests Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-11-08 11:22 [igt-dev] [PATCH i-g-t 0/3] " janga.rahul.kumar
2023-11-08 11:22 ` [igt-dev] [PATCH i-g-t 1/3] tests/intel/xe_waitfence: Add invalid-flag subtest janga.rahul.kumar
2023-11-09 11:08 ` Dandamudi, Priyanka
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=20231108091629.814209-2-janga.rahul.kumar@intel.com \
--to=janga.rahul.kumar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ramadevi.gandi@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