public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] device-drivers/rcu: add wrapper script for rcutorture test
Date: Wed, 12 Mar 2014 11:45:05 +0100	[thread overview]
Message-ID: <20140312104505.GA13689@rei.Home> (raw)
In-Reply-To: <532024B6.9080603@oracle.com>

Hi!
> >> +
> >> +	rmmod rcutorture > /dev/null 2>&1
> >> +	if [ $? -ne 0 ]; then
> >> +		tst_brkm TBROK NULL "failed to unload module"
> >> +		exit 2
> >> +	fi
> >> +
> >> +	# check module status in dmesg
> >> +	result_str=`dmesg | tail -n 1`
> > This is quite fragile, if anything has added a line into dmesg while the
> > test was running it will fail. Better approach would be to save the
> > dmesg output into a file and grep it for the rcutorture resutl.
> Why copy it to a file? I'm thinking about changing to this command, it 
> will return the last test result.
>
> result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+):.*/\1/p'`

I was just thinking how to make the race window as small as possible. In
order to do that I would save the output right after the test has
finished etc.

But it's quite unlikely that the whole kernel log buffer will be filled
with messages meanwhile.

> Don't need the last grep as well, will be as follows:
> if [ "$result_str" == "SUCCESS" ]; then
> ...
> >> +	echo "$result_str" | grep SUCCESS > /dev/null 2>&1
> >> +	if [ $? -eq 0 ]; then
> >> +		tst_resm TPASS "tc$TST_COUNT: completed"
> >> +	else
> >> +		tst_resm TFAIL "tc$TST_COUNT: failed, please check dmesg"
> >> +		RC=1
> > What about using the test.sh library I've send as a RFC into the mailing
> > list instead? Have you seen the code? It's modeled more closely to the C
> > interface and stores the exit value internally, manages the TST_COUNT,
> > etc...
> >
> > (http://sourceforge.net/p/ltp/mailman/message/31941597/)
> No, I missed the attachment :(

Sorry, I forgot to change the attachement to be inlined.

> Well done! I've tried it today with the rcutorture test,  have a few 
> questions:
> - tst_require_root returns with TBROK, I thought it should be TCONF 
> instead, shouldn't it?

Right, thanks for noticing.

> - LTP_TST_COUNT incremented on each call to tst_resm(), would it be 
> better to count only PASS/FAIL calls as it is in ltplib?

I've noticed this too a few days ago.

I will fix these problems and add push it into LTP git and update
test-writing-guidelines.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-03-12 10:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 13:37 [LTP] [PATCH] device-drivers/rcu: add wrapper script for rcutorture test Alexey Kodanev
2014-03-11 16:54 ` chrubis
2014-03-11 16:56   ` chrubis
     [not found]     ` <532028A6.5030106@oracle.com>
2014-03-12 10:51       ` chrubis
     [not found]         ` <53205971.5070608@oracle.com>
2014-03-12 13:23           ` chrubis
     [not found]   ` <532024B6.9080603@oracle.com>
2014-03-12 10:45     ` chrubis [this message]
     [not found]       ` <53204BC4.5040605@oracle.com>
2014-03-12 12:33         ` chrubis
2014-03-12 16:20       ` chrubis

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=20140312104505.GA13689@rei.Home \
    --to=chrubis@suse.cz \
    --cc=alexey.kodanev@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.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