public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/4] cgroup_regression_test.sh ported to newlib
Date: Fri, 21 Dec 2018 15:35:07 +0100	[thread overview]
Message-ID: <20181221143507.GB27446@dell5510> (raw)
In-Reply-To: <20181220182149.48326-2-cristian.marussi@arm.com>

Hi Cristian,

...
> +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
...
> -cd $LTPROOT/testcases/bin
You left this even after second commit. It's not needed.

> +TST_TESTFUNC=do_test
> +TST_SETUP=do_setup
> +TST_CLEANUP=do_cleanup
> +TST_CNT=10
> +TST_NEEDS_ROOT=1
> +TST_NEEDS_CMDS="dmesg mountpoint mount umount cat kill find mkdir rmdir grep"
Test needs also using temporary directory (as it creates directories):
TST_NEEDS_TMPDIR=1


> -export TCID="cgroup_regression_test"
> -export TST_TOTAL=10
> -export TST_COUNT=1
> +. tst_test.sh

> -failed=0
> +do_setup()
> +{
> +	cd $LTPROOT/testcases/bin
And here.

...
> +do_cleanup()
> +{
> +	cd $LTPROOT/testcases/bin
One more time.

...
> -for ((cur = 1; cur <= $TST_TOTAL; cur++))
> +do_test()
>  {
> -	export TST_COUNT=$cur
> +	local cur=$1

>  	test_$cur
>  }

do_test() function is not needed at all, looping can be done automatically:
Remove underscore from test functions (s/test_([0-9]+)/test$1/)
and change setup: TST_TESTFUNC=test

See
https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#user-content-2-3-1-basic-test-interface


Kind regards,
Petr

  parent reply	other threads:[~2018-12-21 14:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 18:21 [LTP] [PATCH v2 0/4] cgroup tests newlib-porting Cristian Marussi
2018-12-20 18:21 ` [LTP] [PATCH v2 1/4] cgroup_regression_test.sh ported to newlib Cristian Marussi
2018-12-21 14:25   ` Petr Vorel
2018-12-21 15:20     ` Cristian Marussi
2018-12-21 18:23       ` Cristian Marussi
2018-12-21 14:35   ` Petr Vorel [this message]
2018-12-21 15:27     ` Cristian Marussi
2018-12-20 18:21 ` [LTP] [PATCH v2 2/4] cgroup_regression_test.sh cleanup Cristian Marussi
2018-12-20 18:21 ` [LTP] [PATCH v2 3/4] cgroup_regression_test.sh: added helper Cristian Marussi
2018-12-20 18:21 ` [LTP] [PATCH v2 4/4] cgroup: helpers various fixes Cristian Marussi
2018-12-21 14:01   ` Petr Vorel
2018-12-21 15:29     ` Cristian Marussi
2018-12-21 18:23     ` Cristian Marussi
2018-12-21 13:39 ` [LTP] [PATCH v2 0/4] cgroup tests newlib-porting Petr Vorel
2018-12-21 15:36   ` Cristian Marussi
2018-12-21 15:47     ` Petr Vorel
2018-12-21 18:23       ` Cristian Marussi

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=20181221143507.GB27446@dell5510 \
    --to=pvorel@suse.cz \
    --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