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

1777 Commits

Author SHA1 Message Date
Andrey Vagin
4f1d2a1005 page-server: allow to execute page-server in the background (v2)
page-server creates a listen socket and only then goes into the
background, so we can be sure, that page-server is ready for work after
detaching.

v2: call daemon() in a proper place and reuse the option -d

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-20 15:00:40 +04:00
Pavel Emelyanov
e8e1cae2f9 zdtm: Wire proc-self test in
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-18 04:02:18 +04:00
Cyrill Gorcunov
650164e037 test: zdtm -- Add proc-self test
Just open /proc/self/ns/net and check if
it remains the same on restore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-18 04:01:20 +04:00
Andrey Vagin
1412904e7d zdtm.sh: add the option to clean up in successful cases
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-17 15:07:22 +04:00
Andrey Vagin
3a93bee98c zdtm.sh: add ability to exclude some tests
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-17 15:07:21 +04:00
Andrey Vagin
635005b1c1 zdtm.sh: add description for the option -p
The option -p is used for testing page server

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-17 15:07:20 +04:00
Kir Kolyshkin
96d6fc3dc2 test/*: remove -t from criu restore
Since commit 43ce038 -t is not required for restore,
plus a warning is printed if it is used. Let's remove
-t from criu restore in all test cases.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 08:34:49 +04:00
Pavel Emelyanov
39ec482c15 cr: Fix permissions on several files
cr-check.c for some reason got x bit O_o

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 17:50:57 +04:00
Konstantin Khlebnikov
eaea8f252a zdtm: maps02: fix detecting VmFlags absence
#PSBM-19883

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:28:44 +04:00
Pavel Emelyanov
e490d7778f test: Add two tests for pre-dump action
The first is similar to existing snapshot test -- it calls
several pre-dumps on memory-changing zdtm test, then dumps
and check restore goes OK.

The second test is aimed at measuring frozen-time -- it
takes zdtm test with big mappings, dumps one, then start the
test again and calls one pre-dump plus dump. The sum of
frozen times in the 2nd dump (well, pre-dump + dump) should
be much smaller then the one of the 1st "just dump".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:03:18 +04:00
Pavel Emelyanov
6161208a1c test: Rename mem-snap/run.sh into run-snap.sh
There will be more tests on memory snapshot.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:46:21 +04:00
Pavel Emelyanov
d416e6a135 mem-snap: Redefine CLI options for mem snapshot
They are not documented, thus OK for now. Two options --
* one to specify where the parent images are
* one to reset dirty memory tracking

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:04:57 +04:00
Cyrill Gorcunov
87411d6dfe test: app-emu -- job: Fix comparison and wait for restore complete by a signal
Since we're migrating session leader here, test for session has not
been changed instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:35:32 +04:00
Andrey Vagin
83d4ceb89a zdtm: check signal blocking mask in static/sigpending
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:36:05 +04:00
Andrew Vagin
495c8007bc zdtm: execite test cases from a test user
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:04 +04:00
Andrey Vagin
42d861bb48 zdtm: check bset in caps00
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:03 +04:00
Andrey Vagin
803321abf6 socket-ext: provide access to socket for a test user
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:02 +04:00
Libo Chen
6cc5de60ed session03: change CLONE_STACK_SIZE from PAGE_SIZE to 4096
Update to patch "check: Introduce --ms option" (commit: 379abca968850d0fb66f42115178b040b3a1f5bb)

I find this error in my box:
cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../../lib/arch/x86/include -I../../lib   session03.c ../../lib/libzdtmtst.a   -o session03
session03.c:112:7: error: variably modified ‘stack’ at file scope

The reason is :
"#define CLONE_STACK_SIZE PAGE_SIZE" is conflict with  "#define PAGE_SIZE  (sysconf(_SC_PAGESIZE))" defined in <sys/user.h>.

I think CLONE_STACK_SIZE should be seted  4096 as session02.c.

If this patch is appropriate, please let me know.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:04:07 +04:00
Andrew Vagin
66c21e22cc zdtm: add a new test case, which generate a random process tree
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-19 16:01:58 +04:00
Pavel Emelyanov
1abb8782a8 page-server: Implement holes writing into pagemap
Just add new protocol command and call local_xfer->write_hole on
server side. Also tune the mem-snap test to test memory xfer via
page server.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-18 17:34:47 +04:00
Pavel Emelyanov
68bfaeb852 test: Rise verbosity of mem-snap test's dump
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 12:17:15 +04:00
Pavel Emelyanov
78b8abe9a5 test: Add test for memory snapshots
Two args (optional) -- number of snaps (3 defail) and pause
between them (4 defail).

Uses memory toucher from zdtm/.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 14:50:09 +04:00
Kir Kolyshkin
4eb723db98 Fix typos in messages from test suite
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 12:46:01 +04:00
Pavel Emelyanov
ea5b03cefa zdtm: Test for manual (for now) testing
This guy touches a random page once per second and backs-up
what was touched. At the end it checks whether everything is
OK. It can be used to test how snapshots work -- take several
snapshots with several seconds pauses in betweem and restore
form the last.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 19:45:28 +04:00
Andrey Vagin
82ac1ae325 zdtm: add fanotify00 in the default list
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-11 22:06:55 +04:00
Alexander Kartashov
4498dffce3 zdtm.sh: fixed shared libraries retrieval
The pipe retrieving shared libraries the test depends on

ldd $test_path $ps_path | awk '/^\s/{ print $1 }'

doesn't actually produce any output so all NS tests fail
bacause the system linker fails to locate shared libraries
the test program depends on. This patch fixes the pipe
to retrieve the list of libraries properly.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-11 19:59:49 +04:00
Cyrill Gorcunov
3c3a249e29 test: zdtm -- Fix fanotify00 test
@mnt_id do change on remount so exclude it from
compare.

Reported-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-11 19:58:40 +04:00
Andrey Vagin
6a54f17411 zdtm: don't create loops of bind mounts
Before this patch crtools/test is bound to crtools/test/dump/crtools.XXXXXXX

It's a main reason why "make clean" deletes all content from crtools/test.

Always when you have a test bind mount. You have a test bind mount, when
a test is executed. You execute a test sometimes. So "make clean"
deletes all content sometimes;).

This patch fixes this problem.

Actually this patch fixes more significan problem. If / is a shared
mount (it's defult in FC19),
$ mount --bind crtools/test crtools/test/dump/crtools.XXXXXXX
will recursively copy all previous bind mounts.

E.g:

cd crtools/test
make -j 4
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.DMoEZv ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.DMoEZv ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.oLnVTw ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.DMoEZv/dump/crtools-root.oLnVTw ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.DMoEZv/dump/crtools-root.oLnVTw ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.oLnVTw ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.oLnVTw/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.DMoEZv/dump/crtools-root.oLnVTw/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.DMoEZv/dump/crtools-root.oLnVTw/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.oLnVTw/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.DMoEZv/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.DMoEZv/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-lv_root /root/crtools/test/dump/crtools-root.b86wVA/dump/crtools-root.7zQrDs ext4 rw,relatime,data=ordered 0 0

make -j 32 generates ~2^32 mounts.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-11 15:31:25 +04:00
Andrey Vagin
edc865361e zdtm: print an error message and exit if exec failed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-10 01:24:08 +04:00
Alexander Kartashov
4200d42ee6 session02: hard-code the value of the macro CLONE_STACK_SIZE
The macro PAGE_SIZE is declared in the following way in Debian:

 #define PAGE_SIZE               (sysconf(_SC_PAGESIZE))

that makes it impossible to use the macro as the size of
the array clone_args::stack since this generates the following error:

cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../../lib/arch/arm/include -I../../lib   session02.c ../../lib/libzdtmtst.a   -o session02
session02.c:70:7: error: variably modified 'stack' at file scope

Cc: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-04 14:07:20 +04:00
Andrey Vagin
58f0955d81 zdtm: each test file name should contain a test name
It's required for per-test cleaning.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-01 20:12:04 +04:00
Andrey Vagin
ddc6789dca test: don't skip errors if someone fails
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-01 20:10:05 +04:00
Andrey Vagin
1b234fd890 zdtm: show a process tree before and after c/r
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-01 12:31:14 +04:00
Andrew Vagin
cc97a2d012 zdtm: add one more test case to create a process tree (v2)
Actually this test case is a frame work for creating a process tree.
It creates a process tree according with a predefined sequence of
actions.

This test case create the following process tree:
  5     5  \_ session02               ( 0)
  6     6      \_ session02           ( 1)
  8     7      |   \_ session02       ( 3)
 15    12      |   \_ session02       (10)
 10    10      \_ session02           ( 5)
 11     7          \_ session02       ( 6)
 13    12          \_ session02       ( 8)

v2: improve log messages

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-01 12:31:12 +04:00
Andrey Vagin
0b492b0b10 zdtm: protect random pages in maps04
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-30 00:17:36 +04:00
Andrew Vagin
f16d7c64e5 mount: remove root with MS_PRIVATE before cleaning up mntns
Otherwise we will clean up the root mntns too.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 17:28:30 +04:00
Andrew Vagin
929a0f24fd mount: remove root with MS_PRIVATE before pivot_root
Otherwise if the root is mounted with MS_SHARED, pivot_root fails with EINVAL.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 17:28:27 +04:00
Andrey Vagin
c721df565a zdtm: execute sigpending and sk-netlink only on linux-cr
The functionality for dumping signals and netlink sockets are not merged
in the upstream kernel yet.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 15:52:43 +04:00
Andrey Vagin
282aaf2cba zdtm: add a test case for netlink sockets
* create two bound socket (for unicase and broadcase messages),
  a connected socket, an unbound and unconnected socket.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-26 00:24:30 +04:00
Andrey Vagin
07a1a33fd6 zdtm.sh: add static/sigpending in the default set
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-25 23:44:12 +04:00
Andrey Vagin
13e9291b51 zdtm: add a test case for pending signals
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-25 23:43:30 +04:00
Andrey Vagin
967ca651a8 tty: restore sid on master points only (v2)
If a master point has sid, it doesn't mean, that all slave points
will have sid. Look at tty03 for example:

  PID   SID TT       COMMAND
26748 26748 ?        tty03
26749 26749 pts/2     \_ tty03
26750 26750 ?             \_ tty03

The second process has not a file descriptor for the ctl tty,
but this tty is opened in tty03.

v2: If a slave point with sid has not a master point, the option
--shell-job must be set and sid isn't restored for such terminals.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-19 23:01:51 +04:00
Andrey Vagin
ef726ad51d zdtm: one more test case for controlling terminals
PID   SID TT       COMMAND
26748 26748 ?        tty03
26749 26749 pts/2     \_ tty03
26750 26750 ?             \_ tty03

The second process has not a file descriptor for the ctl tty,
but this tty is opened in tty03.

Currently CRIU can not restore this test case correctly.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-19 23:01:27 +04:00
Andrey Vagin
f2664d6524 pipe: don't reopen pipes via /proc, if it's not required
The system call open can add O_LARGEFILE.

A point is reopend for unsharing a file descriptor. So here are two
types of points. One is returned by pipe() and all other ones are
got via opening /proc/PID/fd.

Currently I know only one difference between these types, it's
O_LARGEFILE.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-19 23:00:59 +04:00
Pavel Emelyanov
9486946b81 zdtm: Return x perms back
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 17:31:21 +04:00
Andrey Vagin
a4f4ca73a1 zdtm: check unshared descriptors for one end of a pipe
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 19:36:17 +04:00
Andrey Vagin
7dc741f4f8 app-emu/lxc: create /var/run/netns/
In Fedora /var/run is on tmpfs, so all directories should be
recreated each times.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 19:35:36 +04:00
Pavel Emelyanov
36b96d1e8a zdtm: Test how page server works
When -p is used, launch page server in the same dir as
crtools dump is to get fill dump in it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:46 +04:00
Andrey Vagin
a59fd3533f zdtm: make datagen/datachk faster for big chunks
Generate random data only for buffers with sizes less than FAST_SIZE
If a size of buffer is more that FAST_SIZE, the first FAST_SIZE bytes
are filled by random generator and then this chunk is used as pattern
for all other chunks.

With out this patch:
$ time bash -x test/zdtm.sh static/maps04
real	0m16.777s
user	0m0.054s
sys	0m0.724s

With this patch:
$ time bash -x test/zdtm.sh static/maps04
real	0m1.865s
user	0m0.128s
sys	0m0.745s

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-06 00:34:02 +04:00
Cyrill Gorcunov
28f063ab9c zdtm: ipc_namespace: Bound min/max for mqueue/msg_max
Otherwise
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:212: Can't write 0 into /proc/sys/fs/mqueue/msg_max (errno = 22 (Invalid argument))
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:273: Failed to randomize ipc namespace tunables (errno = 22 (Invalid argument))
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:336: Failed to randomize ipc ns before migration (errno = 22 (Invalid argument))
 | 11:03:13.527: 19445: ERR: test.c:298: Test exited with unexpectedly with code 1 (errno = 4 (Interrupted system call))

https://bugzilla.openvz.org/show_bug.cgi?id=2530

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-06 00:32:07 +04:00