[LTP] [PATCH] Allow graceful subtest cleanup in shell tests

Petr Vorel pvorel@suse.cz
Fri Nov 11 15:02:32 CET 2022


Hi Martin,

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks!

> The new shell test timeout code sends SIGTERM to any subprocesses when
> the main script hits timeout. SIGTERM isn't handled by the LTP library
> which means that tools like netstress will be instantly killed without
> performing any cleanup. Handle SIGTERM like SIGINT in LTP library
> to allow graceful cleanup.

Besides this, Cyril some time ago suggested to define TST_NO_DEFAULT_MAIN in
nfs05_make_tree.c [1], which is also helper like netstress.c.

Looking what this would be required for netstress.c: implement function it's own
tst_brk(), which would call cleanup() function before calling library's
tst_brk(), parsing getopt parameters, calling setup() in main() etc.
The only thing which works is tst_res() and tst_brk() printing.
I'm not sure if this is worth just to avoid problematic timeout.

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/YqxFo1iFzHatNRIl@yuki/


More information about the ltp mailing list