From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/copy_file_range02: Add test description
Date: Tue, 6 Aug 2019 18:27:00 +0800 [thread overview]
Message-ID: <5D4955F4.40204@cn.fujitsu.com> (raw)
In-Reply-To: <20190806091040.26448-2-pvorel@suse.cz>
Hi
> to increase readability as all_filesystems flag prolonged output a lot.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> .../copy_file_range/copy_file_range02.c | 33 ++++++++++---------
> 1 file changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> index 472dffdc6..56797f639 100644
> --- a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> +++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> @@ -13,14 +13,14 @@
> * 2) Try to copy contents to directory -> EISDIR
> * 3) Try to copy contents to a file opened with the
> * O_APPEND flag -> EBADF
> - * 4) Try to copy contents to closed filedescriptor
> + * 4) Try to copy contents to closed file descriptor
> * -> EBADF
> * 5) Try to copy contents with invalid 'flags' value
> * -> EINVAL
> * 6) Try to copy contents to a file chattred with +i
> * flag -> EPERM
> * 7) Try to copy contents to a swapfile ->ETXTBSY
> - * 8) Try to copy contents to the samefile with overlapping
> + * 8) Try to copy contents to the same file with overlapping
> * ->EINVAL
> * 9) Try to copy contents to a blkdev ->EINVAL
> * 10) Try to copy contents to a chardev ->EINVAL
> @@ -60,20 +60,21 @@ static struct tcase {
> int exp_err;
> loff_t dst;
> loff_t len;
> + const char *tname;
> } tcases[] = {
> - {&fd_rdonly, 0, EBADF, 0, CONTSIZE},
> - {&fd_dir, 0, EISDIR, 0, CONTSIZE},
> - {&fd_append, 0, EBADF, 0, CONTSIZE},
> - {&fd_closed, 0, EBADF, 0, CONTSIZE},
> - {&fd_dest, -1, EINVAL, 0, CONTSIZE},
> - {&fd_immutable, 0, EPERM, 0, CONTSIZE},
> - {&fd_swapfile, 0, ETXTBSY, 0, CONTSIZE},
> - {&fd_dup, 0, EINVAL, 0, CONTSIZE/2},
> - {&fd_blkdev, 0, EINVAL, 0, CONTSIZE},
> - {&fd_chrdev, 0, EINVAL, 0, CONTSIZE},
> - {&fd_fifo, 0, EINVAL, 0, CONTSIZE},
> - {&fd_copy, 0, EOVERFLOW, MAX_OFF, ULLONG_MAX},
> - {&fd_copy, 0, EFBIG, MAX_OFF, MIN_OFF},
> + {&fd_rdonly, 0, EBADF, 0, CONTSIZE, "readonly file"},
> + {&fd_dir, 0, EISDIR, 0, CONTSIZE, "directory"},
> + {&fd_append, 0, EBADF, 0, CONTSIZE, "append to file"},
> + {&fd_closed, 0, EBADF, 0, CONTSIZE, "closed file descriptor"},
> + {&fd_dest, -1, EINVAL, 0, CONTSIZE, "invalid flags"},
> + {&fd_immutable, 0, EPERM, 0, CONTSIZE, "immutable file"},
> + {&fd_swapfile, 0, ETXTBSY, 0, CONTSIZE, "swap file"},
> + {&fd_dup, 0, EINVAL, 0, CONTSIZE/2, "overlaping"},
overlaping range
> + {&fd_blkdev, 0, EINVAL, 0, CONTSIZE, "block device"},
> + {&fd_chrdev, 0, EINVAL, 0, CONTSIZE, "charr device"},
char device
> + {&fd_fifo, 0, EINVAL, 0, CONTSIZE, "fifo"},
> + {&fd_copy, 0, EOVERFLOW, MAX_OFF, ULLONG_MAX, "max length lenght"},
> + {&fd_copy, 0, EFBIG, MAX_OFF, MIN_OFF, "max file size"},
> };
>
> static int run_command(char *command, char *option, char *file)
> @@ -97,6 +98,8 @@ static int run_command(char *command, char *option, char *file)
> static void verify_copy_file_range(unsigned int n)
> {
> struct tcase *tc = &tcases[n];
> + tst_res(TINFO, "Test #%d: %s", n, tc->tname);
> +
> if (tc->copy_to_fd == &fd_immutable && chattr_i_nsup) {
> tst_res(TCONF, "filesystem doesn't support chattr +i, skip it");
> return;
Other than typos, this patchset looks good to me.
next prev parent reply other threads:[~2019-08-06 10:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 9:10 [LTP] [PATCH 1/2] syscalls/copy_file_range02: Improve error message Petr Vorel
2019-08-06 9:10 ` [LTP] [PATCH 2/2] syscalls/copy_file_range02: Add test description Petr Vorel
2019-08-06 10:27 ` Yang Xu [this message]
2019-08-06 12:23 ` Petr Vorel
2019-08-06 11:17 ` Murphy Zhou
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=5D4955F4.40204@cn.fujitsu.com \
--to=xuyang2018.jy@cn.fujitsu.com \
--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.