diff mbox series

[v7,4/4] shell_loader_cmd.sh: New test case check needs_cmds

Message ID 20260109061716.20258-5-wegao@suse.com
State Accepted
Headers show
Series new cmd support option for needs_cmds | expand

Checks

Context Check Description
ltpci/alpine_latest_gcc fail failure
ltpci/debian_oldstable_gcc fail failure
ltpci/debian_stable_gcc fail failure
ltpci/debian_testing_gcc fail failure
ltpci/ubuntu_bionic_gcc fail failure
ltpci/fedora_latest_clang fail failure
ltpci/debian_testing_clang fail failure
ltpci/debian_stable_s390x-linux-gnu-gcc_s390x fail failure
ltpci/debian_stable_aarch64-linux-gnu-gcc_arm64 fail failure
ltpci/debian_stable_gcc fail failure
ltpci/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el fail failure
ltpci/ubuntu_jammy_gcc fail failure
ltpci/quay-io-centos-centos_stream9_gcc fail failure
ltpci/debian_oldstable_clang fail failure
ltpci/opensuse-leap_latest_gcc fail failure
ltpci/opensuse-archive_42-2_gcc fail failure

Commit Message

Wei Gao Jan. 9, 2026, 6:16 a.m. UTC
Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Wei Gao <wegao@suse.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/run_tests.sh              |  1 +
 testcases/lib/tests/shell_loader_cmd.sh | 28 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100755 testcases/lib/tests/shell_loader_cmd.sh

Comments

Cyril Hrubis Jan. 21, 2026, 1:09 p.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Petr Vorel Jan. 21, 2026, 1:11 p.m. UTC | #2
Hi Cyril, Wei,

thanks, merged!

Kind regards,
Petr
diff mbox series

Patch

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..4e8e61eb6
--- /dev/null
+++ b/testcases/lib/tests/shell_loader_cmd.sh
@@ -0,0 +1,28 @@ 
+#!/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
+#   },
+#   {
+#    "cmd": "mkfs.ext4 >= 1.0.0",
+#    "optional": 1
+#   }
+#  ]
+# }
+# ---
+
+. tst_loader.sh
+
+tst_test()
+{
+	tst_res TPASS "We are running with needs_cmds"
+}
+
+. tst_run.sh