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 <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-06-26 01:27:08 +04:00 committed by Pavel Emelyanov
parent ce988e44fb
commit 538e87ca92
3 changed files with 8 additions and 1 deletions

View file

@ -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 $< $@

View file

@ -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);

View file

@ -0,0 +1 @@
fork.c