[LTP] [PATCH 1/6] tst_run.sh: Fix passing arguments

Petr Vorel
2026-03-13T14:26:58Z

tst_run_script() in C API correctly sets environment, but it have to be
also passed to the shell functions.

Before:

$ ./shell_loader_tcnt.sh
...
shell_loader_tcnt.sh:-1: TPASS: Iteration
shell_loader_tcnt.sh:-1: TPASS: Iteration

After:
shell_loader_tcnt.sh:-1: TPASS: Iteration 0
shell_loader_tcnt.sh:-1: TPASS: Iteration 1

Fixes: 8202494493 ("shell lib: Add basic support for test setup")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: not only for TST_CNT like variable, but also for other future
getopts support (needed by tst_net.sh tests).

testcases/lib/tst_run.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/lib/tst_run.sh b/testcases/lib/tst_run.sh
index 841b5fd141..e876fd8946 100644
--- a/testcases/lib/tst_run.sh
+++ b/testcases/lib/tst_run.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2025 Cyril Hrubis <chrubis@suse.cz>
-# Copyright (c) 2025 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2025-2026 Petr Vorel <pvorel@suse.cz>

. tst_env.sh

@@ -21,4 +21,4 @@ if [ -n "$TST_SETUP" ]; then
fi
fi

-tst_test
+tst_test "$@"
--
2.51.0