[LTP] [PATCH v3] ioctl_loop01.c: Use proper device for partitioning

Cyril Hrubis chrubis@suse.cz
Wed Sep 24 12:54:44 CEST 2025


Hi!
> If we select option 2 then we have following setting for all related
> test cases.
> +       .needs_cmds = (const struct tst_cmd[]) {
> +               {"parted", "0"},
> +               {}
> +       },
> 
> But how to get "parted" command support status? In ioctl_loop01.c there
> is a local var "parted_sup" which flag parted command support or not, and
> use this flag to decide which sub test needed. 
> If we do this logic in test lib then we need create another
> flag in tst_cmd used for give status of command support or not.
> During test lib logic will set tst_cmd.support flag.
> 
>  struct tst_cmd {
>  	const char *cmd;
>  	unsigned int required:1;
>  	unsigned int support:1;
>  };
> 
> Correct me if any misunderstanding, many thanks.

Sounds reasonable and we could also add a nice function to the test
library:

bool tst_cmd_present(const char *cmd);

that would loop over the tst_cmd array and return the supported flag
value.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list