<div dir="ltr"><div>Hi Petr and Cyril, <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 13, 2022 at 1:15 PM Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com">luke.nowakowskikrijger@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Petr and Cyril, <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 10, 2022 at 4:19 AM Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Luke, Cyril,<br>
<br>
> Hi!<br>
> > > +_cgroup_check_return()<br>
> > > +{<br>
> > > + local ret="$1"<br>
> > > + local msg="$2"<br>
> > > +<br>
> > > + tst_flag2mask TBROK<br>
> > > + [ "$ret" = "$?" ] && tst_brk TBROK "$msg"<br>
> > > +<br>
> > > + tst_flag2mask TCONF<br>
> > > + [ "$ret" = "$?" ] && tst_brk TCONF "$msg"<br>
> > > +}<br>
> > As I wrote in previous patch likely we can avoid tst_flag2mask in new API.<br>
<br></blockquote></div></div></blockquote><div><br></div><div>I submitted a new version of the changes, however I found that ROD does not seem to play nice with sending output to a variable (e.g. var=$(command)). <br></div><div><br></div><div>Also reflecting on it, I think it would be better to propagate the TCONF that comes from tst_cgroup.c so that the errors make a little more sense instead of getting a TBROK when the error previous was TCONF. This also makes sense as test frameworks (at canonical) usually parse TBROK as fails and TCONF as skips in our testing framework, so having a TCONF would just propagate the status in tst_cgctl and make things make a little more sense. <br></div><div><br></div><div>The only issue, like you said, is in hardcoding the 32 return value. If you guys think its safe I think thats the best way to go. <br></div><div><br></div><div>Let me know. I submitted the patches to the ML. Sorry for the long hiatus BTW :) Ive been lagging on getting these patches out forever. <br></div><div> <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> > In few cases where needed we hardwired numbers (IMHO POSIX shell does not<br>
> > support constants, which would be better than variables which can be changed).<br>
<br>
> > In this case you could probably use ROD() or EXPECT_PASS_BRK().<br>
<br>
> Or we can just passthrough the result, as long as it's non-zero we can<br>
> do exit $ret and be done with it.<br>
+1 (that would suggest to use ROD)<br>
<br>
Please, rebase the code for new version. You'll have to for cgroup_lib.sh put<br>
'. tst_test.sh' to the end and also '. cgroup_lib.sh' in the tests also at the<br>
end - required by 04021637f ("tst_test.sh: Cleanup getopts usage").<br>
<br></blockquote><div><br></div><div>Thank you for the reviews! I agree with the changes mentioned and will submit an update to these patches. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Kind regards,<br>
Petr<br></blockquote><div><br></div><div>Thanks, <br></div><div>- Luke <br></div></div></div></blockquote><div><br></div><div>Best</div><div><br></div><div>- Luke <br></div></div></div>