ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Bird, Timothy" <Tim.Bird@am.sony.com>
To: Shuah Khan <shuahkh@osg.samsung.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	Trond Myklebust <trondmy@primarydata.com>,
	"ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [CORE TOPIC] stable workflow
Date: Wed, 3 Aug 2016 04:47:35 +0000	[thread overview]
Message-ID: <ECADFF3FD767C149AD96A924E7EA6EAF053C2732@USCULXMSG02.am.sony.com> (raw)
In-Reply-To: <579F544B.2010507@osg.samsung.com>



> -----Original Message-----
> From: ksummit-discuss-bounces@lists.linuxfoundation.org [mailto:ksummit-
> discuss-bounces@lists.linuxfoundation.org] On Behalf Of Shuah Khan
 On 07/29/2016 08:28 AM, Steven Rostedt wrote:
> > On Fri, 29 Jul 2016 11:59:47 +0300
> > Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:
> >
> >> Another limitation of kselftest is the lack of standardization for logging and
> >> status reporting. This would be needed to interpret the test output in a
> >> consistent way and generate reports. Regardless of whether we extend
> kselftest
> >> to cover device drivers this would in my opinion be worth fixing.
> >>
> >
> > Perhaps this should be a core topic at KS.
> >
> 
> Yes definitely. There has been some effort in standardizing,
> but not enough. We can discuss and see what would make the
> kselftest more usable without adding external dependencies.
> 
> One thing we could do is add script to interpret and turn the
> test output into usable format.

Just FYI on what Fuego [1] does here:

It basically has to take the output from tests with many different output formats,
and convert each one into a single pass/fail value for each test, for the Jenkins interface.

It uses a short shell function called log_compare, which it
uses to scan  a log (the test program output) looking for a regular expression.  It is
passed a test_name, match_count, a regular_expression, and a result_category.
The result category is "p" for positive or "n" for negative.  The regular expression is
passed to "grep -E <regular_expression> <logfile> | wc -l" and the result is compared
to the match_count.  If it matches, then an additional comparison is made between
the logfile filtered by the regular_expression and one saved previously.  If the number
of occurrences match, and the current filtered log matches the previously filtered log,
then the test is considered to have succeeded.  The test_name is used to find the
previously saved filtered log.

Here is the code, in case the description is not clear:
function log_compare {
# 1 - test_name, 2 - match_count, 3 - regular_expression, 4 - n/p (i.e. negative or positive)

  cd "$FUEGO_LOGS_PATH/${JOB_NAME}/testlogs"
  LOGFILE="${NODE_NAME}.${BUILD_ID}.${BUILD_NUMBER}.log"
  PARSED_LOGFILE="${NODE_NAME}.${BUILD_ID}.${BUILD_NUMBER}.{4}.log"

  if [ -e $LOGFILE ]; then
    current_count=`cat $LOGFILE | grep -E "${3}" 2>&1 | wc -l`
    if [ $current_count -eq $2 ];then
      cat $LOGFILE | grep -E "${3}" | tee "$PARSED_LOGFILE"
      local TMP_P=`diff -u ${WORKSPACE}/../ref_logs/${JOB_NAME}/${1}_${4}.log "$PARSED_LOGFILE" 2>&1`
      if [ $? -ne 0 ];then
        echo -e "\nFuego error reason: Unexpected test log output:\n$TMP_P\n"
        check_create_functional_logrun "test error"
        false
      else
        check_create_functional_logrun "passed"
        true
      fi
    else
      echo -e "\nFuego error reason: Mismatch in expected ($2) and actual ($current_count) pos/neg ($4) results. (pattern: $3)\n"
      check_create_functional_logrun "failed"
      false
    fi
  else
    echo -e "\nFuego error reason: 'logs/${JOB_NAME}/testlogs/$LOGFILE' is missing.\n"
    check_create_functional_logrun "test error"
    false
  fi

  cd -
}

This is called with a line like the following:
   log_compare $TESTNAME, "11", "^Test-.*OK", "p" 
or
  log_compare $TESTNAME, "0", "^Test-.*Failed", "n"

The reason for the match_count is that many tests that Fuego runs have
lots of sub-tests, (LTP being a prime example) and you want to figure out
if you're getting the same number of positive or negative results
that you are expecting.  The match_count is sometimes parameterized, so
that you can tune the system to ignore some failures.

The system ships with <test_name>_p.log and <test_name>_n.log files
(previously filtered log files) for each test.

I think in general you want a system that provides default expected results
while still allowing developers to tune it for individual sub-tests that
fail for some reason on their system.  One of the biggest problems with
tests is that users often don't have a baseline of what they should expect
to see (what is "good" output vs. what actually shows a problem).

'grep -E is <regular_expression>' is about the most basic thing you
can do in terms of parsing a log.  Fuego also includes a python-based
parser to extract out benchmarking data, for use in charting and
threshold regression checking, but that seems like overkill for a first pass
at this with kselftest. (IMHO)

FWIW I'm interested in how this shakes out because I want to wrap kselftest into
Fuego.  I'm not on the list for the summit, but I'd like to stay in the discussion via e-mail.
 -- Tim

[1] http://bird.org/fuego/FrontPage

P.S. by the way, there's a bug in the above log_compare code.  Don't use it directly.

  reply	other threads:[~2016-08-03  4:47 UTC|newest]

Thread overview: 259+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 22:35 Jiri Kosina
2016-07-08 23:12 ` Guenter Roeck
2016-07-08 23:38   ` Luck, Tony
2016-07-09  8:34     ` Jiri Kosina
2016-07-09  8:58       ` Guenter Roeck
2016-07-09  9:29       ` Johannes Berg
2016-07-09 15:19         ` Jason Cooper
2016-07-09 16:04           ` Guenter Roeck
2016-07-09 19:15         ` Vlastimil Babka
2016-08-01  9:32           ` Johannes Berg
2016-08-01 11:10             ` Vlastimil Babka
2016-07-09 18:39       ` Andrew Lunn
2016-07-10  1:22       ` Rafael J. Wysocki
2016-07-08 23:52   ` Rafael J. Wysocki
2016-07-09  0:06     ` Dmitry Torokhov
2016-07-09  8:37       ` Jiri Kosina
2016-07-09  9:12         ` Mark Brown
2016-07-09  0:10   ` Dmitry Torokhov
2016-07-09  0:37     ` Rafael J. Wysocki
2016-07-09  0:43       ` Dmitry Torokhov
2016-07-09  1:53         ` Guenter Roeck
2016-07-09 10:05         ` James Bottomley
2016-07-09 15:49           ` Trond Myklebust
2016-07-09 22:41             ` Dan Williams
2016-07-10  1:34             ` James Bottomley
2016-07-10  1:43               ` Trond Myklebust
2016-07-10  1:56                 ` James Bottomley
2016-07-10  2:12                   ` Trond Myklebust
2016-07-10  2:15                   ` Rafael J. Wysocki
2016-07-10  3:00                     ` James Bottomley
2016-07-10  3:07                       ` Trond Myklebust
2016-07-26 13:35                       ` David Woodhouse
2016-07-26 13:44                         ` Guenter Roeck
2016-07-26 14:33                           ` David Woodhouse
2016-07-26 15:52                             ` Guenter Roeck
2016-07-28 21:02                             ` Laurent Pinchart
2016-07-29  0:10                               ` Steven Rostedt
2016-07-29  8:59                                 ` Laurent Pinchart
2016-07-29 14:28                                   ` Steven Rostedt
2016-08-01 13:53                                     ` Shuah Khan
2016-08-03  4:47                                       ` Bird, Timothy [this message]
2016-07-29 15:12                                   ` Mark Brown
2016-07-29 15:20                                     ` Steven Rostedt
2016-07-29 15:50                                       ` Mark Brown
2016-07-29 16:06                                         ` Steven Rostedt
2016-07-29 16:48                                           ` Mark Brown
2016-07-29 17:02                                             ` Steven Rostedt
2016-07-29 21:07                                               ` Alexandre Belloni
2016-07-29 21:40                                                 ` Steven Rostedt
2016-08-01 13:41                                                   ` Laurent Pinchart
2016-07-30 16:19                                               ` Luis R. Rodriguez
2016-08-01 13:35                                     ` Laurent Pinchart
2016-08-01 14:24                                       ` Mark Brown
2016-08-02 14:12                       ` Jani Nikula
2016-08-02 15:34                         ` Mark Brown
2016-08-02 23:17                           ` Rafael J. Wysocki
2016-08-03  9:36                             ` Jani Nikula
2016-08-03 11:09                               ` Greg KH
2016-08-03 13:05                                 ` Jani Nikula
2016-08-03 13:26                                   ` Greg KH
2016-08-03 13:48                                     ` Jiri Kosina
2016-08-03 13:57                                       ` James Bottomley
2016-08-03 13:59                                         ` Jiri Kosina
2016-08-03 14:04                                           ` James Bottomley
2016-08-03 14:10                                             ` Jiri Kosina
2016-08-04  1:23                                             ` Steven Rostedt
2016-08-04  8:20                                               ` Greg KH
2016-08-04 13:33                                                 ` Steven Rostedt
2016-08-04 15:32                                                   ` Takashi Iwai
2016-08-04 15:40                                                     ` Steven Rostedt
2016-08-04 15:47                                                     ` Jiri Kosina
2016-08-04 16:18                                                       ` Takashi Iwai
2016-08-04 16:26                                                         ` Steven Rostedt
2016-08-04 15:44                                                   ` Mark Brown
2016-08-04 15:56                                                     ` James Bottomley
2016-08-04 17:01                                                       ` Mark Brown
2016-08-04 17:11                                                         ` Steven Rostedt
2016-08-04 17:53                                                           ` Mark Brown
2016-08-05  8:16                                                           ` Jani Nikula
2016-08-04 16:14                                                     ` Steven Rostedt
2016-08-04 17:51                                                       ` Mark Brown
2016-08-04 18:16                                                       ` Geert Uytterhoeven
2016-08-04 18:44                                                         ` Steven Rostedt
2016-08-04 18:48                                                           ` Geert Uytterhoeven
2016-08-04 19:06                                                             ` Mark Brown
2016-08-04 18:52                                                           ` Laurent Pinchart
2016-08-04 19:30                                                             ` Steven Rostedt
2016-08-03 14:45                                         ` Mark Brown
2016-08-04 13:48                                         ` Geert Uytterhoeven
2016-08-03 14:19                                       ` Greg KH
2016-08-03 14:45                                         ` Jiri Kosina
2016-08-03 15:48                                           ` Guenter Roeck
2016-08-03 16:12                                             ` Dmitry Torokhov
2016-08-03 16:44                                               ` Guenter Roeck
2016-08-03 17:20                                                 ` Dmitry Torokhov
2016-08-03 18:21                                                   ` Guenter Roeck
2016-08-03 18:59                                                     ` Dmitry Torokhov
2016-08-03 21:25                                                       ` Jiri Kosina
2016-08-03 21:31                                                         ` Dmitry Torokhov
2016-08-03 21:36                                                           ` Jiri Kosina
2016-08-04  3:06                                                             ` Steven Rostedt
2016-08-03 22:25                                                           ` Guenter Roeck
2016-08-04 14:02                                                         ` Jan Kara
2016-08-03 18:57                                                 ` Jiri Kosina
2016-08-03 22:16                                                   ` Guenter Roeck
2016-08-04  3:14                                               ` Steven Rostedt
2016-08-04  3:32                                                 ` Dmitry Torokhov
2016-08-04  4:05                                                   ` Steven Rostedt
2016-08-04  8:27                                               ` Greg KH
2016-08-04  8:21                                             ` Greg KH
2016-08-05  4:46                                             ` Jonathan Cameron
2016-08-03 14:12                                     ` Jani Nikula
2016-08-03 14:33                                       ` Daniel Vetter
2016-08-03 13:20                                 ` Rafael J. Wysocki
2016-08-03 13:21                                   ` Jiri Kosina
2016-08-04  1:05                                     ` Rafael J. Wysocki
2016-08-03 13:39                                   ` Greg KH
2016-08-03 14:10                                     ` Chris Mason
2016-08-04  0:37                                     ` Rafael J. Wysocki
2016-08-03 15:47                                 ` Guenter Roeck
2016-08-04  8:25                                   ` Greg KH
2016-08-03 11:12                               ` Mark Brown
2016-07-10  2:27                   ` Dan Williams
2016-07-10  6:10                     ` Guenter Roeck
2016-07-11  4:03                     ` [Ksummit-discuss] [CORE TOPIC] kernel unit testing Trond Myklebust
2016-07-11  4:22                       ` James Bottomley
2016-07-11  4:30                         ` Trond Myklebust
2016-07-11  5:23                       ` Guenter Roeck
2016-07-11  8:56                         ` Hannes Reinecke
2016-07-11 16:20                         ` Mark Brown
2016-07-11 19:58                       ` Dan Williams
2016-07-12  9:35                         ` Jan Kara
2016-07-13  4:56                           ` Dan Williams
2016-07-13  9:04                             ` Jan Kara
2016-07-11 20:24                       ` Kevin Hilman
2016-07-11 23:03                         ` Guenter Roeck
2016-07-18  7:44                           ` Christian Borntraeger
2016-07-18  8:44                             ` Hannes Reinecke
2016-07-28 21:09                         ` Laurent Pinchart
2016-07-28 21:33                           ` Bird, Timothy
2016-08-02 18:42                           ` Kevin Hilman
2016-08-02 19:44                             ` Laurent Pinchart
2016-08-02 20:33                               ` Mark Brown
2016-07-13  4:48                       ` Alex Shi
2016-07-13  9:07                         ` Greg KH
2016-07-13 12:37                           ` Alex Shi
2016-07-13 19:59                             ` Olof Johansson
2016-07-13 22:23                               ` Alex Shi
2016-07-14  1:19                             ` Greg KH
2016-07-14  9:48                               ` Alex Shi
2016-07-14  9:54                                 ` Ard Biesheuvel
2016-07-14 14:13                                   ` Alex Shi
2016-07-13 14:34                           ` Mark Brown
2016-07-14  3:17                             ` Greg KH
2016-07-14 10:06                               ` Mark Brown
2016-07-15  0:22                                 ` Greg KH
2016-07-15  0:51                                   ` Guenter Roeck
2016-07-15  1:41                                     ` Greg KH
2016-07-15  2:56                                       ` Guenter Roeck
2016-07-15  4:29                                         ` Greg KH
2016-07-15  5:52                                           ` NeilBrown
2016-07-15  6:14                                             ` Greg KH
2016-07-15  7:02                                               ` Jiri Kosina
2016-07-15 11:42                                                 ` Greg KH
2016-07-15 11:47                                                   ` Jiri Kosina
2016-07-15 12:17                                                   ` Geert Uytterhoeven
2016-07-15  6:19                                             ` Rik van Riel
2016-07-15 12:17                                               ` Mark Brown
2016-07-26 13:45                                                 ` David Woodhouse
2016-07-15  6:32                                             ` James Bottomley
2016-07-15  7:01                                               ` NeilBrown
2016-07-15  7:28                                                 ` James Bottomley
2016-07-15  7:36                                                 ` Dmitry Torokhov
2016-07-15  9:29                                                   ` NeilBrown
2016-07-15 16:08                                                     ` Dmitry Torokhov
2016-07-15 11:05                                               ` Geert Uytterhoeven
2016-07-15 12:35                                                 ` James Bottomley
2016-07-15 12:44                                                   ` Geert Uytterhoeven
2016-07-15 11:24                                             ` Vlastimil Babka
2016-07-28 22:07                                               ` Laurent Pinchart
2016-07-21  7:13                                           ` Daniel Vetter
2016-07-21  7:44                                             ` Josh Triplett
2016-07-15 11:10                                     ` Mark Brown
2016-07-15 11:40                                       ` Greg KH
2016-07-15 12:38                                         ` Mark Brown
2016-07-10  2:07                 ` [Ksummit-discuss] [CORE TOPIC] stable workflow Rafael J. Wysocki
2016-07-10  6:19               ` Olof Johansson
2016-07-10 14:42                 ` Theodore Ts'o
2016-07-11  1:18                   ` Olof Johansson
2016-07-10  7:29           ` Takashi Iwai
2016-07-10 10:20             ` Jiri Kosina
2016-07-10 13:33               ` Guenter Roeck
2016-07-15  9:27                 ` Zefan Li
2016-07-15 13:52                   ` Guenter Roeck
2016-07-26 13:08           ` David Woodhouse
2016-07-10  7:37     ` Takashi Iwai
2016-07-09  0:06 ` Jason Cooper
2016-07-09  0:42   ` James Bottomley
2016-07-09  8:43     ` Jiri Kosina
2016-07-09  9:36       ` Mark Brown
2016-07-09 15:13         ` Guenter Roeck
2016-07-09 19:40           ` Sudip Mukherjee
2016-07-11  8:14             ` Jiri Kosina
2016-07-09 21:21           ` Theodore Ts'o
2016-07-11 15:13             ` Mark Brown
2016-07-11 17:03               ` Theodore Ts'o
2016-07-11 17:07                 ` Justin Forbes
2016-07-11 17:11                 ` Mark Brown
2016-07-11 17:13                   ` Olof Johansson
2016-07-11 17:17                     ` Mark Brown
2016-07-11 17:24                       ` Guenter Roeck
2016-07-11 17:44                         ` Mark Brown
2016-07-13  1:08                   ` Geert Uytterhoeven
2016-07-11 17:15                 ` Dmitry Torokhov
2016-07-11 17:20                   ` Theodore Ts'o
2016-07-11 17:26                     ` Dmitry Torokhov
2016-07-11 17:27                     ` Olof Johansson
2016-07-11 23:13                   ` Guenter Roeck
2016-07-11 17:17                 ` Josh Boyer
2016-07-11 22:42                 ` James Bottomley
2016-07-20 17:50                 ` Stephen Hemminger
2016-07-11  8:18           ` Jiri Kosina
2016-07-11 23:32             ` Guenter Roeck
2016-07-11 14:22           ` Mark Brown
2016-07-10 16:22         ` Vinod Koul
2016-07-10 17:01           ` Theodore Ts'o
2016-07-10 18:28             ` Guenter Roeck
2016-07-10 22:38               ` Rafael J. Wysocki
2016-07-11  8:47                 ` Jiri Kosina
2016-07-27  3:19                 ` Steven Rostedt
2016-07-10 22:39               ` Theodore Ts'o
2016-07-11  1:12                 ` Olof Johansson
2016-07-11  5:00             ` Vinod Koul
2016-07-11  5:13               ` Theodore Ts'o
2016-07-11 10:57                 ` Luis de Bethencourt
2016-07-11 14:18                 ` Vinod Koul
2016-07-11 17:34                   ` Guenter Roeck
2016-07-27  3:12                   ` Steven Rostedt
2016-07-27  4:36                     ` Vinod Koul
2016-07-09 14:57     ` Jason Cooper
2016-07-09 22:51       ` Jonathan Corbet
2016-07-10  7:21 ` Takashi Iwai
2016-07-11  7:44 ` Christian Borntraeger
2016-08-02 13:49 ` Jani Nikula
  -- strict thread matches above, loose matches on Subject: below --
2014-05-02 19:42 Jiri Kosina
2014-05-02 19:43 ` Josh Boyer
2014-05-02 20:09 ` Steven Rostedt
2014-05-02 20:12   ` Jiri Kosina
2014-05-02 20:22     ` Josh Boyer
2014-05-02 20:27     ` Steven Rostedt
2014-05-02 20:30       ` Jiri Kosina
2014-05-03 15:20       ` Greg Kroah-Hartman
2014-05-03 15:40       ` Greg Kroah-Hartman
2014-05-02 22:16     ` Jan Kara
2014-05-02 20:33 ` Ben Hutchings
2014-05-02 20:51 ` Paul E. McKenney
2014-05-02 20:57 ` Mark Brown
2014-05-02 23:35   ` Guenter Roeck
2014-05-03 15:22 ` Greg KH

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=ECADFF3FD767C149AD96A924E7EA6EAF053C2732@USCULXMSG02.am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=rostedt@goodmis.org \
    --cc=shuahkh@osg.samsung.com \
    --cc=trondmy@primarydata.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox