[igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test

Antonio Argenziano antonio.argenziano at intel.com
Tue Mar 12 21:57:35 UTC 2019


Add a test for an invalid handle being passed to the IOCTL.

Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
---
 tests/i915/gem_mmap_gtt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index f6fbbe19..58f7403c 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -831,6 +831,18 @@ igt_main
 	igt_fixture
 		fd = drm_open_driver(DRIVER_INTEL);
 
+	igt_subtest("bad-object") {
+		struct drm_i915_gem_mmap arg;
+		int ret;
+
+		memset(&arg, 0, sizeof(arg));
+		arg.handle = 0x10101010;
+		arg.offset = 0;
+		arg.size = 4096;
+		ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &arg);
+		igt_assert(ret == -1 && errno == ENOENT);
+	}
+
 	igt_subtest("basic")
 		test_access(fd);
 	igt_subtest("basic-short")
-- 
2.20.1



More information about the igt-dev mailing list