[igt-dev] [PATCH i-g-t] tests/xe/xe_create: Exercise oversized object detection

priyanka.dandamudi at intel.com priyanka.dandamudi at intel.com
Tue May 2 08:53:07 UTC 2023


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

Create an oversized object and try to check if it throws an error.

Cc: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
---
 tests/xe/xe_create.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/xe/xe_create.c b/tests/xe/xe_create.c
index ae841f80..a4dc6a12 100644
--- a/tests/xe/xe_create.c
+++ b/tests/xe/xe_create.c
@@ -82,6 +82,13 @@ static void create_invalid_size(int fd)
 			}
 			igt_assert_eq(ret, -EINVAL);
 		}
+		/* Try creating size greater than available */
+		ret = __create_bo(fd, vm, -1ULL << 32, region, &handle);
+		if (!ret) {
+			gem_close(fd, handle);
+			xe_vm_destroy(fd, vm);
+		}
+		igt_assert_eq(ret, -ENOSPC);
 	}
 
 	xe_vm_destroy(fd, vm);
-- 
2.25.1



More information about the igt-dev mailing list