[LTP] [PATCH v7 2/4] tst_test.c: Add tst_cmd_present check if a command is present

Petr Vorel pvorel@suse.cz
Mon Jan 12 12:08:02 CET 2026


> ...
> > +++ b/lib/tst_test.c
> > @@ -1375,6 +1375,24 @@ static const char *default_fs_type(void)
> >  	return tst_dev_fs_type();
> >  }

> > +bool tst_cmd_present(const char *cmd)
> > +{
> > +	struct tst_cmd *pcmd = tst_test->needs_cmds;
> > +
> > +	if (!cmd || cmd[0] == '\0')

> > +		tst_brk(TBROK, "Invalid cmd");
> I'd still prefer tst_brk_() as I described at v6, but that can be done as a
> separate change. I keep my RBT :).

I see Cyril was OK with keeping tst_brk() in v6, I'm sorry to overlook it.
https://lore.kernel.org/ltp/aV4ujjfb7JBB2zaQ@yuki.lan/

> Kind regards,
> Petr



More information about the ltp mailing list