Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/3] shell: Introduce TST_TIMEOUT variable
Date: Wed, 18 Sep 2019 11:40:39 +0200	[thread overview]
Message-ID: <20190918094039.GB11711@x230> (raw)
In-Reply-To: <1568629595.3028.13.camel@suse.de>

Hi Clements,

> Hi Petr,
> only some small comments below.

> On Fri, 2019-09-13 at 14:58 +0200, Petr Vorel wrote:
> > <snip>
> > -2.3.2 Library variables
> > -^^^^^^^^^^^^^^^^^^^^^^^
> > +2.3.2 Library environment variables for shell
> > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> >  Similarily to the C library various checks and preparations can be
> > requested
> >  simply by setting right '$TST_NEEDS_FOO'.
> > @@ -2047,6 +2058,14 @@ simply by setting right '$TST_NEEDS_FOO'.
> >                         the test (see below).
> >  | 'TST_NEEDS_MODULE' | Test module name needed for the test (see
> > below).
> >  | 'TST_NEEDS_DRIVERS'| Checks kernel drivers support for the test.
> > +| 'TST_TIMEOUT'      | Maximum timeout set for the test in sec. Must
> > be float

>       ^
> I think TST_TIMEOUT isn't evaluated in c at all. There we have `(struct
> tst_test*)->timeout` which is `int`,
> tst_test*)->timeout (BTW it's *unsigned* int).
Correct, thanks!
This is a proposed description, which I'll post to v3.
(using tst_test.timeout to be short enough, is that ok?):
| 'TST_TIMEOUT'      | Maximum timeout set for the test in sec. Must be int >= 1,
                       or -1 (special value to disable timeout), default is 300.
                       Variable is meant be set in tests, not by user.
                       It's equivalent of `tst_test.timeout` in C.
| 'LTP_TIMEOUT_MUL'  | Multiply timeout, must be number >= 1 (> 1 is useful for
                       slow machines to avoid unexpected timeout).
                       Variable is also used in C tests.
                       It's meant to be set by user, not in tests.
...
> > +	local sec
> > +	if [ "$is_float" ]; then
> > +		sec=`echo |awk '{printf("%d\n", '$TST_TIMEOUT' * 

>                           ^
>                           nit, space after |
Sure :).

> > '$LTP_TIMEOUT_MUL')}'`

>                    ^
>                    + 0.5
> In C implementation we round up. Maybe we should do the same in shell.
Correct, thanks!


Kind regards,
Petr

  reply	other threads:[~2019-09-18  9:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 12:58 [LTP] [PATCH v2 0/3] LTP_TIMEOUT for shell API Petr Vorel
2019-09-13 12:58 ` [LTP] [PATCH v2 1/3] shell: Add tst_is_num() Petr Vorel
2019-09-13 12:58 ` [LTP] [PATCH v2 2/3] shell: Introduce TST_TIMEOUT variable Petr Vorel
2019-09-16 10:15   ` Li Wang
2019-09-17 16:55     ` Petr Vorel
2019-09-18  3:21       ` Li Wang
2019-09-18  8:24         ` Petr Vorel
2019-09-18  8:46           ` Li Wang
2019-09-18  9:50             ` Petr Vorel
2019-09-18 10:14               ` Li Wang
2019-09-18 13:53                 ` Petr Vorel
2019-09-18 17:19                   ` Clemens Famulla-Conrad
2019-09-16 10:26   ` Clemens Famulla-Conrad
2019-09-18  9:40     ` Petr Vorel [this message]
2019-09-18 17:16       ` Clemens Famulla-Conrad
2019-09-13 12:58 ` [LTP] [PATCH v2 3/3] net/if-mtu-change.sh: set TST_TIMEOUT Petr Vorel
2019-09-16 10:37 ` [LTP] [PATCH v2 0/3] LTP_TIMEOUT for shell API Clemens Famulla-Conrad
2019-09-17 11:22   ` Petr Vorel

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=20190918094039.GB11711@x230 \
    --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