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 <ch...@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
Reviewed-by: Martin Peres <martin.pe...@linux.intel.com>
---
 tests/tools_test.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/tests/tools_test.c b/tests/tools_test.c
index 3122bb4f..1baf60bd 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -47,36 +47,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();
@@ -135,9 +105,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to