From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [RFC][PATCH 2/3] tst_test: Allow test to suggest reboot via $TST_REBOOT
Date: Wed, 16 Jul 2025 08:54:44 +0200 [thread overview]
Message-ID: <20250716065444.GA14792@pevik> (raw)
In-Reply-To: <20250226143113.3016480-2-pvorel@suse.cz>
Hi Cyril, all,
> Frameworks/tooling which run LTP can schedule reboot based on
> environment variable.
Cyril, you wanted to add this via struct tst_test (e.g. not using a new variable
in shell). That's indeed better (used by both C API and shell loader + having it
in metadata doc). But for a better integration with external frameworks (e.g.
kirk or openQA) it will still be needed to export some environment variable
(e.g. LTP_REBOOT) to notify the framework for a reboot.
And for IMA tests to be able to use it they will need to be converted to shell
loader (which requires to finish setup/cleanup support for shell loader [1]).
ima_setup.sh use quirk to use a loop device if TMPDIR is on tmpfs (some
IMA measurements are not supported on tmpfs). Because shell loader's struct
tst_test in JSON is not modifiable I will have to use always a loop device
(slower) and force some filesystem (previously tests were run on the filesystem
installed on TMPDIR, e.g. test on the filesystem chosen by distro/user).
Setting this whole patchset in patchwork as rejected.
Kind regards,
Petr
[1] https://patchwork.ozlabs.org/project/ltp/list/?series=460106&state=*
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> If useful, I should probably add it to C API as well
> (at least swapoff01.c and swapon01.c print also "reboot recommended").
> doc/users/setup_tests.rst | 3 +++
> testcases/lib/tst_test.sh | 7 ++++++-
> 2 files changed, 9 insertions(+), 1 deletion(-)
> diff --git a/doc/users/setup_tests.rst b/doc/users/setup_tests.rst
> index ddcf00f027..0cdb86715f 100644
> --- a/doc/users/setup_tests.rst
> +++ b/doc/users/setup_tests.rst
> @@ -85,6 +85,9 @@ users.
> * - LTP_ENABLE_DEBUG
> - Enable debug info (value ``1`` or ``y``). Equivalent of ``-D`` parameter.
> + * - TST_REBOOT
> + - Environment variable set by LTP test to signalize that SUT should be rebooted.
> +
> Environment variables for network tests
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> See :master:`testcases/network/README.md`.
> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index 2b797705e3..a450976f36 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -16,6 +16,7 @@ export TST_COUNT=1
> export TST_ITERATIONS=1
> export TST_TMPDIR_RHOST=0
> export TST_LIB_LOADED=1
> +export TST_REBOOT=
> . tst_ansi_color.sh
> . tst_security.sh
> @@ -84,6 +85,10 @@ _tst_do_exit()
> [ -z "$TST_SKIP_LSM_WARNINGS" ] && _tst_check_security_modules
> fi
> + if [ "$TST_REBOOT" = 1 ]; then
> + tst_res TINFO "WARNING: reboot recommended due test changes"
> + fi
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-16 6:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 14:31 [LTP] [PATCH 1/3] setup_tests: Sort variables alphabetically Petr Vorel
2025-02-26 14:31 ` [LTP] [RFC][PATCH 2/3] tst_test: Allow test to suggest reboot via $TST_REBOOT Petr Vorel
2025-02-26 14:33 ` Petr Vorel
2025-07-16 6:54 ` Petr Vorel [this message]
2025-02-26 14:31 ` [LTP] [PATCH 3/3] ima_setup.sh: Use $TST_REBOOT Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250716065444.GA14792@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox