From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] memcg_stress_test.sh: Respect LTP_TIMEOUT_MUL set by user
Date: Fri, 30 Aug 2019 10:50:36 +0200 [thread overview]
Message-ID: <20190830085036.GA27453@dell5510> (raw)
In-Reply-To: <CAEemH2dzn92GYwiw2tP101wNkYfM30rfL=cmPU+B1iH-8UWoDw@mail.gmail.com>
Hi Li,
Good point. Something like this could do it:
-LTP_TIMEOUT_MUL=7
+min_timeout=7
+[ -z "$LTP_TIMEOUT_MUL" -o "$LTP_TIMEOUT_MUL" -lt $min_timeout ] && LTP_TIMEOUT_MUL=$min_timeout
Unless we test only integers:
+[ is_int "$LTP_TIMEOUT_MUL" -o "$LTP_TIMEOUT_MUL" -lt $min_timeout ] && LTP_TIMEOUT_MUL=$min_timeout
But that'd require using only integers, while C allows to use floating point
numbers :(. We can
1) either live with the limitation of integers for shell (+ document it)
2) or use awk or bc (but that's external dependency for shell tests (currently
tst_test.sh requires: cut, tr, wc; tst_net.sh requires awk and ip; so I'd be for
awk dependency; dependencies should be documented as well)
3) write simple utility (tst_float_cmp.c) to compare strings for us
Of course, we can test only integers:
+[ is_int "$LTP_TIMEOUT_MUL" -o "$LTP_TIMEOUT_MUL" -lt $min_timeout ] && LTP_TIMEOUT_MUL=$min_timeout
Also, C code requires LTP_TIMEOUT_MUL > 1 in tst_set_timeout().
We don't have this check. Again, adding it brings problem with float number.
Kind regards,
Petr
> On Fri, Aug 30, 2019 at 2:12 AM Petr Vorel <pvorel@suse.cz> wrote:
> > While it's good to increase the default LTP_TIMEOUT_MUL value, give user
> > a chance to change it.
> It's a good proposal, but one thing we need to consider that there is
> possible to pass a small timeout value(<5mins) from the user. So what
> about set a condition judgment which only accepts time value which >=
> 7?
> > # Each test case runs for 900 secs when everything fine
> > # therefore the default 5 mins timeout is not enough.
> Here the code comments reminder this.
next prev parent reply other threads:[~2019-08-30 8:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 18:11 [LTP] [PATCH] memcg_stress_test.sh: Respect LTP_TIMEOUT_MUL set by user Petr Vorel
2019-08-30 2:39 ` Li Wang
2019-08-30 8:50 ` Petr Vorel [this message]
2019-08-30 9:07 ` Cristian Marussi
2019-08-30 10:46 ` Petr Vorel
2019-09-02 2:34 ` Li Wang
2019-09-12 9:04 ` Clemens Famulla-Conrad
2019-09-12 9:33 ` Cristian Marussi
2019-09-12 9:34 ` Li Wang
2019-09-12 9:51 ` Clemens Famulla-Conrad
2019-09-12 9:55 ` Cristian Marussi
2019-09-12 10:16 ` Clemens Famulla-Conrad
2019-09-12 15:28 ` Petr Vorel
2019-09-12 16:47 ` Clemens Famulla-Conrad
2019-09-12 17:01 ` 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=20190830085036.GA27453@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