All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xie Ziyao <xieziyao@huawei.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/4] epoll_wait: Convert epoll_wait03 to the new API
Date: Mon, 9 Aug 2021 16:53:15 +0800	[thread overview]
Message-ID: <3241a2d2-af9b-8eca-51d6-cf134d29aa78@huawei.com> (raw)
In-Reply-To: <20210809083903.161596-4-xieziyao@huawei.com>

Hi, Cyril,

> +/*\
> + * [Description]
> + *
> + * Basic test for epoll_wait:
>    *
> - * Expected Result:
> - *  1) epoll_wait(2) should return -1 and set errno to EBADF
> - *  2) epoll_wait(2) should return -1 and set errno to EINVAL
> - *  3) epoll_wait(2) should return -1 and set errno to EINVAL
> - *  4) epoll_wait(2) should return -1 and set errno to EINVAL
> - *  5) epoll_wait(2) should return -1 and set errno to EFAULT
> + * 1. epoll_wait fails with EBADF if epfd is not a valid file descriptor.
> + * 2. epoll_wait fails with EINVAL if epfd is not an epoll file descriptor.
> + * 3. epoll_wait fails with EINVAL if maxevents is less than zero.
> + * 4. epoll_wait fails with EINVAL if maxevents is equal to zero.
> + * 5. epoll_wait fails with EFAULT if the memory area pointed to by events is
> + * not accessible with write permissions.
>    */

As I mentioned in #792, testcases/kernel/syscalls/epoll_wait has some 
test points that can also cover the epoll_pwait/epoll_pwait2 system call 
since their underlying implementations are similar.

Therefore, I suggest that we add tests for different parameters in 
syscalls/epoll_pwait, and implement basic tests in syscalls/epoll_wait.

The case where timeout set to 0 causes the call to return immediately is 
added to epoll_wait04, and new tests for epoll_pwait/epoll_pwait2 will 
be added in syscalls/epoll_pwait.

...
> +
> +static struct tst_test test = {
> +	.setup = setup,
> +	.cleanup = cleanup,
> +	.test = verify_epoll_wait,
> +	.tcnt = ARRAY_SIZE(tc),
> +};
> --
> 2.17.1
> 
> .
> 

Thank you for the suggestion.

Kind Regards,
Ziyao

  reply	other threads:[~2021-08-09  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09  8:38 [LTP] [PATCH 0/4] epoll_wait: Add test for epoll_wait04 and cleanup Xie Ziyao
2021-08-09  8:39 ` [LTP] [PATCH 1/4] epoll_wait: Add docparse formatting and cleanup for epoll_wait01 Xie Ziyao
2021-08-09  8:39 ` [LTP] [PATCH 2/4] epoll_wait: Add docparse formatting and fix warnings from checkpatch.pl Xie Ziyao
2021-08-09  8:39 ` [LTP] [PATCH 3/4] epoll_wait: Convert epoll_wait03 to the new API Xie Ziyao
2021-08-09  8:53   ` Xie Ziyao [this message]
2021-08-11 13:30   ` Cyril Hrubis
2021-08-09  8:39 ` [LTP] [PATCH 4/4] epoll_wait: Add test for epoll_wait04 Xie Ziyao

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=3241a2d2-af9b-8eca-51d6-cf134d29aa78@huawei.com \
    --to=xieziyao@huawei.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.