[LTP] [PATCH v3] ioctl_loop01.c: Use proper device for partitioning
Cyril Hrubis
chrubis@suse.cz
Tue Sep 9 13:50:30 CEST 2025
Hi!
> .../kernel/syscalls/ioctl/ioctl_loop01.c | 34 ++++++++-----------
> 1 file changed, 15 insertions(+), 19 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop01.c b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> index c9137bf1e..b70e9fc22 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> @@ -78,7 +78,21 @@ static void check_loop_value(int set_flag, int get_flag, int autoclear_field)
>
> static void verify_ioctl_loop(void)
> {
> + int ret;
> + const char *const cmd_parted[] = {"parted", "-s", dev_path, "mklabel", "msdos", "mkpart",
> + "primary", "ext4", "1M", "10M", NULL};
> +
> + tst_fill_file("test.img", 0, 1024 * 1024, 10);
> tst_attach_device(dev_path, "test.img");
> +
> + ret = tst_cmd(cmd_parted, NULL, NULL, TST_CMD_PASS_RETVAL);
> + if (!ret)
> + parted_sup = 1;
> + else if (ret == 255)
> + tst_res(TCONF, "parted binary not installed or failed");
> + else
> + tst_res(TCONF, "parted exited with %i", ret);
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.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list