xfs
[Top] [All Lists]

Re: [PATCH, RFC] xfstests: fail test if it causes a kernel taint

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH, RFC] xfstests: fail test if it causes a kernel taint
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 13 May 2013 22:38:50 -0500
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130514031517.GV24635@dastard>
References: <51916146.80308@xxxxxxxxxx> <20130514011501.GR32675@dastard> <51919ACD.4040903@xxxxxxxxxxx> <20130514031517.GV24635@dastard>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
On 5/13/13 10:15 PM, Dave Chinner wrote:
> On Mon, May 13, 2013 at 09:00:45PM -0500, Eric Sandeen wrote:
>> On 5/13/13 8:15 PM, Dave Chinner wrote:
>>> On Mon, May 13, 2013 at 04:55:18PM -0500, Eric Sandeen wrote:
>>>> This should, in theory, fail a test if it introduces one of
>>>> a handful of "serious" kernel taints.  I mask on a few taint
>>>> values because using an out of tree module or a non-GPL module
>>>> should never fail a test, for example.
>>>>
>>>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
>>>
>>> I like the idea - it should catch lockdep failures and other such
>>> problems.
>>>
>>>> ---
>>>>
>>>> diff --git a/check b/check
>>>> index a79747e..a9cac4e 100755
>>>> --- a/check
>>>> +++ b/check
>>>> @@ -446,6 +445,11 @@ do
>>>>    fi
>>>>    rm -f core $seqres.notrun
>>>>  
>>>> +  if [ "$HOSTOS" == "Linux" ]; then
>>>> +          tainted=`sysctl -n kernel.tainted`
>>>> +          let "tainted &= $TAINT_FAIL"
>>>> +  fi
>>>> +
>>>>    start=`_wallclock`
>>>>    $timestamp && echo -n " ["`date "+%T"`"]"
>>>>    [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
>>>> @@ -507,6 +511,19 @@ do
>>>>                     "entire diff)"
>>>>                err=true
>>>>            fi
>>>> +
>>>> +          # See if this run tainted the kernel due to oops, etc
>>>> +          if [ "$HOSTOS" == "Linux" ]
>>>> +          then
>>>> +                  tainted2=`sysctl -n kernel.tainted`
>>>> +                  let "tainted2 &= $TAINT_FAIL"
>>>> +                  if [ "$tainted" != "$tainted2" ]
>>>> +                  then
>>>> +                          echo " Kernel taint changed from $tainted to 
>>>> $tainted2."
>>>> +                          echo " See dmesg for details."
>>>> +                          err=true
>>>> +                  fi
>>>
>>> Should we dump the last 100 lines of dmesg into the output file
>>> here? And then rely on the golden image match failing to fail the
>>> test?
>>
>> Or into $seq.full . .  I dunno.  It's hard to know how much dmesg you'd need 
>> to get the right bits.
>>
>> Dumping all of it into $seq.full might be best; it only trips when it's a 
>> new taint, so won't
>> fire for every test.
> 
> Only problem with $seqres.full is that it is internal to the test
> and so many tests will not remove one that is there before the test
> starts. Hence you'll get growing files the never get removed from
> repeated failures. 

Oh, I see what you mean, yeah.

> Even just dumping the above error message into
> the output file would be sufficient, I think, as the 10 line diff
> output will state it pretty clearly as the first difference....

*shrug* I don't see the advantage of failing the test explicitly vs.
breaking it via output, but if you like that better I don't really mind,
I can change it to do that.

-Eric

> Cheers,
> 
> Dave.
> 

<Prev in Thread] Current Thread [Next in Thread>