[LTP] [PATCH 1/2] tst_test.sh: Print environment variables in help

Petr Vorel pvorel@suse.cz
Wed Jan 26 15:51:40 CET 2022


to sync with C API.

Unlike C API environment variables are printed at the top,
because we expect custom $TST_USAGE function prints part of the usage
itself (but not all tests do).

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

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 30614974c3..a7fd7b19c6 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -448,12 +448,30 @@ tst_usage()
 	if [ -n "$TST_USAGE" ]; then
 		$TST_USAGE
 	else
-		echo "usage: $0"
-		echo "OPTIONS"
+		cat << EOF
+usage: $0
+
+Options
+-------
+EOF
 	fi
 
 	echo "-h      Prints this help"
 	echo "-i n    Execute test n times"
+
+		cat << EOF
+
+Environment Variables
+---------------------
+KCONFIG_PATH         Specify kernel config file
+KCONFIG_SKIP_CHECK   Skip kernel config check if variable set (not set by default)
+LTPROOT              Prefix for installed LTP (default: /opt/ltp)
+LTP_COLORIZE_OUTPUT  Force colorized output behaviour (y/1 always, n/0: never)
+LTP_DEV              Path to the block device to be used (for .needs_device)
+LTP_DEV_FS_TYPE      Filesystem used for testing (default: ext2)
+LTP_TIMEOUT_MUL      Timeout multiplier (must be a number >=1, ceiled to int)
+TMPDIR               Base directory for template directory (for .needs_tmpdir, default: /tmp)
+EOF
 }
 
 _tst_resstr()
-- 
2.34.1



More information about the ltp mailing list