public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Chunyu Hu <chuhu@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests
Date: Wed, 11 May 2016 07:14:00 -0400 (EDT)	[thread overview]
Message-ID: <1323565361.45358853.1462965240991.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160510142504.GC20387@rei>



----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Chunyu Hu" <chuhu@redhat.com>
> Cc: ltp@lists.linux.it, liwan@redhat.com
> Sent: Tuesday, May 10, 2016 10:25:04 PM
> Subject: Re: [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests
> 
> Hi!
> > > > +	local p=1;
> > > > +	while [ $p -lt $NR_PIDS ]; do
> > > > +                local kill_pid=pid${p}
> > > > +                kill -KILL ${!kill_pid}
> > >                                 ^
> > > 				Bashism.
> > 
> > I am trying to change to use this way
> > 
> >     local pid_var=pid${p}
> >                 eval local kill_pid=\$${pid_var}
> >                 tst_resm TINFO "killing ${kill_pid}"
> >                 eval kill -KILL $kill_pid
> >                 wait ${kill_pid}
> > 
> > maybe i'm still using bashism?  thanks. if it's ok
> > then i will use this way.
> > 
> > Ideally i should find a dash to try. but i have not
> > found the package in rhel.
> 
> You can always compile it from source:
> 
> http://gondor.apana.org.au/~herbert/dash/files/

Thanks. I compiled and tried, although test didn't hit issue,
but this is all because it's using sh xxxxx.sh to execute sub tests,
if i executed the cmd on bash directly, it would tell me the error.


> 
> And there also seems to be debian devel perl script that can check for
> bashism, maybe we can start using it to check shell scripts:
> 
> https://anonscm.debian.org/cgit/collab-maint/devscripts.git/tree/scripts/checkbashisms.pl

Thanks for the useful info, I tried the tool, it did find the bashism issue of ${!var}. 
and it also found another issue in ftrace_tracing_cpu_mask.sh of $(( a | (1 << $b) )),
i have changed to use $((a | $(( 1 << $b)) )) instead. 


> > > > +export_pids()
> > > > +{
> > > > +	local p=0
> > > > +	while [ $p -lt $NR_PIDS ]; do
> > > > +		export pid${p}
> > > > +		p=$((p + 1))
> > > > +	done
> > > > +}
> > > >  
> > > > +cd ftrace_stress/
> > > 
> > > Why the cd? It does not seem to be needed.
> > 
> > as currently we are in ftrace_test/, but sub stresses
> > cases are in ftrace_test/ftrace_stress/
> > 
> > in test_stress(), i start the sub script using
> > 
> >   sh ftrace_${target}.sh &
> > 
> > This make the path shorter. If you don't have objection,
> > I will move the cd ftrace_stress/ into test_stress().
> > What do you think of this?
> 
> The stress tests are installed into $DESTDIR/testcases/bin/ aren't they?
> 
> If that is the case these scripts are in $PATH and could be executed
> without fiddling with full path.

[root@dhcp-chuhu bin]# ls ftrace_*  -d
ftrace_lib.sh  ftrace_regression01.sh  ftrace_regression02.sh  ftrace_stress  ftrace_stress_test.sh
[root@dhcp-chuhu bin]# pwd
/opt/ltp/testcases/bin

tests are under subdir ftrace_stress of bin. so we need a cd. 
but also  can just remove it and use ftrace_stress/${target}.sh
instead, ok, i will use this way.  Please ignore the previous V3,
that's not complete considering this.

> --
> Cyril Hrubis
> chrubis@suse.cz
> 

-- 
Regards,
Chunyu Hu


  reply	other threads:[~2016-05-11 11:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  8:04 [LTP] [PATCH V2 0/9] tracing: make ftrace tests to be extended Chunyu Hu
2016-04-18  8:04 ` [LTP] [PATCH V2 1/9] tracing: reorganize ftrace-stress tests to general tests Chunyu Hu
2016-04-18  8:04   ` [LTP] [PATCH V2 2/9] tracing/ftrace: add new case for ftrace userstacktrace Chunyu Hu
2016-04-18  8:04     ` [LTP] [PATCH V2 3/9] tracing/ftrace: add a new case for signal_generate Chunyu Hu
2016-04-18  8:04       ` [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests Chunyu Hu
2016-04-18  8:04         ` [LTP] [PATCH V2 5/9] ftrace_stress: keep the name of testscipt in sync with tracing file Chunyu Hu
2016-04-18  8:04           ` [LTP] [PATCH V2 6/9] testcases/lib: Add tst_random decmical integer generator Chunyu Hu
2016-04-18  8:04             ` [LTP] [PATCH V2 7/9] ftrace_stress: update the trace_options test Chunyu Hu
2016-04-18  8:04               ` [LTP] [PATCH V2 8/9] ftrace_stress: add two new tests Chunyu Hu
2016-04-18  8:04                 ` [LTP] [PATCH V2 9/9] ftrace_stress: cleanup and use ltp API Chunyu Hu
2016-05-04 14:56                   ` Cyril Hrubis
2016-05-04 15:42                     ` Chunyu Hu
2016-05-04 16:32                       ` Cyril Hrubis
2016-05-05  7:44                       ` Chunyu Hu
2016-05-10 14:13                         ` Cyril Hrubis
2016-05-11 11:01                           ` Chunyu Hu
2016-05-04 16:57               ` [LTP] [PATCH V2 7/9] ftrace_stress: update the trace_options test Cyril Hrubis
2016-05-04 13:34             ` [LTP] [PATCH V2 6/9] testcases/lib: Add tst_random decmical integer generator Cyril Hrubis
2016-05-04 15:04               ` Chunyu Hu
2016-05-04 15:55                 ` Cyril Hrubis
2016-05-04 16:28                   ` Chunyu Hu
2016-05-04 23:40                     ` Chunyu Hu
2016-05-04 16:50         ` [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests Cyril Hrubis
2016-05-05  0:53           ` Chunyu Hu
2016-05-10 14:25             ` Cyril Hrubis
2016-05-11 11:14               ` Chunyu Hu [this message]
2016-05-04 16:00     ` [LTP] [PATCH V2 2/9] tracing/ftrace: add new case for ftrace userstacktrace Cyril Hrubis
2016-05-05  6:24       ` Li Wang
2016-05-04 16:26   ` [LTP] [PATCH V2 1/9] tracing: reorganize ftrace-stress tests to general tests Cyril Hrubis
2016-05-05  6:21     ` Li Wang
2016-05-05 10:11     ` Chunyu Hu
2016-05-05 10:53       ` Chunyu Hu

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=1323565361.45358853.1462965240991.JavaMail.zimbra@redhat.com \
    --to=chuhu@redhat.com \
    --cc=ltp@lists.linux.it \
    /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