[LTP] [PATCH v4 11/19] controllers: Expand cgroup_lib shell library

Cyril Hrubis chrubis@suse.cz
Thu May 5 15:53:22 CEST 2022


Hi!
> > +_cgroup_check_return()
> > +{
> > +	local ret="$1"
> > +	local msg="$2"
> > +
> > +	tst_flag2mask TBROK
> > +	[ "$ret" = "$?" ] && tst_brk TBROK "$msg"
> > +
> > +	tst_flag2mask TCONF
> > +	[ "$ret" = "$?" ] && tst_brk TCONF "$msg"
> > +}
> As I wrote in previous patch likely we can avoid tst_flag2mask in new API.
> 
> In few cases where needed we hardwired numbers (IMHO POSIX shell does not
> support constants, which would be better than variables which can be changed).
> 
> In this case you could probably use ROD() or EXPECT_PASS_BRK().

Or we can just passthrough the result, as long as it's non-zero we can
do exit $ret and be done with it.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list