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

1777 Commits

Author SHA1 Message Date
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
Andrey Vagin
8abf475d59 zdtm: make zdtm.sh faster in two times
It requered 1m19s for executing all tests.
Now it requires 38s.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:04:37 +04:00
Cyrill Gorcunov
486da8827e zdtm: Convert caps00 test to use task_waiters
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:03:45 +04:00
Cyrill Gorcunov
8d7a55ed74 zdtm: Add task_waiter_ helpers v3
Sometime we need sync points in testee program flow,
for this reason task_waiter_ introduced.

The call semantics is the following

        Parent                  Child
        ------                  -----
        task_waiter_init
                                task_waiter_wait4
        task_waiter_complete
                                task_waiter_wait4
        task_waiter_complete

                ...

Thus initially task_waiter_init should be called
to initialize all internals guts needed.

Then one become waitee and calls for task_waiter_wait4,
where lockid should be provided as an argument. Since
it should be unique values the best option might be
gettid().

The same applies to a waiter side -- it should call
for task_waiter_complete and provide a lockid.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:03:31 +04:00
Pavel Emelyanov
a03323e162 zdtm: Basic test for mount points in mount namespace
Test with sysfs and proc as no other fs-s are currently supported.
Will be fixed later.

Note, that the original /proc mount is kept as the dumping code requires
it for reading pagemap file with RSS info. Worth fixing it some day?

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:41 +04:00
Andrey Vagin
16c7adecdd zdtm: add two test cases for tty-s
* check, that pseudoterminals are restored
* check, that a control terminal is restred

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:17:54 +04:00
Andrey Vagin
24074a9dbb zdtm: add new test case for checking that SID is restored
2     2 session00
    4     4  \_ session00		# {NEWSID, },
    2     5  \_ session00		# {0, },
    8     8  \_ session00
    2     9  |   \_ session00           # {CHANGESID, }
   10    10  \_ session00
   11    11      \_ session00
    2    12          \_ session00	# {DOUBLE_CHANGESID | CHANGESID, }
    2     3 session00			# {DETACH, },
    6     7 session00			# {DETACH|NEWSID, },

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:15:30 +04:00
Andrey Vagin
9b3b059bdc crtools: add "pid" to the --namespaces cmdline option arguments (v3)
to require dumping pid namespace. Dump and restore will be failed if
a tress doesn't contain a process init.

pid namespace will be created implicitly if a process init in the tree.

v2: fix comments from Pavel
v3: Restore of pidns should be approved by user

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:08:57 +04:00
Andrey Vagin
b11785212b zdtm: remove unused code from sockets_dgram
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Victor konyashkin <vkonyashkin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:17:25 +04:00