[CRIU] [PATCH 3/3] zdtm/stopped: check more cases

Andrey Vagin avagin at openvz.org
Wed Nov 25 08:50:11 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm/live/static/Makefile    |  6 ++++++
 test/zdtm/live/static/stopped.c   | 12 ++++++++++++
 test/zdtm/live/static/stopped01.c |  1 +
 test/zdtm/live/static/stopped02.c |  1 +
 test/zdtm/live/static/stopped12.c |  1 +
 5 files changed, 21 insertions(+)
 create mode 120000 test/zdtm/live/static/stopped01.c
 create mode 120000 test/zdtm/live/static/stopped02.c
 create mode 120000 test/zdtm/live/static/stopped12.c

diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index 66920ca..453c16b 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -123,6 +123,9 @@ TST_NOFILE	=				\
 		grow_map03			\
 		tun				\
 		stopped				\
+		stopped01			\
+		stopped02			\
+		stopped03			\
 		rtc				\
 		clean_mntns			\
 		mntns_rw_ro_rw			\
@@ -357,6 +360,9 @@ mlock_setuid:		get_smaps_bits.o
 inotify01:		override CFLAGS += -DINOTIFY01
 unlink_fstat01+:	override CFLAGS += -DUNLINK_OVER
 sk-freebind-false:	override CFLAGS += -DZDTM_FREEBIND_FALSE
+stopped01:	override CFLAGS += -DZDTM_STOPPED_KILL
+stopped02:	override CFLAGS += -DZDTM_STOPPED_TKILL
+stopped12:	override CFLAGS += -DZDTM_STOPPED_KILL -DZDTM_STOPPED_TKILL
 
 $(LIB):	force
 	$(Q) $(MAKE) -C $(LIBDIR)
diff --git a/test/zdtm/live/static/stopped.c b/test/zdtm/live/static/stopped.c
index 6417088..af57807 100644
--- a/test/zdtm/live/static/stopped.c
+++ b/test/zdtm/live/static/stopped.c
@@ -1,6 +1,8 @@
 #include <errno.h>
 #include <unistd.h>
 #include <signal.h>
+#include <unistd.h>
+#include <syscall.h>
 #include <sys/wait.h>
 
 #include "zdtmtst.h"
@@ -38,6 +40,16 @@ int main(int argc, char **argv)
 	close(p[0]);
 
 	kill(pid, SIGSTOP);
+	if (waitid(P_PID, pid, NULL, WNOWAIT | WSTOPPED) < 0) {
+		pr_perror("waitid");
+		return 1;
+	}
+#ifdef ZDTM_STOPPED_TKILL
+	syscall(__NR_tkill, pid, SIGSTOP);
+#endif
+#ifdef ZDTM_STOPPED_KILL
+	kill(pid, SIGSTOP);
+#endif
 
 	write(p[1], "0", 1);
 	close(p[1]);
diff --git a/test/zdtm/live/static/stopped01.c b/test/zdtm/live/static/stopped01.c
new file mode 120000
index 0000000..8779030
--- /dev/null
+++ b/test/zdtm/live/static/stopped01.c
@@ -0,0 +1 @@
+stopped.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/stopped02.c b/test/zdtm/live/static/stopped02.c
new file mode 120000
index 0000000..8779030
--- /dev/null
+++ b/test/zdtm/live/static/stopped02.c
@@ -0,0 +1 @@
+stopped.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/stopped12.c b/test/zdtm/live/static/stopped12.c
new file mode 120000
index 0000000..8779030
--- /dev/null
+++ b/test/zdtm/live/static/stopped12.c
@@ -0,0 +1 @@
+stopped.c
\ No newline at end of file
-- 
2.4.3



More information about the CRIU mailing list