[LTP] [PATCH v4 4/4] shell_loader_cmd.sh: New test case check needs_cmds

Wei Gao wegao@suse.com
Fri Nov 7 01:30:27 CET 2025


Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/lib/run_tests.sh              |  1 +
 testcases/lib/tests/shell_loader_cmd.sh | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100755 testcases/lib/tests/shell_loader_cmd.sh

diff --git a/testcases/lib/run_tests.sh b/testcases/lib/run_tests.sh
index 5c309bbeb..24ac81a44 100755
--- a/testcases/lib/run_tests.sh
+++ b/testcases/lib/run_tests.sh
@@ -6,6 +6,7 @@ shell_loader.sh
 shell_loader_all_filesystems.sh
 shell_loader_c_child.sh
 shell_loader_filesystems.sh
+shell_loader_cmd.sh
 shell_loader_kconfigs.sh
 shell_loader_supported_archs.sh
 shell_loader_tcnt.sh
diff --git a/testcases/lib/tests/shell_loader_cmd.sh b/testcases/lib/tests/shell_loader_cmd.sh
new file mode 100755
index 000000000..a05562089
--- /dev/null
+++ b/testcases/lib/tests/shell_loader_cmd.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2025 Wei Gao <wegao@suse.cz>
+#
+# ---
+# env
+# {
+#  "needs_cmds": [
+#   {
+#    "cmd": "ls",
+#    "optional": 1
+#   }
+#  ]
+# }
+# ---
+
+. tst_loader.sh
+
+tst_test()
+{
+	tst_res TPASS "We are running with needs_cmds"
+}
+
+. tst_run.sh
-- 
2.51.0



More information about the ltp mailing list