From 538e87ca92766ae3c08cdd565fb74aace045ec7a Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 26 Jun 2013 01:27:08 +0400 Subject: [PATCH] zdtm: add a new test case, which create processes in a loop 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 Signed-off-by: Pavel Emelyanov --- test/zdtm/live/transition/Makefile | 2 ++ test/zdtm/live/transition/fork.c | 6 +++++- test/zdtm/live/transition/fork2.c | 1 + 3 files changed, 8 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 d8e39d65b..66524e393 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 33bfec0c6..9914a2eee 100644 --- a/test/zdtm/live/transition/fork.c +++ b/test/zdtm/live/transition/fork.c @@ -29,8 +29,12 @@ int main(int argc, char **argv) goto out; } - if (pid == 0) + if (pid == 0) { +#ifdef FORK2 + usleep(10000); +#endif exit(0); + } while ((wpid = wait(&status)) == -1 && errno == EINTR); diff --git a/test/zdtm/live/transition/fork2.c b/test/zdtm/live/transition/fork2.c new file mode 120000 index 000000000..c2e58c00f --- /dev/null +++ b/test/zdtm/live/transition/fork2.c @@ -0,0 +1 @@ +fork.c \ No newline at end of file