[Intel-gfx] [PATCH igt] igt/tools_test: Remove dmesg subtest
Daniel Vetter
daniel at ffwll.ch
Fri Sep 8 07:21:15 UTC 2017
On Thu, Sep 07, 2017 at 07:29:25PM +0100, Chris Wilson wrote:
> 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>
Yeah, this was the runtime env test way back, but I think most of it was
moved to piglit at startup. Maybe not dmesg, perhaps we should add that.
Either way, randomly checking dmesg indeed is pointless.
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
> 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
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list