[LTP] [PATCH v5 3/3] shell_loader_cmd.sh: New test case check needs_cmds

Wei Gao wegao@suse.com
Tue Nov 11 11:41:03 CET 2025


Sorry, It seems some strange CI failure triggered by "cmd": "mkfs.ext4 >=
1.0.0", i need further check and will update it.

On Mon, Nov 10, 2025 at 10:48 AM Wei Gao <wegao@suse.com> wrote:

> 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 | 28 +++++++++++++++++++++++++
>  2 files changed, 29 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..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
> --
> 2.51.0
>
>


More information about the ltp mailing list