Message ID | 20220709165000.27830-1-akumar@suse.de |
---|---|
State | Accepted |
Headers | show |
Series | open08.c: Docparse format and rewording of description | expand |
Hi Avinesh, > + * Verify that open() fails with: Here needs to be blank line otherwise the result would be wrongly formatted: Verify that open() fails with: - EEXIST when pathname already exists and O_CREAT and O_EXCL were used - EISDIR when pathname refers to a directory and the access requested involved writing - ENOTDIR when O_DIRECTORY was specified and pathname was not a directory - ENAMETOOLONG when pathname was too long - EACCES when requested access to the file is not allowed - EFAULT when pathname points outside the accessible address space Please next time verify the result (cd metadata && make && $BROWSER ../docparse/*.html Merged with this fix, removed docs and space behind #define. Kind regards, Petr > + * - EEXIST when pathname already exists and O_CREAT and O_EXCL were used. > + * - EISDIR when pathname refers to a directory and the access requested > + * involved writing. > + * - ENOTDIR when O_DIRECTORY was specified and pathname was not a directory. > + * - ENAMETOOLONG when pathname was too long. > + * - EACCES when requested access to the file is not allowed. > + * - EFAULT when pathname points outside the accessible address space. > */ > #define _GNU_SOURCE /* for O_DIRECTORY */
diff --git a/testcases/kernel/syscalls/open/open08.c b/testcases/kernel/syscalls/open/open08.c index 10f55fb90..5e1cf82f9 100644 --- a/testcases/kernel/syscalls/open/open08.c +++ b/testcases/kernel/syscalls/open/open08.c @@ -4,35 +4,17 @@ * Copyright (c) 2018 Linux Test Project */ -/* - * DESCRIPTION - * Check for the following errors: - * 1. EEXIST - * 2. EISDIR - * 3. ENOTDIR - * 4. ENAMETOOLONG - * 5. EACCES - * 6. EFAULT - * - * ALGORITHM - * 1. Open a file with O_CREAT and O_EXCL, when the file already - * exists. Check the errno for EEXIST - * - * 2. Pass a directory as the pathname and request a write access, - * check for errno for EISDIR - * - * 3. Specify O_DIRECTORY as a parameter to open and pass a file as the - * pathname, check errno for ENOTDIR - * - * 4. Attempt to open() a filename which is more than VFS_MAXNAMLEN, and - * check for errno to be ENAMETOOLONG. - * - * 5. Attempt to open a (0600) file owned by different user in WRONLY mode, - * open(2) should fail with EACCES. +/*\ + * [Description] * - * 6. Attempt to pass an invalid pathname with an address pointing outside - * the accessible address space of the process, as the argument to open(), - * and expect to get EFAULT. + * Verify that open() fails with: + * - EEXIST when pathname already exists and O_CREAT and O_EXCL were used. + * - EISDIR when pathname refers to a directory and the access requested + * involved writing. + * - ENOTDIR when O_DIRECTORY was specified and pathname was not a directory. + * - ENAMETOOLONG when pathname was too long. + * - EACCES when requested access to the file is not allowed. + * - EFAULT when pathname points outside the accessible address space. */ #define _GNU_SOURCE /* for O_DIRECTORY */
Signed-off-by: Avinesh Kumar <akumar@suse.de> --- testcases/kernel/syscalls/open/open08.c | 38 +++++++------------------ 1 file changed, 10 insertions(+), 28 deletions(-)