All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Check for -i0
@ 2022-05-20 12:43 Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 1/3] tst_test.sh: Allow -i0 Petr Vorel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-20 12:43 UTC (permalink / raw)
  To: ltp; +Cc: Martin Doucha

NOTE: this should be merged after Cyril's runtime patch
(will need to get rebased).

Kind regards,
Petr

Petr Vorel (3):
  tst_test.sh: Allow -i0
  tst_test: Check for -i >= 0
  doc/maintainer: Check also -i0

 doc/maintainer-patch-review-checklist.txt | 1 +
 lib/tst_test.c                            | 2 ++
 testcases/lib/tst_test.sh                 | 4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.36.1


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 1/3] tst_test.sh: Allow -i0
  2022-05-20 12:43 [LTP] [PATCH 0/3] Check for -i0 Petr Vorel
@ 2022-05-20 12:43 ` Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 2/3] tst_test: Check for -i >= 0 Petr Vorel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-20 12:43 UTC (permalink / raw)
  To: ltp; +Cc: Martin Doucha

-i0 is supported in C API, allowing to test only that setup and
cleanup are coded properly (no test is being run), which is useful for
debugging.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 28b7d12ba..c6e0752f3 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -646,8 +646,8 @@ tst_run()
 		tst_brk TBROK "Expected number (-i) not '$TST_ITERATIONS'"
 	fi
 
-	if [ "$TST_ITERATIONS" -le 0 ]; then
-		tst_brk TBROK "Number of iterations (-i) must be > 0"
+	if [ "$TST_ITERATIONS" -lt 0 ]; then
+		tst_brk TBROK "Number of iterations (-i) must be >= 0"
 	fi
 
 	[ "$TST_NEEDS_ROOT" = 1 ] && tst_require_root
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] tst_test: Check for -i >= 0
  2022-05-20 12:43 [LTP] [PATCH 0/3] Check for -i0 Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 1/3] tst_test.sh: Allow -i0 Petr Vorel
@ 2022-05-20 12:43 ` Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 3/3] doc/maintainer: Check also -i0 Petr Vorel
  2022-05-30 13:34 ` [LTP] [PATCH 0/3] Check for -i0 Cyril Hrubis
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-20 12:43 UTC (permalink / raw)
  To: ltp; +Cc: Martin Doucha

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 8e258594a..34cf1333b 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -618,6 +618,8 @@ static void parse_opts(int argc, char *argv[])
 			exit(0);
 		case 'i':
 			iterations = atoi(optarg);
+			if (iterations < 0)
+				tst_brk(TBROK, "Number of iterations (-i) must be >= 0");
 		break;
 		case 'I':
 			duration = atof(optarg);
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 3/3] doc/maintainer: Check also -i0
  2022-05-20 12:43 [LTP] [PATCH 0/3] Check for -i0 Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 1/3] tst_test.sh: Allow -i0 Petr Vorel
  2022-05-20 12:43 ` [LTP] [PATCH 2/3] tst_test: Check for -i >= 0 Petr Vorel
@ 2022-05-20 12:43 ` Petr Vorel
  2022-05-30 13:34 ` [LTP] [PATCH 0/3] Check for -i0 Cyril Hrubis
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-20 12:43 UTC (permalink / raw)
  To: ltp; +Cc: Martin Doucha

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/maintainer-patch-review-checklist.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/maintainer-patch-review-checklist.txt b/doc/maintainer-patch-review-checklist.txt
index 4e10dc514..5d3c6886a 100644
--- a/doc/maintainer-patch-review-checklist.txt
+++ b/doc/maintainer-patch-review-checklist.txt
@@ -30,6 +30,7 @@ New test should
 * Have a record in runtest file
 * Test should work fine with more than one iteration
   (e.g. run with `-i 100`)
+* Run with `-i 0` to check that setup and cleanup are coded properly (no test is being run)
 * Have a brief description
 * License: the default license for new tests is GPL v2 or later, use
   GPL-2.0-or-later; the licence for test (e.g. GPL-2.0) should not change
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/3] Check for -i0
  2022-05-20 12:43 [LTP] [PATCH 0/3] Check for -i0 Petr Vorel
                   ` (2 preceding siblings ...)
  2022-05-20 12:43 ` [LTP] [PATCH 3/3] doc/maintainer: Check also -i0 Petr Vorel
@ 2022-05-30 13:34 ` Cyril Hrubis
  2022-06-02 13:59   ` Petr Vorel
  3 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2022-05-30 13:34 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Martin Doucha, ltp

Hi!
Looks good to me:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/3] Check for -i0
  2022-05-30 13:34 ` [LTP] [PATCH 0/3] Check for -i0 Cyril Hrubis
@ 2022-06-02 13:59   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-06-02 13:59 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: Martin Doucha, ltp

Hi Cyril,

> Hi!
> Looks good to me:

Thanks, merged!

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-02 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 12:43 [LTP] [PATCH 0/3] Check for -i0 Petr Vorel
2022-05-20 12:43 ` [LTP] [PATCH 1/3] tst_test.sh: Allow -i0 Petr Vorel
2022-05-20 12:43 ` [LTP] [PATCH 2/3] tst_test: Check for -i >= 0 Petr Vorel
2022-05-20 12:43 ` [LTP] [PATCH 3/3] doc/maintainer: Check also -i0 Petr Vorel
2022-05-30 13:34 ` [LTP] [PATCH 0/3] Check for -i0 Cyril Hrubis
2022-06-02 13:59   ` Petr Vorel

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.