2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 12:57:57 +00:00

235 Commits

Author SHA1 Message Date
Andrey Vagin
eb63547a9b zdtm.sh: logfd can be closed when crtools already detached (v2)
So try to check on extra descriptors a few times

v2: move save_fds in a loop

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 15:33:01 +04:00
Andrey Vagin
fab874bf2f zdtm: check external sockets
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 15:32:45 +04:00
Andrey Vagin
410345a9d1 zdtm: add ability to create an external tasks
It will be used for checking tcp connections, external unix sockets, etc

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 15:31:59 +04:00
Andrey Vagin
c238e99b29 zdtm: rework logging
* Delete internal buffer, all data are written immediately in a log file
* Add timestamp and pid in a message
* All processes write log messages in one file

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 15:31:23 +04:00
Pavel Emelyanov
b719b93daa zdtm: Configure rings in packet socket test
Now we can at least look into images manually to check how
rings are dumped. Later we should write an auto test.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-20 15:33:00 +04:00
Pavel Emelyanov
398bec28a9 zdtm: Test for packet fanout
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-20 15:32:34 +04:00
Pavel Emelyanov
69acf64f57 packet: Add support for mclists
The implementation is rather straightforward. One thing to note
is that non-single membership of each type is not supported. It
can be done, but I'm unaware of any software doing so.

Note: the pb show routine should be tuned to support showing bytes.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-15 21:04:49 +04:00
Andrey Vagin
da2ebabf86 zdtm.sh: check that the util "ip" containes our patches
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-15 17:50:19 +04:00
Andrey Vagin
b50861327e zdtm: don't compile tests with --static
zdtm.sh copies all required libraries in a new root

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-15 15:06:49 +04:00
Stanislav Kinsbursky
621afa560d zdtm: fix compile error in case of NEW_IPC_NS is not set
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-14 14:24:06 +04:00
Andrey Vagin
6aaf65642b zdtm: move all logic about namespaces from test_init in libzdtm
A test will be executed in new set of namespaces if the environment
variable ZDTM_NEWNS is set. A pid of the root task will be written in
$ZDTM_PIDFILE and a root fyle system will be changed on $ZDTM_ROOT.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-14 12:56:20 +04:00
Cyrill Gorcunov
1e1837a83e zdtm: Add futex-rl test
To test futex robust list C/R.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 20:29:02 +04:00
Andrey Vagin
04b8a62377 zdtm.sh: $pid has been renamed to $PID, but one was skipped
Reported-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 19:53:41 +04:00
Andrey Vagin
58e22f31fc mount: Add support of tmpfs (v3)
When dumping a tmpfs mount we need to take its contents with us.
So, use tar for it and put it into the image dir.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 19:51:22 +04:00
Andrey Vagin
b0d7cc9724 mount: Add suport of empty binfmt_misc (v3)
Binfmt is global fs. We could check for its inhabitants intersect on
source and destination, but for the 1st time it's enough just to check
this one being empty.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 19:47:20 +04:00
Pavel Emelyanov
d29feb9103 packetsk: Add support for auxdata, origdev and vnethdr bits
These are boolean in reality.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 18:13:02 +04:00
Pavel Emelyanov
3ef8d138ab packetsk: Support PACKET_RESERVE option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 17:38:15 +04:00
Pavel Emelyanov
1259a9ad80 packetsk: Support PACKET_VERSION sockoption
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 17:34:40 +04:00
Pavel Emelyanov
579a5cd211 zdtm: Test for packet sockets
Create and bind. Nothing more.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 16:18:54 +04:00
Andrey Vagin
ba0d5fb226 dump: handle overmounted devices (v2)
"init" in LXC opens /dev/null and then mounts devtmpfs in /dev,
so crtools can not resolve the path to the origin /dev/null.

crtools with the option --evasive-devices will check the origin
device and a new device are the same and if it's true, crtools will
dump a new path.

v2: add a description for the option

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:33:49 +04:00
Andrey Vagin
a5dff04d6a socket_listen: interrupt a parent if a child exited
When a child exited, SIGCHLD is sent to parent,
if SIGCHLD has handler without SA_RESTART, the current
syscall will be interrupted.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-06 18:30:45 +04:00
Pavel Emelyanov
ce25c67b90 zdtm: Wire signalfd00 in
The kernel patch is in 3.5 branch, so we can make this test
run automatically.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 12:49:51 +04:00
Pavel Emelyanov
f289ac2c1a zdtm: Signalfd testing
It's not in zdtm.sh yet, since kernel patch is not yet
committed. When kernel is updated, the zdtm.sh will be too.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 12:28:16 +04:00
Pavel Emelyanov
d8a6ecc630 zdtm: Netns basic test
Only checks for lo, one simple ifaddr and two routes are handled. Sanity
test and nothing more.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:32:06 +04:00
Andrey Vagin
1fef842025 zdtm.sh: dump mount namespace for test_init
* s/pidns/ns/
* Add option --namespace mnt to "crtools dump"

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-01 07:01:36 +04:00
Andrey Vagin
9c1fa58c9d test_init: add support of mount namespaces
A part of code has been copied from mountpoints.c

This code umounts all points except /proc and /

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-01 07:01:29 +04:00
Andrey Vagin
3a60163b71 zdtm: open a file in mountpoints.c
We need to check that opened files can be restored in mntns
[xemul: s/slabinfo/meminfo as in 9dc050fd]

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-01 06:57:20 +04:00
Andrey Vagin
368d7ac0e6 zdtm: test_init exits, if all children died
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:48:16 +04:00
Andrey Vagin
a954120154 zdtm: close a write end of a status pipe in a parent process
Otherwise a parent hangs if a child died, because
it reads from a status pipe.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:47:15 +04:00
Andrey Vagin
44c2ac9310 zdtm: test_init creates a pid file
Before this patch we use pidof to get a pid of a test process.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:47:07 +04:00
Konstantin Khlebnikov
9dc050fde0 zdtm: /proc/slabinfo not present in container
PCLIN-31078

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:45:57 +04:00
Victor Konyashkin
2fe7ed666b zdtm: It's need define CLONE_NEWIPC for redhat-el5
The patch allows define CLONE_NEWIPC for redhat-el5.

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:08:25 +04:00
Victor Konyashkin
fc3a5ebd3d zdtm: It's need define CLONE_NEWPID for redhat-el5
The patch allows define CLONE_NEWPID for redhat-el5 to avoid error:
test_init.c:114: error: 'CLONE_NEWPID' undeclared (first use in this function)

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 15:07:07 +04:00
vkonyashkin
d1a36cc98a zdtm: It's need turn off FORTIFY_SOURCE instead of use -Wno-unused-result option
The -Wno-unused-result option looks to have been introduced in GCC 4.5.0.
So it's need turn off FORTIFY_SOURCE (compiler warn about unused results
in fortification mode) instead of use -Wno-unused-result to avoid error
in versions prior to 4.5.0.

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Wagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:06:04 +04:00
vkonyashkin
47d200c637 zdtm: It's need to sleep between clock_gettime() in uptime_grow
Kernel can't suspend container by design if calls clock_gettime()
in a loop, so we need to sleep between clock_gettime().

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:05:43 +04:00
Cyrill Gorcunov
737045fe57 test: Drop legacy directory
All things are already in zdtm, not need to carry it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:59:05 +04:00
Konstantin Khlebnikov
c256706a09 zdtm: /sys/kernel/debug not present in container
debugfs isn't virtualized and never will be

jira #PCLIN-31059

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-16 06:57:19 +04:00
Pavel Emelyanov
decf115f7e zdtm: Wait for test finish with increasing intervals
This makes tests that finish some time run smoother -- no tons of Waiting... messages
on the screen

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 07:57:23 +04:00
Cyrill Gorcunov
7ff9efda4a zdtm: fifo-rowo-pair test update
Address Andrew's comments

 - use TEST_VALUE macro instead of open coded value
 - use WIFx macros for child status testing
 - kill child/parent on error

Note that it was not clear from an initiall patch
change log -- the difference between fifo_wronly
test case and this one is that we use fork() call
here which allow us to make sure that fifo restoration
code logic will be tested more widely.

Basically the flowchart of the test case:

parent				child
------				-----
open RW fifo (slave)
open RO fifo (master)
				open WO fifo (master)
				dup parent slave to slave1

				... waiting c/r to happen ...
				... waking up from c/r ...

				send bytes to master
				send bytes to slave1

				finish
... initiating c/r ...
... waking up from c/r ...

read bytes from master
read bytes from slave

PASS :D

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:56:01 +04:00
Andrey Vagin
63dcf183f2 zdtm: add a test case for checking sid and pgid
A process tree is described in the array. New cases are easy for adding.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:52 +04:00
Andrey Vagin
23501ffe32 zdtm: add ability to set id of a test proccess
It's just easy for debugging

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:51 +04:00
Andrey Vagin
faf12f405b zdtm: copy futex engine from crtools (v2)
We can't reuse it from crtools, because zdtm is used separately.

v2 syscall() returns an error code in errno.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:50 +04:00
Cyrill Gorcunov
18d8950355 zdtm: Enable fifo and fifo_wronly tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:45:35 +04:00
Cyrill Gorcunov
c8bf5e3fd0 zdtm: Add fifo ghost file test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:45:18 +04:00
Cyrill Gorcunov
e0939577ea zdtm: Add fifo-rowo-pair test case
I need a special test case where fake
fifo will be created by us to restore
the former.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:44:59 +04:00
Andrey Vagin
16c410b19f zdtm: check content of an unlinked file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 15:34:24 +04:00
Cyrill Gorcunov
29cb7de198 zdtm: Turn on unbound_sock test case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 14:43:24 +04:00
Andrey Vagin
877f8c8276 zdtm: simplify sys_gettid
It fix compilation on x32

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-28 20:54:12 +04:00
Evgeny Antyshev
dc2a99c627 zdtm: allow for 0 timer growth in uptime_grow
It may occur that the loop spins faster than clock ticks.

Signed-off-by: Evgeny Antyshev <eantyshev@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:08:42 +04:00
Andrey Vagin
18cd74069c zdtm: don't print useless numbers
expr prints a substing length. This patch redirects output of expr to /dev/null

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:05:08 +04:00