Skip to contentSkip to conversation

epoll_pwait2: Add test for epoll_pwait2

PATCH New Xie Ziyao 2 participants 15 messages Jun 28, 2021 – Jul 20, 2021

lore
Share & tools
lore

Xie Ziyao

author
#0 lore raw

cover epoll_pwait2: Add test for epoll_pwait2

Xie Ziyao (3):
lapi/syscalls: Add syscall number for epoll_pwait2
epoll_pwait2: Add test for epoll_pwait201
epoll_pwait2: Add test for epoll_pwait202

 include/lapi/syscalls/aarch64.in              |  1 +
 include/lapi/syscalls/arc.in                  |  1 +
 include/lapi/syscalls/arm.in                  |  1 +
 include/lapi/syscalls/hppa.in                 |  3 +-
 include/lapi/syscalls/i386.in                 |  1 +
 include/lapi/syscalls/ia64.in                 |  1 +
 include/lapi/syscalls/powerpc.in              |  1 +
 include/lapi/syscalls/powerpc64.in            |  1 +
 include/lapi/syscalls/s390.in                 |  1 +
 include/lapi/syscalls/s390x.in                |  1 +
 include/lapi/syscalls/sh.in                   |  1 +
 include/lapi/syscalls/sparc.in                |  1 +
 include/lapi/syscalls/sparc64.in              |  1 +
 include/lapi/syscalls/x86_64.in               |  1 +
 runtest/syscalls                              |  2 +
 .../kernel/syscalls/epoll_pwait2/.gitignore   |  2 +
 .../kernel/syscalls/epoll_pwait2/Makefile     |  9 +++
 .../syscalls/epoll_pwait2/epoll_pwait201.c    | 62 +++++++++++++++
 .../syscalls/epoll_pwait2/epoll_pwait202.c    | 76 +++++++++++++++++++
 19 files changed, 166 insertions(+), 1 deletion(-)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/.gitignore
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/Makefile
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait202.c

--
2.17.1

author
#1 lore raw

PATCH 1/3 lapi/syscalls: Add syscall number for epoll_pwait2

Add syscall number for epoll_pwait2.

---
 include/lapi/syscalls/aarch64.in   | 1 +
 include/lapi/syscalls/arc.in       | 1 +
 include/lapi/syscalls/arm.in       | 1 +
 include/lapi/syscalls/hppa.in      | 3 ++-
 include/lapi/syscalls/i386.in      | 1 +
 include/lapi/syscalls/ia64.in      | 1 +
 include/lapi/syscalls/powerpc.in   | 1 +
 include/lapi/syscalls/powerpc64.in | 1 +
 include/lapi/syscalls/s390.in      | 1 +
 include/lapi/syscalls/s390x.in     | 1 +
 include/lapi/syscalls/sh.in        | 1 +
 include/lapi/syscalls/sparc.in     | 1 +
 include/lapi/syscalls/sparc64.in   | 1 +
 include/lapi/syscalls/x86_64.in    | 1 +
 14 files changed, 15 insertions(+), 1 deletion(-)
include/lapi/syscalls/aarch64.in +1 -0
index 2def6ba3d..5a2816099 100644
@@ -313,4 +313,5 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
 _sysctl 1078
include/lapi/syscalls/arc.in +1 -0
index 9bcd84706..9c1654b0b 100644
@@ -313,3 +313,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/arm.in +1 -0
index 98c840cb8..ded2f5e03 100644
@@ -391,3 +391,4 @@ clone3 (__NR_SYSCALL_BASE+435)
 close_range (__NR_SYSCALL_BASE+436)
 openat2 (__NR_SYSCALL_BASE+437)
 pidfd_getfd (__NR_SYSCALL_BASE+438)
+epoll_pwait2 (__NR_SYSCALL_BASE+441)
include/lapi/syscalls/hppa.in +2 -1
index e1628c4b1..d8f142b6a 100644
@@ -39,4 +39,5 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
-close_range 436
\ No newline at end of file
+close_range 436
+epoll_pwait2 441
include/lapi/syscalls/i386.in +1 -0
index aaa02c7bf..f69268e10 100644
@@ -427,3 +427,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/ia64.in +1 -0
index 5467f80f2..3ba2406c4 100644
@@ -340,3 +340,4 @@ pidfd_open 1458
 close_range 1460
 openat2 1461
 pidfd_getfd 1462
+epoll_pwait2 1465
include/lapi/syscalls/powerpc.in +1 -0
index 2d287a606..a4ed2169c 100644
@@ -420,3 +420,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/powerpc64.in +1 -0
index 2d287a606..a4ed2169c 100644
@@ -420,3 +420,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/s390.in +1 -0
index c978b6660..d99e5fd9e 100644
@@ -407,3 +407,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/s390x.in +1 -0
index d123db6cb..f26cdaaae 100644
@@ -355,3 +355,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sh.in +1 -0
index 22da7d6ff..20ee61ccc 100644
@@ -401,3 +401,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sparc.in +1 -0
index 7324b4ac6..86decdd82 100644
@@ -406,3 +406,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sparc64.in +1 -0
index 862d806fa..02dfe473a 100644
@@ -371,3 +371,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/x86_64.in +1 -0
index 1345002f5..cf6d78bf6 100644
@@ -348,6 +348,7 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
 rt_sigaction 512
 rt_sigreturn 513
 ioctl 514

--
2.17.1

author
#2 lore raw

PATCH 2/3 epoll_pwait2: Add test for epoll_pwait201

In reply to Xie Ziyao

Basic test for epoll_pwait2().

---
 runtest/syscalls                              |  1 +
 .../kernel/syscalls/epoll_pwait2/.gitignore   |  1 +
 .../kernel/syscalls/epoll_pwait2/Makefile     |  9 +++
 .../syscalls/epoll_pwait2/epoll_pwait201.c    | 62 +++++++++++++++++++
 4 files changed, 73 insertions(+)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/.gitignore
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/Makefile
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c
runtest/syscalls +1 -0
index d3eb96249..8a6b8ba20 100644
@@ -166,6 +166,7 @@ epoll_wait01 epoll_wait01
 epoll_wait02 epoll_wait02
 epoll_wait03 epoll_wait03
 epoll_pwait01 epoll_pwait01
+epoll_pwait201 epoll_pwait201
 
 eventfd01 eventfd01
 
testcases/kernel/syscalls/epoll_pwait2/.gitignore new file +1 -0
new file mode 100644
index 000000000..2298cf9d9
@@ -0,0 +1 @@
+epoll_pwait201
testcases/kernel/syscalls/epoll_pwait2/Makefile new file +9 -0
new file mode 100644
index 000000000..051db0b20
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2021 HUAWEI LIMITED
+# Author: Xie Ziyao <[email protected]>
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c new file +62 -0

62 lines not on this page · raw message

--
2.17.1

#3 lore raw

PATCH 2/3 epoll_pwait2: Add test for epoll_pwait201

Hi!

testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c line 23

Quoted 3 lines
testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c new file +3 -0
+static void run(void)
+{
+	TEST(tst_syscall(__NR_epoll_pwait2, efd, &e, 1, NULL, NULL, 0));

It would be better to put the prototype for epoll_pwait2 into include/lapi/epoll.h.

Also given that the difference between epoll_pwait() and epoll_pwait2() is only in the timeout parameter type it would make much more sense to write these tests with two test variants so that we would cover both epoll_pwait() and epoll_wait2().

I would have put these tests into epoll_wait/ directory and added epoll_var.h that would make a common wrapper for both of these functions. We do this for example for select in select/select_var.h but in this case this would be much easier, I guess that the wrapper would get timespec structure and convert that to miliseconds for epoll_pwait().

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#4 lore raw

v2 cover epoll_pwait2: Add test for epoll_pwait2

In reply to Xie Ziyao

v1->v2:
1. Add the prototype for epoll_pwait and epoll_pwait2 into include/lapi/epoll.h.
2. Add test variants to switch between epoll_pwait and epoll_pwait2 for epoll_pwait.

Xie Ziyao (5):
lapi/syscalls: Add syscall number for epoll_pwait2
lapi: Add the prototype for epoll_pwait and epoll_pwait2
epoll_pwait: Add test variants for epoll_pwait
epoll_pwait: Add test for epoll_pwait02
epoll_pwait: Add test for epoll_pwait03

 configure.ac                                  |  1 +
 include/lapi/epoll.h                          | 37 +++++++++-
 include/lapi/syscalls/aarch64.in              |  1 +
 include/lapi/syscalls/arc.in                  |  1 +
 include/lapi/syscalls/arm.in                  |  1 +
 include/lapi/syscalls/hppa.in                 |  3 +-
 include/lapi/syscalls/i386.in                 |  1 +
 include/lapi/syscalls/ia64.in                 |  1 +
 include/lapi/syscalls/powerpc.in              |  1 +
 include/lapi/syscalls/powerpc64.in            |  1 +
 include/lapi/syscalls/s390.in                 |  1 +
 include/lapi/syscalls/s390x.in                |  1 +
 include/lapi/syscalls/sh.in                   |  1 +
 include/lapi/syscalls/sparc.in                |  1 +
 include/lapi/syscalls/sparc64.in              |  1 +
 include/lapi/syscalls/x86_64.in               |  1 +
 runtest/syscalls                              |  2 +
 .../kernel/syscalls/epoll_pwait/.gitignore    |  4 +-
 .../syscalls/epoll_pwait/epoll_pwait02.c      | 65 ++++++++++++++++
 .../syscalls/epoll_pwait/epoll_pwait03.c      | 74 +++++++++++++++++++
 .../syscalls/epoll_pwait/epoll_pwait_var.h    | 43 +++++++++++
 21 files changed, 237 insertions(+), 5 deletions(-)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait02.c
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait03.c
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait_var.h

--
2.17.1

author
#5 lore raw

PATCH v2 1/5 lapi/syscalls: Add syscall number for epoll_pwait2

Add syscall number for epoll_pwait2.

---
 include/lapi/syscalls/aarch64.in   | 1 +
 include/lapi/syscalls/arc.in       | 1 +
 include/lapi/syscalls/arm.in       | 1 +
 include/lapi/syscalls/hppa.in      | 3 ++-
 include/lapi/syscalls/i386.in      | 1 +
 include/lapi/syscalls/ia64.in      | 1 +
 include/lapi/syscalls/powerpc.in   | 1 +
 include/lapi/syscalls/powerpc64.in | 1 +
 include/lapi/syscalls/s390.in      | 1 +
 include/lapi/syscalls/s390x.in     | 1 +
 include/lapi/syscalls/sh.in        | 1 +
 include/lapi/syscalls/sparc.in     | 1 +
 include/lapi/syscalls/sparc64.in   | 1 +
 include/lapi/syscalls/x86_64.in    | 1 +
 14 files changed, 15 insertions(+), 1 deletion(-)
include/lapi/syscalls/aarch64.in +1 -0
index 2def6ba3d..5a2816099 100644
@@ -313,4 +313,5 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
 _sysctl 1078
include/lapi/syscalls/arc.in +1 -0
index 9bcd84706..9c1654b0b 100644
@@ -313,3 +313,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/arm.in +1 -0
index 98c840cb8..ded2f5e03 100644
@@ -391,3 +391,4 @@ clone3 (__NR_SYSCALL_BASE+435)
 close_range (__NR_SYSCALL_BASE+436)
 openat2 (__NR_SYSCALL_BASE+437)
 pidfd_getfd (__NR_SYSCALL_BASE+438)
+epoll_pwait2 (__NR_SYSCALL_BASE+441)
include/lapi/syscalls/hppa.in +2 -1
index e1628c4b1..d8f142b6a 100644
@@ -39,4 +39,5 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
-close_range 436
\ No newline at end of file
+close_range 436
+epoll_pwait2 441
include/lapi/syscalls/i386.in +1 -0
index aaa02c7bf..f69268e10 100644
@@ -427,3 +427,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/ia64.in +1 -0
index 5467f80f2..3ba2406c4 100644
@@ -340,3 +340,4 @@ pidfd_open 1458
 close_range 1460
 openat2 1461
 pidfd_getfd 1462
+epoll_pwait2 1465
include/lapi/syscalls/powerpc.in +1 -0
index 2d287a606..a4ed2169c 100644
@@ -420,3 +420,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/powerpc64.in +1 -0
index 2d287a606..a4ed2169c 100644
@@ -420,3 +420,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/s390.in +1 -0
index c978b6660..d99e5fd9e 100644
@@ -407,3 +407,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/s390x.in +1 -0
index d123db6cb..f26cdaaae 100644
@@ -355,3 +355,4 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sh.in +1 -0
index 22da7d6ff..20ee61ccc 100644
@@ -401,3 +401,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sparc.in +1 -0
index 7324b4ac6..86decdd82 100644
@@ -406,3 +406,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/sparc64.in +1 -0
index 862d806fa..02dfe473a 100644
@@ -371,3 +371,4 @@ pidfd_open 434
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
include/lapi/syscalls/x86_64.in +1 -0
index 1345002f5..cf6d78bf6 100644
@@ -348,6 +348,7 @@ clone3 435
 close_range 436
 openat2 437
 pidfd_getfd 438
+epoll_pwait2 441
 rt_sigaction 512
 rt_sigreturn 513
 ioctl 514

--
2.17.1

author
#6 lore raw

PATCH v2 2/5 lapi: Add the prototype for epoll_pwait and epoll_pwait2

In reply to Xie Ziyao

Add the prototype for epoll_pwait and epoll_pwait2 into include/lapi/epoll.h.

---
v1->v2:
1. Add the prototype for epoll_pwait and epoll_pwait2 into include/lapi/epoll.h.

 configure.ac         |  1 +
 include/lapi/epoll.h | 37 ++++++++++++++++++++++++++++++++++---
 2 files changed, 35 insertions(+), 3 deletions(-)
configure.ac +1 -0
index 25c421de0..5bf3c52ec 100644
@@ -86,6 +86,7 @@ AC_CHECK_FUNCS_ONCE([ \
     close_range \
     copy_file_range \
     epoll_pwait \
+    epoll_pwait2 \
     execveat \
     fallocate \
     fchownat \
include/lapi/epoll.h +34 -3
index 899eeb9d4..57f4b9d0f 100644
@@ -1,13 +1,44 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ *
  * Copyright (c) 2016 Cyril Hrubis <[email protected]>
+ * Copyright (c) 2021 Xie Ziyao <[email protected]>
  */
 
 #ifndef LAPI_EPOLL_H__
 #define LAPI_EPOLL_H__
 
+#include "lapi/syscalls.h"
+#include "tst_timer_test.h"
+
 #ifndef EPOLL_CLOEXEC
-# define EPOLL_CLOEXEC 02000000
+#define EPOLL_CLOEXEC 02000000
+#endif
+
+#ifndef HAVE_EPOLL_PWAIT
+int epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
+		int timeout, const sigset_t *sigmask)
+{
+	return tst_syscall(__NR_epoll_pwait, epfd, events, maxevents,
+			   timeout, sigmask, _NSIG / 8);
+}
+#endif
+
+#ifndef HAVE_EPOLL_PWAIT2
+int epoll_pwait2(int epfd, struct epoll_event *events, int maxevents,
+		 const struct timespec *timeout, const sigset_t *sigmask)
+{
+	if (timeout == NULL)
+		return tst_syscall(__NR_epoll_pwait2, epfd, events, maxevents,
+				   NULL, sigmask, _NSIG / 8);
+
+	struct __kernel_timespec ts;
+
+	ts.tv_sec = timeout->tv_sec;
+	ts.tv_nsec = timeout->tv_nsec;
+
+	return tst_syscall(__NR_epoll_pwait2, epfd, events, maxevents,
+			   &ts, sigmask, _NSIG / 8);
+}
 #endif
 
 #endif /* LAPI_EPOLL_H__ */

--
2.17.1

author
#7 lore raw

PATCH v2 3/5 epoll_pwait: Add test variants for epoll_pwait

In reply to Xie Ziyao

Add test variants to switch between different syscall variants/wrappers at runtime.

---
v1->v2:
1. Add test variants to switch between epoll_pwait and epoll_pwait2.

 .../syscalls/epoll_pwait/epoll_pwait_var.h    | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait_var.h
testcases/kernel/syscalls/epoll_pwait/epoll_pwait_var.h new file +43 -0
new file mode 100644
index 000000000..2bdea17e9
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
+ * Author: Xie Ziyao <[email protected]>
+ */
+
+#ifndef LTP_EPOLL_PWAIT_VAR_H
+#define LTP_EPOLL_PWAIT_VAR_H
+
+#include "lapi/epoll.h"
+
+#define TEST_VARIANTS 2
+#define MSEC_PER_SEC (1000L)
+#define NSEC_PER_MSEC (1000000L)
+
+static int do_epoll_pwait(int epfd, struct epoll_event *events, int
+	maxevents, int timeout, const sigset_t *sigmask)
+{
+	if (tst_variant == 0)
+		return epoll_pwait(epfd, events, maxevents, timeout, sigmask);
+
+	struct timespec ts;
+
+	if (timeout < 0) {
+		return epoll_pwait2(epfd, events, maxevents, NULL, sigmask);
+	} else {
+		ts.tv_sec = timeout / MSEC_PER_SEC;
+		ts.tv_nsec = NSEC_PER_MSEC * (timeout % MSEC_PER_SEC);
+	}
+
+	return epoll_pwait2(epfd, events, maxevents, &ts, sigmask);
+
+}
+
+static void epoll_pwait_info(void)
+{
+	if (tst_variant == 0)
+		tst_res(TINFO, "Test epoll_pwait()");
+	else
+		tst_res(TINFO, "Test epoll_pwait2()");
+}
+
+#endif //LTP_EPOLL_PWAIT_VAR_H

--
2.17.1

author
#8 lore raw

PATCH v2 4/5 epoll_pwait: Add test for epoll_pwait02

In reply to Xie Ziyao

Basic test for epoll_pwait/epoll_pwait2.

---
1. Add test variants to switch between epoll_pwait and epoll_pwait2.

 runtest/syscalls                              |  1 +
 .../kernel/syscalls/epoll_pwait/.gitignore    |  3 +-
 .../syscalls/epoll_pwait/epoll_pwait02.c      | 65 +++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait02.c
runtest/syscalls +1 -0
index 26786c96a..bed224809 100644
@@ -166,6 +166,7 @@ epoll_wait01 epoll_wait01
 epoll_wait02 epoll_wait02
 epoll_wait03 epoll_wait03
 epoll_pwait01 epoll_pwait01
+epoll_pwait02 epoll_pwait02
 
 eventfd01 eventfd01
 
testcases/kernel/syscalls/epoll_pwait/.gitignore +2 -1
index d53943a75..ab049f173 100644
@@ -1 +1,2 @@
-/epoll_pwait01
+epoll_pwait01
+epoll_pwait02
testcases/kernel/syscalls/epoll_pwait/epoll_pwait02.c new file +65 -0

65 lines not on this page · raw message

--
2.17.1

author
#9 lore raw

PATCH v2 5/5 epoll_pwait: Add test for epoll_pwait03

In reply to Xie Ziyao

Check that epoll_pwait/epoll_pwait2 timeout correctly.

---
v1->v2:
1. Add test variants to switch between epoll_pwait and epoll_pwait2.

 runtest/syscalls                              |  1 +
 .../kernel/syscalls/epoll_pwait/.gitignore    |  1 +
 .../syscalls/epoll_pwait/epoll_pwait03.c      | 74 +++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait/epoll_pwait03.c
runtest/syscalls +1 -0
index bed224809..1deb6118f 100644
@@ -167,6 +167,7 @@ epoll_wait02 epoll_wait02
 epoll_wait03 epoll_wait03
 epoll_pwait01 epoll_pwait01
 epoll_pwait02 epoll_pwait02
+epoll_pwait03 epoll_pwait03
 
 eventfd01 eventfd01
 
testcases/kernel/syscalls/epoll_pwait/.gitignore +1 -0
index ab049f173..1d16367e6 100644
@@ -1,2 +1,3 @@
 epoll_pwait01
 epoll_pwait02
+epoll_pwait03
testcases/kernel/syscalls/epoll_pwait/epoll_pwait03.c new file +74 -0

74 lines not on this page · raw message

--
2.17.1

#10 lore raw

v2 cover epoll_pwait2: Add test for epoll_pwait2

In reply to Xie Ziyao

Hi!
Pushed with minor changes, thanks.

* Changed the include in lapi/epoll.h to tst_timer.h

* Added better description to epoll_wait02

Also it would be nice to convert the epoll_pwait01.c to the variants as well...

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#11 lore raw

v2 cover epoll_pwait2: Add test for epoll_pwait2

Hi, Cyril,

Quoted 6 lines

Pushed with minor changes, thanks.

* Changed the include in lapi/epoll.h to tst_timer.h

* Added better description to epoll_wait02

Looks good. Thanks for your modifications.

Quoted 4 lines

Also it would be nice to convert the epoll_pwait01.c to the variants as well...

OK, I'll fix it.

Thanks for your review.

Kind Regards,
Ziyao

author
#12 lore raw

PATCH 3/3 epoll_pwait2: Add test for epoll_pwait202

In reply to Xie Ziyao

Check that epoll_pwait2 timeouts correctly.

---
 runtest/syscalls                              |  1 +
 .../kernel/syscalls/epoll_pwait2/.gitignore   |  1 +
 .../syscalls/epoll_pwait2/epoll_pwait202.c    | 76 +++++++++++++++++++
 3 files changed, 78 insertions(+)
 create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait202.c
runtest/syscalls +1 -0
index 8a6b8ba20..f63e57fee 100644
@@ -167,6 +167,7 @@ epoll_wait02 epoll_wait02
 epoll_wait03 epoll_wait03
 epoll_pwait01 epoll_pwait01
 epoll_pwait201 epoll_pwait201
+epoll_pwait202 epoll_pwait202
 
 eventfd01 eventfd01
 
testcases/kernel/syscalls/epoll_pwait2/.gitignore +1 -0
index 2298cf9d9..8b2c314ea 100644
@@ -1 +1,2 @@
 epoll_pwait201
+epoll_pwait202
testcases/kernel/syscalls/epoll_pwait2/epoll_pwait202.c new file +76 -0

76 lines not on this page · raw message

--
2.17.1

#13 lore raw

PATCH 3/3 epoll_pwait2: Add test for epoll_pwait202

Hi!
I guess that this can go in as most of the complexity is in the test library and we create similar wrapper for the epoll_pwait() test.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#14 lore raw

cover epoll_pwait2: Add test for epoll_pwait2

In reply to Xie Ziyao

Hi,

Quoted 4 lines

Xie Ziyao (3):
lapi/syscalls: Add syscall number for epoll_pwait2
epoll_pwait2: Add test for epoll_pwait201
epoll_pwait2: Add test for epoll_pwait202

Sorry for testing only under several archs (like arm, x86) on QEMU due to environmental limitations.

If possible, I would recommend testing it on other platforms as well.

Kind Regards,
Ziyao

Quoted 31 lines
  include/lapi/syscalls/aarch64.in              |  1 +
  include/lapi/syscalls/arc.in                  |  1 +
  include/lapi/syscalls/arm.in                  |  1 +
  include/lapi/syscalls/hppa.in                 |  3 +-
  include/lapi/syscalls/i386.in                 |  1 +
  include/lapi/syscalls/ia64.in                 |  1 +
  include/lapi/syscalls/powerpc.in              |  1 +
  include/lapi/syscalls/powerpc64.in            |  1 +
  include/lapi/syscalls/s390.in                 |  1 +
  include/lapi/syscalls/s390x.in                |  1 +
  include/lapi/syscalls/sh.in                   |  1 +
  include/lapi/syscalls/sparc.in                |  1 +
  include/lapi/syscalls/sparc64.in              |  1 +
  include/lapi/syscalls/x86_64.in               |  1 +
  runtest/syscalls                              |  2 +
  .../kernel/syscalls/epoll_pwait2/.gitignore   |  2 +
  .../kernel/syscalls/epoll_pwait2/Makefile     |  9 +++
  .../syscalls/epoll_pwait2/epoll_pwait201.c    | 62 +++++++++++++++
  .../syscalls/epoll_pwait2/epoll_pwait202.c    | 76 +++++++++++++++++++
  19 files changed, 166 insertions(+), 1 deletion(-)

create mode 100644 testcases/kernel/syscalls/epoll_pwait2/.gitignore create mode 100644 testcases/kernel/syscalls/epoll_pwait2/Makefile create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait201.c create mode 100644 testcases/kernel/syscalls/epoll_pwait2/epoll_pwait202.c

--
2.17.1

.