epoll_ctl/epoll_ctl01.c: add new testcase
PATCH 1/2 epoll_ctl/epoll_ctl01.c: add new testcase
Testcase to check the basic functionality of the epoll_ctl(2).
1) when epoll_ctl(2) succeeds to register fd on the epoll instance and associates event with fd, epoll_wait(2) will get registered fd and event correctly.
2) when epoll_ctl(2) succeeds to chage event which is related to fd, epoll_wait(2) will get chaged event correctly.
3) when epoll_ctl(2) succeeds to deregister fd from the epoll instance epoll_wait(2) won't get deregistered fd and event.
--- runtest/ltplite | 2 + runtest/stress.part3 | 2 + runtest/syscalls | 1 + testcases/kernel/syscalls/.gitignore | 1 + testcases/kernel/syscalls/epoll_ctl/Makefile | 24 ++++ testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c | 152 ++++++++++++++++++++++ 6 files changed, 182 insertions(+) create mode 100644 testcases/kernel/syscalls/epoll_ctl/Makefile create mode 100644 testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c
runtest/ltplite +2 -0
@@ -159,6 +159,8 @@ dup203 dup203 dup204 dup204 dup205 dup205 +epoll_ctl01 epoll_ctl01 + epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02 epoll_wait03 epoll_wait03
runtest/stress.part3 +2 -0
@@ -100,6 +100,8 @@ dup203 dup203 dup204 dup204 dup205 dup205 +epoll_ctl01 epoll_ctl01 + epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02 epoll_wait03 epoll_wait03
runtest/syscalls +1 -0
@@ -122,6 +122,7 @@ dup3_02 dup3_02 epoll_create1_01 epoll_create1_01 epoll01 epoll-ltp +epoll_ctl01 epoll_ctl01 epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02 epoll_wait03 epoll_wait03
testcases/kernel/syscalls/.gitignore +1 -0
@@ -97,6 +97,7 @@ /dup3/dup3_02 /epoll/epoll-ltp /epoll_create1/epoll_create1_01 +/epoll_ctl/epoll_ctl01 /epoll_wait/epoll_wait01 /epoll_wait/epoll_wait02 /epoll_wait/epoll_wait03
testcases/kernel/syscalls/epoll_ctl/Makefile new file +24 -0
@@ -0,0 +1,24 @@ +# +# Copyright (c) 2016 Fujitsu Ltd. +# Author: Xiao Yang <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. +# +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c new file +152 -0
152 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 2/2 epoll_ctl/epoll_ctl02.c: add new testcase
1) epoll_ctl(2) fails if epfd is a invalid file descriptor and set errno to EBADF.
2) epoll_ctl(2) fails if fd is a invalid file descriptor and set errno to EBADF.
3) epoll_ctl(2) fails if op is not supported by this interface and set errno to EINVAL.
4) epoll_ctl(2) fails if fd is the same as epfd and set errno to EINVAL.
5) epoll_ctl(2) fails with EPOLL_CTL_DEL if fd is not registered with this epoll instance and set errno to ENOENT.
6) epoll_ctl(2) fails with EPOLL_CTL_MOD if fd is not registered with this epoll instance and set errno to ENOENT.
7) epoll_ctl(2) fails with EPOLL_CTL_ADD if fd is already registered with this epoll instance and set errno to EEXIST.
--- runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 1 + testcases/kernel/syscalls/.gitignore | 1 + testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c | 120 ++++++++++++++++++++++ 5 files changed, 124 insertions(+) create mode 100644 testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c
runtest/ltplite +1 -0
@@ -160,6 +160,7 @@ dup204 dup204 dup205 dup205 epoll_ctl01 epoll_ctl01 +epoll_ctl02 epoll_ctl02 epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02
runtest/stress.part3 +1 -0
@@ -101,6 +101,7 @@ dup204 dup204 dup205 dup205 epoll_ctl01 epoll_ctl01 +epoll_ctl02 epoll_ctl02 epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02
runtest/syscalls +1 -0
@@ -123,6 +123,7 @@ dup3_02 dup3_02 epoll_create1_01 epoll_create1_01 epoll01 epoll-ltp epoll_ctl01 epoll_ctl01 +epoll_ctl02 epoll_ctl02 epoll_wait01 epoll_wait01 epoll_wait02 epoll_wait02 epoll_wait03 epoll_wait03
testcases/kernel/syscalls/.gitignore +1 -0
@@ -98,6 +98,7 @@ /epoll/epoll-ltp /epoll_create1/epoll_create1_01 /epoll_ctl/epoll_ctl01 +/epoll_ctl/epoll_ctl02 /epoll_wait/epoll_wait01 /epoll_wait/epoll_wait02 /epoll_wait/epoll_wait03
testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c new file +120 -0
120 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 2/2 epoll_ctl/epoll_ctl02.c: add new testcase
Hi!
Both pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]