From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/3] Add ioctl_ficlone03 test
Date: Thu, 30 May 2024 12:52:34 +0200 [thread overview]
Message-ID: <ZlhacuOD8hYVLYS6@yuki> (raw)
In-Reply-To: <20240530-ioctl_ficlone-v1-3-fa96f07d0fca@suse.com>
Hi!
> inotify_init1_01 inotify_init1_01
> inotify_init1_02 inotify_init1_02
> diff --git a/testcases/kernel/syscalls/ioctl/.gitignore b/testcases/kernel/syscalls/ioctl/.gitignore
> index 3d25fdfb2..d0b470714 100644
> --- a/testcases/kernel/syscalls/ioctl/.gitignore
> +++ b/testcases/kernel/syscalls/ioctl/.gitignore
> @@ -24,3 +24,4 @@
> /ioctl_sg01
> /ioctl_ficlone01
> /ioctl_ficlone02
> +/ioctl_ficlone03
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> new file mode 100644
> index 000000000..c6f9806a3
> --- /dev/null
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> @@ -0,0 +1,96 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2024 Andrea Cervesato andrea.cervesato@suse.com
> + */
> +
> +/*\
> + * [Description]
> + *
> + * This test verifies that ioctl() FICLONE feature correctly raises exceptions
> + * when it's supposed to.
> + */
> +
> +#include "tst_test.h"
> +#include "lapi/fs.h"
> +
> +#define MNTPOINT "mnt"
> +
> +static int invalid_fd = -1;
> +static int rw_file = -1;
> +static int ro_file = -1;
> +static int wo_file = -1;
> +static int dir_fd = -1;
> +static int immut_fd = -1;
> +static int mnt_file = -1;
> +
> +static struct tcase {
> + int *src_fd;
> + int *dst_fd;
> + int errno_exp;
> + char *msg;
> +} tcases[] = {
> + {&invalid_fd, &rw_file, EBADF, "invalid source"},
> + {&rw_file, &invalid_fd, EBADF, "invalid destination"},
Can we move these invalid_fd tests into a separate test and use tst_fd
to loop over all kinds of invalid input and output file descriptors?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-05-30 10:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 7:15 [LTP] [PATCH 0/3] Add ioctl_ficlone testing suite Andrea Cervesato
2024-05-30 7:15 ` [LTP] [PATCH 1/3] Add ioctl_ficlone01 test Andrea Cervesato
2024-05-30 10:48 ` Cyril Hrubis
2024-05-31 7:15 ` Andrea Cervesato via ltp
2024-05-31 8:01 ` Cyril Hrubis
2024-05-31 8:27 ` Andrea Cervesato via ltp
2024-05-30 7:15 ` [LTP] [PATCH 2/3] Add ioctl_ficlone02 test Andrea Cervesato
2024-05-30 10:49 ` Cyril Hrubis
2024-05-31 11:00 ` Andrea Cervesato via ltp
2024-05-30 7:15 ` [LTP] [PATCH 3/3] Add ioctl_ficlone03 test Andrea Cervesato
2024-05-30 10:52 ` Cyril Hrubis [this message]
2024-05-31 7:53 ` Andrea Cervesato via ltp
2024-05-31 8:03 ` Cyril Hrubis
2024-07-11 13:41 ` Andrea Cervesato via ltp
2024-07-12 7:36 ` Andrea Cervesato via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZlhacuOD8hYVLYS6@yuki \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.