[LTP] [PATCH 3/6] shell_loader: Start test count from 1

Petr Vorel
2026-03-13T14:27:52Z

tcnt in C library starts from 0. But TST_CNT in tst_test.sh started
from 1. Keep it compatible with the shell code with increasing variable
by one.

Fixes: 5528da0231 ("testcaes/lib: Add shell loader")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
We can go C way (start from 0), but tests will have to be adapted.

testcases/lib/tst_run_shell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c
index c12361ef5f..ab6f4fda58 100644
--- a/testcases/lib/tst_run_shell.c
+++ b/testcases/lib/tst_run_shell.c
@@ -21,7 +21,7 @@ static void run_shell_tcnt(unsigned int n)
char buf[128];
char *const params[] = {buf, NULL};

- snprintf(buf, sizeof(buf), "%u", n);
+ snprintf(buf, sizeof(buf), "%u", n+1);

tst_run_script(shell_filename, params);
}
--
2.51.0