[LTP] [PATCH v3] ioctl_loop01.c: Use proper device for partitioning
Petr Vorel
pvorel@suse.cz
Wed Sep 24 09:03:53 CEST 2025
Hi all,
> On Thu, Sep 18, 2025 at 05:35:15PM +0200, Cyril Hrubis wrote:
> > Hi!
> > > > > The test should have needs_cmds set to parted (we do that properly in
> > > > > ioctl09.c) then we do not have to handle the 255 exit code here since
> > > > > the test would be skipped if it's missing.
> > > > If we use needs_cmds all the check will be skipped in this case.
> > > @Cyril: only single test require 'parted' as I reported in v1 [1].
> > > Yeah, code gets slightly more complicated just because single test requires
> > > parted. Or you would not care? IMHO it does not make sense to split test into
> > > two (too much duplicity).
> > The problem here is how to handle the metadata. One posible solution is
> > to add a notion of optional dependencies so that we would have
> > 'needs_foo' and 'wants_foo'. Or turn the needs_foo into a structure with
> > an .optional boolean flag.
> What's difference between needs_foo and wants_foo? wants_foo means we do
> not do brk if not exist foo?
> I guess we need wants_parted support for .needs_cmds like following
> change? Could you give me more guidance
> --- a/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> @@ -147,6 +147,10 @@ static struct tst_test test = {
> "loop",
> NULL
> },
> + .needs_cmds= (const char *const []) {
> + "wants_parted",
IMHO this is a wrong way. The command name ("value") should not need to be
parsed. Why?
1) not obvious
2) theoretically there can be a binary "wants_*")
Cyril's approach to change "key" (i.e. .needs_cmd => .wants_cmd) is better.
Alternatives to wants_* could be "needs_foo_subtest" or "uses_foo"
Kind regards,
Petr
> + NULL
> + },
More information about the ltp
mailing list