Re: [PATCH net-next 2/4] selftests: drv-net: add a way to wait for a local process

Stanislav Fomichev
2025-02-18T21:29:21Z

On 02/18, Jakub Kicinski wrote:
> On Tue, 18 Feb 2025 13:10:14 -0800 Stanislav Fomichev wrote:
> > > + env_str = getenv("KSFT_READY_FD");
> > > + if (!env_str)
> > > + return;
> > > +
> > > + fd = atoi(env_str);
> > > + if (!fd)
> > > + return;
> >
> > optional nit: should these fail with error() instead of silent return?
> > Should guarantee that the caller is doing everything correctly.
> > (passing wait_init vs waiting for a port)
>
> My thinking was that you may want to run the helper manually during
> development and then the env variable won't be set.
>
> Given that we currently don't expose the stdout/stderr if wait fails
> adding a print seemed a little performative.. We need to go back
> and provide better support for debug (/verbose output) at some stage.

Good point. In this case, we can fail only on the first case (!env_str);
should still catch the wrong invocation and let you do KSFT_READY_FD= ./helper
manual run. But agreed, that not worth the respin..