[LTP] [PATCH 0/2] shell lib: Add very simple cleanup support
Cyril Hrubis
chrubis@suse.cz
Fri Feb 14 12:21:33 CET 2025
This implements a simple shell library cleanup support by utilizing the
shell trap buildin. With that the cleanup is executed when the shell
script is about to exit.
Alternative we do not have to add the TST_CLEANUP variable at all and
use the trap directly in the shell tests instead. In that case we can
drop the change from tst_env.sh and change the two tests to use trap
directly instead.
Cyril Hrubis (2):
testcases/lib/run_tests.sh
shell lib: Add support for test cleanup
testcases/lib/run_tests.sh | 5 ++++-
.../lib/tests/shell_loader_brk_cleanup.sh | 20 ++++++++++++++++++
testcases/lib/tests/shell_loader_cleanup.sh | 21 +++++++++++++++++++
testcases/lib/tst_env.sh | 4 ++++
4 files changed, 49 insertions(+), 1 deletion(-)
create mode 100755 testcases/lib/tests/shell_loader_brk_cleanup.sh
create mode 100755 testcases/lib/tests/shell_loader_cleanup.sh
--
2.45.3
More information about the ltp
mailing list