All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests
Date: Fri, 8 Jan 2021 14:28:33 +0200	[thread overview]
Message-ID: <20210108122833.GT7444@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20210107104328.4020431-2-chris@chris-wilson.co.uk>

On Thu, Jan 07, 2021 at 10:43:28AM +0000, Chris Wilson wrote:
> If the kernel generates a bad taint during the selftest (e.g. a
> warning), declare the selftest to be a failure.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Neat and elegant.

Reviewed-by: Petri Latvala <petri.latvala@intel.com>



> ---
>  lib/igt_kmod.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index ebeacd6fc..2ae45a1a1 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -29,6 +29,7 @@
>  #include "igt_core.h"
>  #include "igt_kmod.h"
>  #include "igt_sysfs.h"
> +#include "igt_taints.h"
>  
>  /**
>   * SECTION:igt_kmod
> @@ -582,9 +583,12 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
>  			  const char *options,
>  			  const char *result)
>  {
> +	unsigned long taints;
>  	char buf[1024];
>  	int err;
>  
> +	igt_skip_on(igt_kernel_tainted(&taints));
> +
>  	lseek(tst->kmsg, 0, SEEK_END);
>  
>  	snprintf(buf, sizeof(buf), "%s=1 %s", tl->param, options ?: "");
> @@ -607,6 +611,8 @@ int igt_kselftest_execute(struct igt_kselftest *tst,
>  		     "kselftest \"%s %s\" failed: %s [%d]\n",
>  		     tst->module_name, buf, strerror(-err), -err);
>  
> +	igt_assert_eq(igt_kernel_tainted(&taints), 0);
> +
>  	return err;
>  }
>  
> -- 
> 2.30.0
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-01-08 12:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 10:43 [igt-dev] [PATCH i-g-t 1/2] lib: Process kernel taints Chris Wilson
2021-01-07 10:43 ` [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests Chris Wilson
2021-01-08 12:28   ` Petri Latvala [this message]
2021-01-07 15:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib: Process kernel taints Patchwork
2021-01-07 20:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-08 12:26 ` [igt-dev] [PATCH i-g-t 1/2] " Petri Latvala
2021-01-08 13:01 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2021-01-08 13:30   ` Petri Latvala
2021-01-08 13:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t] lib: Process kernel taints (rev2) Patchwork
2021-01-13  2:38 [igt-dev] [PATCH i-g-t 2/2] lib/kmod: Check for kernel taints before/after selftests Dixit, Ashutosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210108122833.GT7444@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.