[LTP] [PATCH v4 11/19] controllers: Expand cgroup_lib shell library
Luke Nowakowski-Krijger
luke.nowakowskikrijger@canonical.com
Fri May 13 22:15:48 CEST 2022
Hi Petr and Cyril,
On Tue, May 10, 2022 at 4:19 AM Petr Vorel <pvorel@suse.cz> wrote:
> Hi Luke, Cyril,
>
> > 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.
> +1 (that would suggest to use ROD)
>
> Please, rebase the code for new version. You'll have to for cgroup_lib.sh
> put
> '. tst_test.sh' to the end and also '. cgroup_lib.sh' in the tests also at
> the
> end - required by 04021637f ("tst_test.sh: Cleanup getopts usage").
>
>
Thank you for the reviews! I agree with the changes mentioned and will
submit an update to these patches.
Kind regards,
> Petr
>
Thanks,
- Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220513/54cf3809/attachment.htm>
More information about the ltp
mailing list