[PATCH 22/66] tests/xe_eudebug: Add coverage for sysfs debugger toggle

Christoph Manszewski christoph.manszewski at intel.com
Mon Jul 29 16:01:15 UTC 2024


Add subtest for checking sysfs debugger toggle logic and debugger state.

Signed-off-by: Christoph Manszewski <christoph.manszewski at intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
---
 tests/intel/xe_eudebug.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index adf5e79ac..fa81cbfe6 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -22,6 +22,30 @@
 #include "xe/xe_ioctl.h"
 #include "xe/xe_query.h"
 
+/**
+ * SUBTEST: sysfs-toggle
+ * Description:
+ *      Excercise the debugger enable/disable sysfs toggle logic
+ */
+static void test_sysfs_toggle(int fd)
+{
+	xe_eudebug_enable(fd, false);
+	igt_assert(!xe_eudebug_debugger_available(fd));
+
+	xe_eudebug_enable(fd, true);
+	igt_assert(xe_eudebug_debugger_available(fd));
+	xe_eudebug_enable(fd, true);
+	igt_assert(xe_eudebug_debugger_available(fd));
+
+	xe_eudebug_enable(fd, false);
+	igt_assert(!xe_eudebug_debugger_available(fd));
+	xe_eudebug_enable(fd, false);
+	igt_assert(!xe_eudebug_debugger_available(fd));
+
+	xe_eudebug_enable(fd, true);
+	igt_assert(xe_eudebug_debugger_available(fd));
+}
+
 #define CREATE_VMS (1 << 0)
 #define CREATE_EXEC_QUEUES (1 << 1)
 #define VM_BIND (1 << 2)
@@ -1145,6 +1169,9 @@ igt_main
 		was_enabled = xe_eudebug_enable(fd, true);
 	}
 
+	igt_subtest("sysfs-toggle")
+		test_sysfs_toggle(fd);
+
 	igt_subtest("basic-connect")
 		test_connect(fd);
 
-- 
2.34.1



More information about the igt-dev mailing list