[LTP] [PATCH 2/3] lib: Use LTP_ prefix for LTP_NO_CLEANUP variable

Petr Vorel pvorel@suse.cz
Thu Jan 4 13:23:07 CET 2024


Variables which are supposed to be user defined should use LTP_ prefix
instead of TST_ prefix.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/User-Guidelines.asciidoc | 3 ++-
 testcases/lib/test.sh        | 2 +-
 testcases/lib/tst_test.sh    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/User-Guidelines.asciidoc b/doc/User-Guidelines.asciidoc
index cff2e83c8..63081fdea 100644
--- a/doc/User-Guidelines.asciidoc
+++ b/doc/User-Guidelines.asciidoc
@@ -40,7 +40,8 @@ For running LTP network tests see `testcases/network/README.md`.
 | 'TMPDIR'              | Base directory for template directory (C: '.needs_tmpdir = 1'
                           and others, which imply it, shell: 'TST_NEEDS_TMPDIR=1').
                           Must be an absolute path (default: '/tmp').
-| 'TST_NO_CLEANUP'      | Disable running test cleanup (defined in 'TST_CLEANUP').
+| 'LTP_NO_CLEANUP'      | Disable running test cleanup (defined in 'TST_CLEANUP').
+                          Shell API only.
 | 'LTP_ENABLE_DEBUG'    | Enable debug info (value '1' or 'y').
 |==============================================================================
 
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index 8947f47c1..d26cf5df0 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -108,7 +108,7 @@ tst_require_root()
 
 tst_exit()
 {
-	if [ -n "${TST_CLEANUP:-}" -a -z "${TST_NO_CLEANUP:-}" ]; then
+	if [ -n "${TST_CLEANUP:-}" -a -z "${LTP_NO_CLEANUP:-}" ]; then
 		$TST_CLEANUP
 	fi
 
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 5f178a1be..98bc13b2c 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -26,7 +26,7 @@ trap "unset _tst_setup_timer_pid; tst_brk TBROK 'test terminated'" TERM
 
 _tst_do_cleanup()
 {
-	if [ -n "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" -a -z "$TST_NO_CLEANUP" ]; then
+	if [ -n "$TST_DO_CLEANUP" -a -n "$TST_CLEANUP" -a -z "$LTP_NO_CLEANUP" ]; then
 		if command -v $TST_CLEANUP >/dev/null 2>/dev/null; then
 			TST_DO_CLEANUP=
 			$TST_CLEANUP
-- 
2.43.0



More information about the ltp mailing list