[igt-dev] [PATCH i-g-t] tests/xe/xe_query: Add subtest query-invalid-extension
janga.rahul.kumar at intel.com
janga.rahul.kumar at intel.com
Fri Apr 28 11:19:27 UTC 2023
From: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
Check query with invalid extension returns expected error code.
Add test to XE BAT.
CC: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
---
tests/intel-ci/xe-fast-feedback.testlist | 1 +
tests/xe/xe_query.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/tests/intel-ci/xe-fast-feedback.testlist b/tests/intel-ci/xe-fast-feedback.testlist
index ecf44ca7..4082ecd1 100644
--- a/tests/intel-ci/xe-fast-feedback.testlist
+++ b/tests/intel-ci/xe-fast-feedback.testlist
@@ -141,6 +141,7 @@ igt at xe_query@query-gts
igt at xe_query@query-config
igt at xe_query@query-hwconfig
igt at xe_query@query-topology
+igt at xe_query@query-invalid-extension
igt at xe_query@query-invalid-query
igt at xe_query@query-invalid-size
#igt at xe_vm@bind-once
diff --git a/tests/xe/xe_query.c b/tests/xe/xe_query.c
index 3f038225..a0fb5422 100644
--- a/tests/xe/xe_query.c
+++ b/tests/xe/xe_query.c
@@ -435,6 +435,23 @@ test_query_invalid_size(int fd)
igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), -1);
}
+/**
+ * SUBTEST: query-invalid-extension
+ * Description: Check query with invalid extension returns expected error code.
+ */
+static void
+test_query_invalid_extension(int fd)
+{
+ struct drm_xe_device_query query = {
+ .extensions = -1,
+ .query = DRM_XE_DEVICE_QUERY_CONFIG,
+ .size = 0,
+ .data = 0,
+ };
+
+ do_ioctl_err(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query, EINVAL);
+}
+
igt_main
{
int xe;
@@ -468,6 +485,9 @@ igt_main
igt_subtest("query-invalid-size")
test_query_invalid_size(xe);
+ igt_subtest("query-invalid-extension")
+ test_query_invalid_extension(xe);
+
igt_fixture {
xe_device_put(xe);
close(xe);
--
2.25.1
More information about the igt-dev
mailing list