[CRIU] [PATCH 1/2] zdtm: add a new test case, which create processes in a loop
Andrey Vagin
avagin at openvz.org
Mon Jun 24 08:59:25 EDT 2013
and this processes live a short period of time. This test case is needed
for testing snapshots.
https://bugzilla.openvz.org/show_bug.cgi?id=2636
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
test/zdtm/live/transition/Makefile | 2 ++
test/zdtm/live/transition/fork.c | 4 +++-
test/zdtm/live/transition/fork2.c | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
create mode 120000 test/zdtm/live/transition/fork2.c
diff --git a/test/zdtm/live/transition/Makefile b/test/zdtm/live/transition/Makefile
index d8e39d6..66524e3 100644
--- a/test/zdtm/live/transition/Makefile
+++ b/test/zdtm/live/transition/Makefile
@@ -10,6 +10,7 @@ TST_NOFILE = \
ptrace \
epoll \
fork \
+ fork2 \
TST_FILE = \
file_read \
@@ -59,6 +60,7 @@ $(TST): $(LIB)
ptrace.o: override CFLAGS += -pthread
ptrace: override LDFLAGS += -pthread
ipc: override CFLAGS += -DNEW_IPC_NS
+fork2: override CFLAGS += -D FORK2
%: %.sh
cp $< $@
diff --git a/test/zdtm/live/transition/fork.c b/test/zdtm/live/transition/fork.c
index 6506b70..9914a2e 100644
--- a/test/zdtm/live/transition/fork.c
+++ b/test/zdtm/live/transition/fork.c
@@ -30,7 +30,9 @@ int main(int argc, char **argv)
}
if (pid == 0) {
- sleep(1);
+#ifdef FORK2
+ usleep(10000);
+#endif
exit(0);
}
diff --git a/test/zdtm/live/transition/fork2.c b/test/zdtm/live/transition/fork2.c
new file mode 120000
index 0000000..c2e58c0
--- /dev/null
+++ b/test/zdtm/live/transition/fork2.c
@@ -0,0 +1 @@
+fork.c
\ No newline at end of file
--
1.8.2.1
More information about the CRIU
mailing list