<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 28, 2020 at 11:43 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 Xiao,<br>
<br>
> On 3/28/20 5:39 AM, Petr Vorel wrote:<br>
> > + There is a double check (first in<br>
> > .needs_cmds, then in SAFE_RUN_CMD()), maybe that's not needed.<br>
<br>
> Hi Petr,<br>
<br>
> Why do you need the duplicate .needs_cmds flag?(it introduces the double<br>
> check as you said)<br>
<br>
> Usually, all tests run commands by tst_run_cmd()/SAFE_RUN_CMD() and they can<br>
> report TCONF<br>
<br>
> by passing TST_RUN_CMD_CHECK_CMD so it is fair to be a part of<br>
> tst_run_cmd()/SAFE_RUN_CMD().<br>
<br>
Thanks for your review.<br>
I guess Cyril will prefer .needs_cmds, as it can be parsed - metadata project:<br>
<a href="https://people.kernel.org/metan/towards-parallel-kernel-test-runs" rel="noreferrer" target="_blank">https://people.kernel.org/metan/towards-parallel-kernel-test-runs</a><br>
<a href="https://github.com/metan-ucw/ltp/tree/master/docparse" rel="noreferrer" target="_blank">https://github.com/metan-ucw/ltp/tree/master/docparse</a><br>
<br>
I put it there because some command might be run just under some condition (not<br>
always), thus not suitable for .needs_cmds, but still nice to have reliable<br>
check. But maybe I'm wrong.<br></blockquote><div><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">+1 you're right, I believe that is safer and choosable for the test.</span></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>