From a08f2030a1607d11a063109ef00d163bc3bbfb43 Mon Sep 17 00:00:00 2001 From: Kinsbursky Stanislav Date: Thu, 1 Nov 2012 14:45:51 +0400 Subject: [PATCH] test: add processes tree restoring test This test makes sure, that processes tree is restored before opened files. This is guaranteed by holding child's "/proc//stat" file opened by parent. It was inspired by OpenVZ bug: #2404 IOW, OpenVZ can't restore container with such test inside. v2: 1) Test renamed + carefull cleanup + minor updates. Signed-off-by: Stanislav Kinsbursky Acked-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- test/zdtm.sh | 1 + test/zdtm/live/static/Makefile | 1 + test/zdtm/live/static/child_opened_proc.c | 63 +++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 test/zdtm/live/static/child_opened_proc.c diff --git a/test/zdtm.sh b/test/zdtm.sh index 6e3ade51a..e4a21c85d 100644 --- a/test/zdtm.sh +++ b/test/zdtm.sh @@ -66,6 +66,7 @@ static/pty00 static/pty01 static/pty04 static/tty02 +static/child_opened_proc " # Duplicate list with ns/ prefix TEST_LIST=$TEST_LIST$(echo $TEST_LIST | tr ' ' '\n' | sed 's#^#ns/#') diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile index af0513787..bc31148cc 100644 --- a/test/zdtm/live/static/Makefile +++ b/test/zdtm/live/static/Makefile @@ -74,6 +74,7 @@ TST_NOFILE = \ socket-ext \ unhashed_proc \ cow00 \ + child_opened_proc \ posix_timers \ # jobctl00 \ diff --git a/test/zdtm/live/static/child_opened_proc.c b/test/zdtm/live/static/child_opened_proc.c new file mode 100644 index 000000000..06f37cfd7 --- /dev/null +++ b/test/zdtm/live/static/child_opened_proc.c @@ -0,0 +1,63 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zdtmtst.h" + +const char *test_doc = "Check that tree prior to files opening"; +const char *test_author = "Stanislav Kinsbursky