[Intel-gfx] [PATCH igt] igt/tools_test: Remove dmesg subtest

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 7 18:29:25 UTC 2017


It's a silly test. If fails if there is an *ERROR* in the dmesg ringbuf,
so it neither is testing that errors are generated as expected, and as a
pre-check it can only see what's at the end of the dmesg and may miss
earlier faults. As a test it just randomly fails; worse than useless.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/tools_test.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/tests/tools_test.c b/tests/tools_test.c
index ccd165de..21c01ac5 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -49,36 +49,6 @@ static bool check_cmd_return_value(const char *s, void *data)
 	return true;
 }
 
-static bool kmsg_check(const char *str)
-{
-	int fd;
-	FILE *file = NULL;
-
-	fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK);
-	if (fd != -1)
-		file = fdopen(fd, "r");
-	if (file) {
-		size_t len = 0;
-		char *line = NULL;
-		char *ret = NULL;
-
-		while (getline(&line, &len, file) != -1) {
-			if ((ret = strstr(line, str)) != NULL) {
-				break;
-			}
-		}
-		free(line);
-		fclose(file);
-		close(fd);
-		if (ret)
-			return true;
-	} else {
-		close(fd);
-		igt_warn("Unable to retrieve kernel log (from /dev/kmsg)\n");
-	}
-	return false;
-}
-
 igt_main
 {
 	igt_skip_on_simulation();
@@ -137,9 +107,4 @@ igt_main
 		igt_assert(igt_system_quiet(cmd) == IGT_EXIT_SUCCESS);
 		free(cmd);
 	}
-
-	igt_subtest("check_dmesg") {
-		igt_assert(!kmsg_check("*ERROR*"));
-		igt_assert(!kmsg_check("------[ cut here ]----"));
-	}
 }
-- 
2.14.1



More information about the Intel-gfx mailing list