[LTP] [PATCH v2 2/2] tst_test.sh: Convert only TBROK/TCONF to TWARN in cleanup

Petr Vorel pvorel@suse.cz
Mon Jan 5 15:24:16 CET 2026


Hi Andrea,

...
> > +	if [ "$TST_TBROK_TO_TWARN" = 1 ]; then
> > +		if [ "$res" != TBROK -a "$res" != TCONF ]; then
> > +			tst_res TWARN "tst_brk can be called only with TBROK or TCONF ($res, msg: '$@')"
> > +		else
> > +			tst_res TWARN "$@"
> > +		fi
> >  		return
> > +	fi
> > +
> > +	if [ "$res" != TBROK -a "$res" != TCONF ]; then
> > +		tst_res TBROK "tst_brk can be called only with TBROK or TCONF ($res, msg: '$@')"
> >  	else
> >  		tst_res "$res" "$@"
> >  	fi

> Here there's a bit of code duplication. For instance, we can save the
> message inside a variable, as well as the T-flag, the use it accordingly
> to TST_TBROK_TO_TWARN.

Sure, this could be done, but as for other tst_test.sh modifications: unless
it's an important fix I'd not touch it as we now have a shell loader. Again,
I'm sorry to waste your time for the review.

Kind regards,
Petr


More information about the ltp mailing list