[LTP] [PATCH v3 1/2] net: Add tst_net_run helper

Petr Vorel pvorel@suse.cz
Tue Nov 13 16:26:51 CET 2018

Hi Alexey,

> > > > +	[ -n "$safe" ] && ROD $cmd || sh -c "$cmd"
> > >                                       ^
> > >                                   just $cmd?
> > Yes, sh -c does not work for shell functions unless are exported
> > (tst_test_drivers() in next commit is a shell function).
> > I somehow overlooked it.

> > But sh -c is used for all test links in tst_rhost_run(),
> > I guess we don't want to do export -f FUNCNAME for all functions in tst_net.sh,
> > do we?
> OK, export -f FUNCNAME is a bashism, we cannot use it.
> I'll check whether we can replace sh -c with brackets.
> If not, tst_rhost_run() won't be able to use functions (just binaries).
OK, execvp() used in testcases/kernel/containers/share/ns_exec.c (used for netns) requires binary.
I guess I have to live with the fact that tst_rhost_run() is not able to call
shell functions.

Kind regards,

More information about the ltp mailing list