[LTP] [PATCH 1/1] tst_test.sh: Fix TBROK => TWARN evaluation

Cyril Hrubis chrubis@suse.cz
Wed Jan 15 12:08:55 CET 2025


Hi!
> commit 55bfa08e179de16773f19b703de70262896383ea
> Author: Petr Vorel <pvorel@suse.cz>
> Date:   Thu Dec 14 15:00:10 2023 +0100
> 
>     tst_test.sh/tst_brk(): Convert only TBROK to TWARN in cleanup
> 
> 
> The original code only only depended on TST_DO_EXIT being set. I guess
> that the easiest fix here would be actually to revert that patch. That
> is because we mostly call the cleanup from _tst_do_exit() which sets the
> TST_DO_EXIT before it calls _tst_do_cleanup(). The only place where we
> call _tst_do_cleanup() wihout the TST_DO_EXIT is inside of the
> _tst_run_iterations(), if we wanted to convert TBROK to TWARN in that
> case we can simply do:
> 
> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index cfdae0230..ac1caebcb 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -820,6 +820,7 @@ _tst_run_iterations()
>                 _tst_i=$((_tst_i-1))
>         done
> 
> +       TST_DO_EXIT=1
>         _tst_do_cleanup

And of course add:
	unset TST_DO_EXIT
after the cleanup.

>         if [ "$TST_MOUNT_FLAG" = 1 ]; then
> 
> 
> And possibly change the TST_DO_EXIT to TST_TBROK_TO_TWARN as well.
> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list