Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: priyanka.dandamudi@intel.com
To: priyanka.dandamudi@intel.com, ramadevi.gandi@intel.com,
	zbigniew.kempczynski@intel.com, janga.rahul.kumar@intel.com,
	kamil.konieczny@intel.com, igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] xe/xe_mmap: Negative test to object
Date: Fri, 26 May 2023 10:38:55 +0530	[thread overview]
Message-ID: <20230526050855.4115107-4-priyanka.dandamudi@intel.com> (raw)
In-Reply-To: <20230526050855.4115107-1-priyanka.dandamudi@intel.com>

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Add negative test to check bad object.

v2: Add default alignment for the object size
 and remove positive case.(Zbigniew)

Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
---
 tests/xe/xe_mmap.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/xe/xe_mmap.c b/tests/xe/xe_mmap.c
index a5da6fa9..be1f9791 100644
--- a/tests/xe/xe_mmap.c
+++ b/tests/xe/xe_mmap.c
@@ -94,6 +94,22 @@ static void test_bad_extensions(int fd)
 	gem_close(fd, mmo.handle);
 }
 
+/**
+ * SUBTEST: bad-object
+ * Description: Test mmap offset with bad object.
+ *
+ */
+static void test_bad_object(int fd)
+{
+	uint64_t size = xe_get_default_alignment(fd);
+	struct drm_xe_gem_mmap_offset mmo = {
+		.handle = xe_bo_create(fd, 0, 0, size),
+	};
+
+	mmo.handle = 0xdeadbeef;
+	do_ioctl_err(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo, ENOENT);
+}
+
 igt_main
 {
 	int fd;
@@ -118,6 +134,9 @@ igt_main
 	igt_subtest("bad-extensions")
 		test_bad_extensions(fd);
 
+	igt_subtest("bad-object")
+		test_bad_object(fd);
+
 	igt_fixture {
 		xe_device_put(fd);
 		close(fd);
-- 
2.25.1

  parent reply	other threads:[~2023-05-26  5:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  5:08 [igt-dev] [PATCH i-g-t 0/3] Negative tests to mmap offset priyanka.dandamudi
2023-05-26  5:08 ` [igt-dev] [PATCH i-g-t 1/3] xe/xe_mmap: Negative test for mmap flags priyanka.dandamudi
2023-05-26 10:42   ` Zbigniew Kempczyński
2023-05-26  5:08 ` [igt-dev] [PATCH i-g-t 2/3] xe/xe_mmap: Negative test to extensions priyanka.dandamudi
2023-05-26 10:44   ` Zbigniew Kempczyński
2023-05-26  5:08 ` priyanka.dandamudi [this message]
2023-05-26 10:44   ` [igt-dev] [PATCH i-g-t 3/3] xe/xe_mmap: Negative test to object Zbigniew Kempczyński
2023-05-26 12:08 ` [igt-dev] ✓ Fi.CI.BAT: success for Negative tests to mmap offset (rev2) Patchwork
2023-05-26 14:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-05-20 12:10 [igt-dev] [PATCH i-g-t 0/3] Negative tests to mmap offset priyanka.dandamudi
2023-05-20 12:10 ` [igt-dev] [PATCH i-g-t 3/3] xe/xe_mmap: Negative test to object priyanka.dandamudi
2023-05-22 11:44   ` Zbigniew Kempczyński

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=20230526050855.4115107-4-priyanka.dandamudi@intel.com \
    --to=priyanka.dandamudi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janga.rahul.kumar@intel.com \
    --cc=kamil.konieczny@intel.com \
    --cc=ramadevi.gandi@intel.com \
    --cc=zbigniew.kempczynski@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