All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Tim.Bird@sony.com>
To: <pvorel@suse.cz>, <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v2 2/3] tst_test: Print environment variables on -h
Date: Tue, 14 Dec 2021 17:53:26 +0000	[thread overview]
Message-ID: <BYAPR13MB250371A7DC839014B8219104FD759@BYAPR13MB2503.namprd13.prod.outlook.com> (raw)
In-Reply-To: <YbjNExvj1vjnjb93@pevik>

> -----Original Message-----
> From: Petr Vorel <pvorel@suse.cz>
> 
> > Hi Tim,
> 
> > > > +	fprintf(stderr, "LTP_TIMEOUT_MUL      Multiply timeout (must be number >= 1)\n");
> 
> > > I think this should this be: "Timeout multiplier (must be a number >=1, should be an integer)
> 
> > Also makes sense, thanks!
> Although it does not have to be integer.
> => "Timeout multiplier (must be a number >=1"
> 
> For C API it's used any value:
> ./open01
> tst_test.c:1409: TINFO: Timeout per run is 0h 05m 00s
> 
> LTP_TIMEOUT_MUL=1.15 ./open01
> tst_test.c:1409: TINFO: Timeout per run is 0h 05m 45s
>
When I grepped the source code I saw the usage in testcases/lib/tst_test.sh,
but somehow missed the usage in lib/tst_test.c (sloppy on my part!)

Thanks for pointing this out.
 
> For shell API:
> ./zram02.sh
> zram02 1 TINFO: timeout per run is 0h 5m 0s
> zram02 1 TINFO: timeout per run is 0h 7m 30s
> 
> LTP_TIMEOUT_MUL=1.15 ./zram02.sh
> zram02 1 TINFO: ceiling LTP_TIMEOUT_MUL to 2
> zram02 1 TINFO: timeout per run is 0h 10m 0s
> zram02 1 TINFO: timeout per run is 0h 15m 0s
> 
> Doc [1] explain it: Variable is also used in shell tests, but ceiled to int.
> 
Would it be useful to add a bit of code to tst_test.sh to handle
floating point?  The shell construct of '$((timeout * LTP_TIMEOUT_MUL))'
can't handle floating point, but floating point could be done pretty easily
with a callout to awk or bc.

I'm willing to look at this and submit a patch.  But does the shell
test system try to avoid dependencies on other utility programs (like awk or bc)?

Maybe rounding timeouts up is preferred behavior anyway, so
this is not needed.  What do you think?

In any event, I retract my "should be an integer" suggestion. :-)

 -- Tim


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-12-14 17:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 14:43 [LTP] [PATCH v2 0/3] Add support for debugging .all_filesystems Petr Vorel
2021-12-14 14:43 ` [LTP] [PATCH v2 1/3] lib: Introduce tst_defaults.h Petr Vorel
2021-12-14 14:43 ` [LTP] [PATCH v2 2/3] tst_test: Print environment variables on -h Petr Vorel
2021-12-14 16:44   ` Tim.Bird
2021-12-14 16:47     ` Petr Vorel
2021-12-14 16:57       ` Petr Vorel
2021-12-14 17:53         ` Tim.Bird [this message]
2021-12-14 18:54           ` Petr Vorel
2021-12-15  7:36             ` Li Wang
2021-12-15  9:49             ` Cyril Hrubis
2021-12-14 14:43 ` [LTP] [PATCH v2 3/3] lib: Add support for debugging .all_filesystems Petr Vorel
2021-12-14 16:03   ` Cyril Hrubis
2021-12-14 16:46     ` Petr Vorel
2021-12-15  7:49       ` Li Wang
2021-12-15  9:28         ` Petr Vorel
2021-12-15  9:30         ` Cyril Hrubis
2021-12-15  9:49           ` Li Wang
2021-12-15  9:54             ` 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=BYAPR13MB250371A7DC839014B8219104FD759@BYAPR13MB2503.namprd13.prod.outlook.com \
    --to=tim.bird@sony.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.