[LTP] [PATCH v4 0/6] shell lib: Add support for test cleanup
Petr Vorel
pvorel@suse.cz
Tue Jul 22 14:59:10 CEST 2025
Hi,
v3:
https://lore.kernel.org/ltp/20250609124506.1454420-1-pvorel@suse.cz/
https://patchwork.ozlabs.org/project/ltp/list/?series=460106&state=*
Changes v3->v4:
* Add checks for $TST_SETUP and $TST_CLEANUP (Li)
NOTE: I decided to use TWARN for $TST_CLEANUP as usually test could run
without it.
* New commit: "tst_res_: Add support for TWARN"
@Cyril: you may not like it, but I would prefer TWARN either be
supported or removed in whole LTP. Not supporting it in shell loader
will lead sooner or later to errors:
Wrong type 'TWARN'
Usage: tst_{res,brk} filename lineno [TPASS|TBROK|TFAIL|TCONF|TINFO|TDEBUG] 'A short description'
* New commit: "tst_res_: Print error to stderr, with filename and
lineno"
Printing to stderr, tst_res_ filename and lineno helps debugging wrong
code. Best would be if it prints either code which invoked it or the
original message, but at least this is an improvement.
Cyril Hrubis (1):
shell lib: Add support for test cleanup
Petr Vorel (5):
shell: Move shell code into functions
tst_res_: Add support for TWARN
tst_res_: Print error to stderr, with filename and lineno
shell lib: Add basic support for test setup
shell: Add shell_loader_setup_cleanup.sh test
testcases/kernel/mem/vma/vma05.sh | 45 ++++++++++---------
testcases/lib/run_tests.sh | 5 ++-
testcases/lib/tests/shell_loader.sh | 19 +++++---
.../lib/tests/shell_loader_all_filesystems.sh | 26 ++++++-----
.../lib/tests/shell_loader_brk_cleanup.sh | 25 +++++++++++
testcases/lib/tests/shell_loader_c_child.sh | 15 ++++---
testcases/lib/tests/shell_loader_cleanup.sh | 25 +++++++++++
.../lib/tests/shell_loader_filesystems.sh | 23 ++++++----
.../lib/tests/shell_loader_invalid_block.sh | 7 ++-
.../tests/shell_loader_invalid_metadata.sh | 7 ++-
testcases/lib/tests/shell_loader_kconfigs.sh | 7 ++-
.../lib/tests/shell_loader_no_metadata.sh | 7 ++-
.../lib/tests/shell_loader_setup_cleanup.sh | 31 +++++++++++++
.../lib/tests/shell_loader_supported_archs.sh | 7 ++-
testcases/lib/tests/shell_loader_tags.sh | 7 ++-
testcases/lib/tests/shell_loader_tcnt.sh | 7 ++-
.../lib/tests/shell_loader_wrong_metadata.sh | 7 ++-
testcases/lib/tst_env.sh | 5 ---
testcases/lib/tst_res_.c | 8 ++--
testcases/lib/tst_run.sh | 24 ++++++++++
20 files changed, 239 insertions(+), 68 deletions(-)
create mode 100755 testcases/lib/tests/shell_loader_brk_cleanup.sh
create mode 100755 testcases/lib/tests/shell_loader_cleanup.sh
create mode 100755 testcases/lib/tests/shell_loader_setup_cleanup.sh
create mode 100644 testcases/lib/tst_run.sh
--
2.50.1
More information about the ltp
mailing list