[LTP] [PATCH 2/2] Use SAFE_RUNCMD()

Cyril Hrubis chrubis@suse.cz
Wed Mar 25 18:07:40 CET 2020


Hi!
> > > > Also if we are going to add this functionality it should be added as an
> > > > .needs_cmds array in the tst_test structure.
> > > .needs_cmds sounds as a good idea. But let's do it as a separate effort.
> >
> +1, thanks Petr!
> 
> 
> > > I'll leave already sent v2 for review. Once .needs_cmds is implemented,
> > we can
> > > use it as well for copy_file_range02.c.
> >
> > Actually I would like to avoid exposing the function to the tests and
> > force people to use the .needs_cmds instead in order to have a proper
> > metadata.
> >
> 
> Sounds good.
> 
> And this makes me think more of the '.request_hugepages' story. The
> needs_foo flags require the foo to be present on the system as hard
> requirements. In some situations(i.e copy_file_range02.c), we probably need
> to handle the soft situation, which means, the commands are only part of
> the test requirement. So if it writing with .needs_cmds="xxx", it might
> skip the whole test in setup() phase.

Indeed, there are couple of solutions for that, one of them would have
all the arrays doubled and one of them would list hard requirement while
the other soft requirements. Then we will end up with something as
"need_cmds" and "wants_cmds". The second one would be more or less
informative, the test may print a message "Missing foo command test
coverage will be limited".

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list