[LTP] [PATCH v3 4/4] shell: Add shell_loader_setup_cleanup.sh test

Li Wang liwang@redhat.com
Thu Jun 12 07:08:12 CEST 2025


On Mon, Jun 9, 2025 at 8:45 PM Petr Vorel <pvorel@suse.cz> wrote:

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>

---
> The same as in v2.
>
>  testcases/lib/run_tests.sh                    |  1 +
>  .../lib/tests/shell_loader_setup_cleanup.sh   | 31 +++++++++++++++++++
>  2 files changed, 32 insertions(+)
>  create mode 100755 testcases/lib/tests/shell_loader_setup_cleanup.sh
>
> diff --git a/testcases/lib/run_tests.sh b/testcases/lib/run_tests.sh
> index 128cee3377..5c309bbeb5 100755
> --- a/testcases/lib/run_tests.sh
> +++ b/testcases/lib/run_tests.sh
> @@ -10,6 +10,7 @@ shell_loader_kconfigs.sh
>  shell_loader_supported_archs.sh
>  shell_loader_tcnt.sh
>  shell_loader_cleanup.sh
> +shell_loader_setup_cleanup.sh
>  shell_test01
>  shell_test02
>  shell_test03
> diff --git a/testcases/lib/tests/shell_loader_setup_cleanup.sh
> b/testcases/lib/tests/shell_loader_setup_cleanup.sh
> new file mode 100755
> index 0000000000..8184278313
> --- /dev/null
> +++ b/testcases/lib/tests/shell_loader_setup_cleanup.sh
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2025 Petr Vorel <pvorel@suse.cz>
> +#
> +# ---
> +# env
> +# {
> +# }
> +# ---
> +
> +TST_SETUP=setup
> +TST_CLEANUP=cleanup
> +
> +. tst_loader.sh
> +
> +setup()
> +{
> +       tst_res TINFO "setup executed"
> +}
> +
> +cleanup()
> +{
> +       tst_res TINFO "Cleanup executed"
> +}
> +
> +tst_test()
> +{
> +       tst_res TPASS "Test is executed"
> +}
> +
> +. tst_run.sh
> --
> 2.49.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang


More information about the ltp mailing list