zdtm: wait a test process instead of output file

A test should be completed if a test process exited.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
zdtm: remove error messages, that this directory is exist

Like this:
mkdir: cannot create directory ‘/tmp/criu-root.wt2oW0/lib64’: File exists
zdtm: remove many useless messages from make

make: Entering directory `/root/crtools/test/zdtm/live/static'
make -C ../../lib
make[1]: Entering directory `/root/crtools/test/zdtm/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/crtools/test/zdtm/lib'
rm -f -f -r env00.pid env00.out* *env00.test* env00.*.test env00.state
make: Leaving directory `/root/crtools/test/zdtm/live/static'
pid00 caps00 maps01 groups sched_prio00 sched_policy00 sock_opts00 sock_opts01 cmdlinenv00 packet_sock fanotify00 sk-netlink
make: Entering directory `/root/crtools/test/zdtm/live/static'
make -C ../../lib
make[1]: Entering directory `/root/crtools/test/zdtm/lib'
zdtm: don't print useless messages from Makefile
zdtm: hide output of commands, which checks existence of something
test: check, that parasite can rollback itself (v2)

This test uses systemtap to replace random parasite command on
invalide command. The parasite code received this command and should
rollback itself. CRIU didn't recived ack, should understand that
something wrong and exits. The systemtap inverts exit code of criu.

"zdtm.sh -d" is used for executing tests and testing that the state of
processes don't corrupted.

v2: randomize a command, which will be replaced
posix-times: don't fail if /proc/PID/times is absent

/proc/PID/times was added in 3.10, but FC19 relesead with 3.9.

Usually we support only last version of kernel in the project git, so
we can commit it as an additional patch for the fedora package.

Cc: Adrian Reber <adrian@lisas.de>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
zdtm.sh: check number of mounts in mountinfo
zdtm: expand the mountpoints test

* check shared and slave mounts
* check bind-mounts
mount: link dependent mounts (v2)

All shared mounts from one group are connected to circular list.
All slave are added into the proper master list.

v2: change variable name and fix a bug about adding shared mounts in a
circular list.
mount: save group and master in image file

They are required for restoring shared and slave mounts
mounts: enumirate mounts bellow specified element
mounts: if a mount can't be mounted, it is queued in postpone list

Try to restore mounts while a postpone list isn't empty and check
that each iteration has some progress, otherwice it will fails for
preventing infinite loops
mounts: find mounts, which are propagated from a current one

A mount is propagated to all members of a parent's shared group

Signed-off-by: Andrey Vagin <avagin@openvz.org>
bindmounts
mounts: handle shared and slave mounts

The idea is simple. If a mount can't be mounted now, we will try to
mount it later.
signals: dump alternate stack as misc parameters

The initilization stage is not good for that, because it can fail.
check: check PTRACE_{GET,SET}SIGMASK
parasite: move code about creating control sockets in a separate func

It will be used in a few places
parasite: block signals for each parasite command

Pending signals should be saved, so signals should be blocked.
Signals are blocked for EACH command, because a chance of destroying a
process state should be a small as possible.

If crtools is killed between two commands, a dumped process will run
continue.