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 v5 3/5] shell: Add timeout shell API tests
Date: Fri, 11 Oct 2019 15:31:46 +0200	[thread overview]
Message-ID: <20191011133129.GA23391@dell5510> (raw)
In-Reply-To: <20191011125648.GF2591@rei>

Hi,

> > timeout02 1 TCONF: LTP_TIMEOUT_MUL must be number >= 1! (0)
> > BTW I wonder if TBROK shouldn't be used instead of TCONF.
> > Anybody strong opinion?

> If we fail to run a test because user passed wrong input data it has to
> be TBROK because TCONF can end up unnoticed.
+1.

I'd like to merge v5 with following diff:
Please let me know if anything else is problematic.

Kind regards,
Petr

diff --git lib/newlib_tests/shell/test_timeout.sh lib/newlib_tests/shell/test_timeout.sh
index 2cbc66412..948c7f02d 100755
--- lib/newlib_tests/shell/test_timeout.sh
+++ lib/newlib_tests/shell/test_timeout.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-PATH="$(dirname $0)/../../../testcases/lib/:$PATH"
+PATH="$(dirname $0):$(dirname $0)/../../../testcases/lib/:$PATH"
 
 DATA="
 timeout01.sh||0
@@ -9,6 +9,11 @@ timeout02.sh|foo|32
 timeout02.sh|2|0
 timeout02.sh|1.1|0
 timeout02.sh|-10|32
+
+timeout01.sh|2|0
+timeout02.sh|-1.1|32
+timeout02.sh|-10.1|32
+timeout02.sh|-0.1|0
 "
 
 echo "Testing timeout in shell API"
@@ -21,7 +26,7 @@ for i in $DATA; do
 	exp_exit=$(echo $i | cut -d'|' -f3)
 
 	echo "=== $test (LTP_TIMEOUT_MUL='$timeout') ==="
-	LTP_TIMEOUT_MUL=$timeout ./$file
+	LTP_TIMEOUT_MUL=$timeout $file
 	ret=$?
 	if [ $ret -ne $exp_exit ]; then
 		echo "FAILED (exit code: $ret, expected $exp_exit)"
diff --git testcases/lib/tst_test.sh testcases/lib/tst_test.sh
index 8713c1cdd..d8071cb10 100644
--- testcases/lib/tst_test.sh
+++ testcases/lib/tst_test.sh
@@ -389,14 +389,14 @@ _tst_setup_timer()
 
 	local err="LTP_TIMEOUT_MUL must be number >= 1!"
 
-	tst_is_num "$LTP_TIMEOUT_MUL" || tst_brk TCONF "$err ($LTP_TIMEOUT_MUL)"
+	tst_is_num "$LTP_TIMEOUT_MUL" || tst_brk TBROK "$err ($LTP_TIMEOUT_MUL)"
 
 	if ! tst_is_int "$LTP_TIMEOUT_MUL"; then
 		LTP_TIMEOUT_MUL=$(echo "$LTP_TIMEOUT_MUL" | cut -d. -f1)
 		LTP_TIMEOUT_MUL=$((LTP_TIMEOUT_MUL+1))
 		tst_res TINFO "ceiling LTP_TIMEOUT_MUL to $LTP_TIMEOUT_MUL"
 	fi
-	[ "$LTP_TIMEOUT_MUL" -ge 1 ] || tst_brk TCONF "$err ($LTP_TIMEOUT_MUL)"
+	[ "$LTP_TIMEOUT_MUL" -ge 1 ] || tst_brk TBROK "$err ($LTP_TIMEOUT_MUL)"
 
 	if ! tst_is_int "$TST_TIMEOUT" || [ "$TST_TIMEOUT" -lt 1 ]; then
 		tst_brk TBROK "TST_TIMEOUT must be int >= 1! ($TST_TIMEOUT)"

  reply	other threads:[~2019-10-11 13:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11  9:54 [LTP] [PATCH v5 0/5] shell: Introduce TST_TIMEOUT variable Petr Vorel
2019-10-11  9:54 ` [LTP] [PATCH v5 1/5] shell: Add tst_is_num() Petr Vorel
2019-10-11  9:54 ` [LTP] [PATCH v5 2/5] shell: Introduce TST_TIMEOUT variable, add checks Petr Vorel
2019-10-11  9:54 ` [LTP] [PATCH v5 3/5] shell: Add timeout shell API tests Petr Vorel
2019-10-11 12:36   ` Clemens Famulla-Conrad
2019-10-11 12:54     ` Petr Vorel
2019-10-11 12:56       ` Cyril Hrubis
2019-10-11 13:31         ` Petr Vorel [this message]
2019-10-11 14:02           ` Cyril Hrubis
2019-10-12  9:55           ` Li Wang
2019-10-14  8:47             ` Petr Vorel
2019-10-14  8:08           ` Clemens Famulla-Conrad
2019-10-14  8:46             ` Petr Vorel
2019-10-11  9:54 ` [LTP] [PATCH v5 4/5] memcg_stress_test.sh: use TST_TIMEOUT (replace LTP_TIMEOUT_MUL) Petr Vorel
2019-10-11  9:54 ` [LTP] [PATCH v5 5/5] net/if-mtu-change.sh: set TST_TIMEOUT Petr Vorel
2019-10-11 12:06 ` [LTP] [PATCH v5 0/5] shell: Introduce TST_TIMEOUT variable Cyril Hrubis
2019-10-11 12:39 ` Clemens Famulla-Conrad

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=20191011133129.GA23391@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