[PATCH i-g-t v1 4/6] DO_NOT_MERGE: core_getversion: test runner for xe_wedged

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Jul 25 09:37:21 UTC 2024


Add two subtests for testing new igt_runner ignore regex.

Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 tests/core_getversion.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index 158133da7..d167581af 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -43,6 +43,13 @@
  *
  * SUBTEST: all-cards
  * Description: Tests GET_VERSION ioctl for all drm devices.
+ *
+ * SUBTEST: hax-fail
+ * Description: Test fail in igt_runner.
+ *
+ * SUBTEST: hax-ok
+ * Description: Test fail in igt_runner.
+ *
  */
 
 IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_VERSION ioctl and libdrm's "
@@ -81,6 +88,22 @@ static void check_all_drm(void)
 	}
 }
 
+/*
+ * *ERROR* CRITICAL: Xe has declared device 0000:00:02.0 as wedged.
+ * ERROR CRITICAL: Xe has declared device 0000:b7:00.0 as wedged.
+ */
+static void hax_dmesg(void)
+{
+	int xa, xb;
+
+	xa = random();
+	xb = random();
+	if (xa == 0 && xb == 0)
+		xb = 2;
+
+	igt_kmsg("HAX: CRITICAL: Xe has declared device 0000:%02x:%02x.0 as wedged.\n", xa, xb);
+}
+
 igt_main
 {
 	char info[256];
@@ -101,6 +124,20 @@ igt_main
 	igt_subtest("all-cards")
 		check_all_drm();
 
+	igt_describe("Simulate kernel warning for igt_runner.");
+	igt_subtest("hax-fail") {
+		igt_info("Test will succeed but igt_runner will mark it in results.json as FAILED\n");
+		hax_dmesg();
+	}
+
+	igt_describe("Fix kernel warning by igt_runner.");
+	igt_subtest("hax-ok") {
+		/* Tell igt_runner to ignore following error */
+		igt_info("Test will succeed and igt_runner should mark it in results.json as SUCCESS\n");
+		igt_emit_ignore_dmesg_regex("CRITICAL: Xe has declared device [0-9A-Fa-f:.]+ as wedged");
+		hax_dmesg();
+	}
+
 	igt_fixture
 		drm_close_driver(fd);
 }
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list