[LTP] [PATCH 1/1] tst_test.sh: Fix TBROK => TWARN evaluation
Petr Vorel
pvorel@suse.cz
Wed Jan 15 13:41:15 CET 2025
Hi Cyril,
> Hi!
> This I suppose got broken in:
> commit 55bfa08e179de16773f19b703de70262896383ea
> Author: Petr Vorel <pvorel@suse.cz>
> Date: Thu Dec 14 15:00:10 2023 +0100
FYI it was broken by 5c36ae3e30 ("tst_test.sh: Call cleanup function only after
test start") (much earlier than 55bfa08e17).
> 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
OK, you would revert 55bfa08e179de16773f19b703de70262896383ea + use variable as
guard here (TST_TBROK_TO_TWARN or whatever name it uses).
I'll try to test it. BTW I remember in the past there were problems when setup
got tst_brk TCONF, which calls the cleanup.
Kind regards,
Petr
> if [ "$TST_MOUNT_FLAG" = 1 ]; then
> And possibly change the TST_DO_EXIT to TST_TBROK_TO_TWARN as well.
More information about the ltp
mailing list