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

1777 Commits

Author SHA1 Message Date
Andrey Vagin
29a688bb80 zdtm: don't execute mntns_* tests, if the kernel doesn't show mnt_id
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-08 19:22:11 +04:00
Cyrill Gorcunov
1a801c6ded zdtm: timerfd requires new kernels to pass
Reported-by: Jenkins
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-07 10:28:25 +04:00
Cyrill Gorcunov
ec3515107c timerfd: zdtm -- Add simple testcase
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 19:20:28 +04:00
Andrey Vagin
3ab1973067 zdtm: check link-remap and ghost files from a few mntns (v2)
v2: change an author field in a test
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 19:14:22 +04:00
Andrey Vagin
4a15f013fb zdtm: Check that files from alien mnt ns are handled (v2)
Check that files opened before switching to new mount namespace
remain in it after restore. Right now this is not so :( Andrey is
fixing the issue.

Christopher, can you check whether the ns_child's call to system()
works in your minimal set-ups (it launches cat and awk). If not,
then I should rewrite this routine in pure C.

The first version was written by Pavel (xemul@).

v2: don't use test_init_ns
    don't call awk and cat

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 19:14:19 +04:00
Ruslan Kuprieiev
ef39c4657b test: security
This test creates 2 users to check how secure is using criu with setuid bit set.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 10:20:30 +04:00
Ruslan Kuprieiev
c3078e79ec make: test: rpc: don't forget to delete rpc_pb2.pyc
When performing "make clean" rpc_pb2.pyc should be deleted as well.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-06 09:36:00 +04:00
Andrey Vagin
896fae70d3 zdtm: rollback cwd only if a test case is executed in namespaces
$ bash test/zdtm.sh -i 0 '\(ns/static/env00\|static/pty03\|static/mountpoints\)'
...
==================================== ERROR ====================================
Test: zdtm/live/static/mountpoints, Namespace:
Output file: /root/git/1/criu/test/zdtm/live/static/mountpoints.out
------------------------------------------------------------------------------
00:53:03.267: 26935: FAIL: mountpoints.c:139: Can't umount all the filesystems (errno = 16 (Device or resource busy))
------------------------------------- END -------------------------------------
================================= ERROR OVER =================================

Fixes: 0198590c5a44 (zdtm: Factor out starting the test via Makefule)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-05 16:33:58 +04:00
Tycho Andersen
df6f80f48e .git: add cgroup01 to gitignore
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-04 13:58:41 +04:00
Andrey Vagin
787e8a1d88 test/mountpoints: clean up
All mounts is marked as private for one call, so we don't need the
variable private, which has been added in "(55fe0939088d) zdtm: don't
destruct an external mount-namespace"

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-04 13:07:40 +04:00
Christopher Covington
24a2cec44c ZDTM build fixes
Errors building natively for x86_64 on Ubuntu 12.04:

session02.c:142:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared

session03.c:175:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared

vdso01.c:300: undefined reference to `clock_gettime'

Error cross compiling for arm using Linaro 14.01 toolchain:

gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.c:1:0: error: bad value (cortex-a15) for -mtune= switch
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.pb-c.c:1:0: error: bad value (cortex-a15) for -mtune= switch

Errors cross compiling for aarch64 using Linaro 14.01 toolchain:

maps007.c: In function ‘main’:
maps007.c:88:4: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror]
    if (futex_get(&shm->stop) && atomic_get(&shm->delta) == MAX_DELTA)
    ^
In file included from ../../lib/lock.h:10:0,
                 from maps007.c:13:
../../lib/arch/aarch64/include/asm/atomic.h:14:19: note: expected ‘const atomic_t *’ but argument is of type ‘struct f
utex_t *’
 static inline int atomic_read(const atomic_t *v)
                   ^

ptrace.c: In function ‘main’:
ptrace.c:97:15: error: ‘PTRACE_GETREGS’ undeclared (first use in this function)
    if (ptrace(PTRACE_GETREGS, stopped, NULL, regs)) {
               ^

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-11 20:39:52 +04:00
Tycho Andersen
51876eea5d Attempt to restore cgroups
During the dump phase, /proc/cgroups is parsed to find co-mounted cgroups.
Then, for each task /proc/self/cgroup is parsed for the cgroups that it is a
member of, and that cgroup is traversed to find any child cgroups which may
also need restoring. Any cgroups not currently mounted will be temporarily
mounted and traversed. All of this information is persisted along with the
original cg_sets, which indicate which cgroups a task is a member of.

On restore, an initial phase creates all the cgroups which were saved. Tasks
are then restored into these cgroups via cg_sets as usual.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-10 17:00:28 +04:00
Andrey Vagin
828715f9f9 jenkins/btrfs: exclude inotify_irmap
Cyrill:  we exclude these tests because of braindamaged scheme
         btrfs uses for subvolume device numbering which we don't
	 yet support in inrmaps.

Test: zdtm/live/static/inotify_irmap, Result: FAIL
==================================== ERROR ====================================
Test: zdtm/live/static/inotify_irmap, Namespace: 1
Dump log   : /mnt/btrfs/workspace/test/dump/inotify_irmap/16077/1/dump.log
--------------------------------- grep Error ---------------------------------
(00.024342) Error (irmap.c:80): irmap: Can't stat /var/spool: No such file or directory
(00.024365) Error (irmap.c:80): irmap: Can't stat /lib/udev: No such file or directory
(00.024378) Error (irmap.c:80): irmap: Can't stat /no-such-path: No such file or directory
(00.024383) Error (fsnotify.c:184): fsnotify: Can't dump that handle
(00.024397) Error (cr-dump.c:1563): Dump files (pid: 16090) failed with -1
(00.024779) Error (cr-dump.c:1911): Dumping FAILED.
------------------------------------- END -------------------------------------
================================= ERROR OVER =================================

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-08 19:18:39 +04:00
Andrey Vagin
77391fa795 test/jenkins: add job to test pre-dump
Make pre-dump twice and then dump and restore.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-08 19:18:37 +04:00
Pavel Emelyanov
061d69614a zdtm: Pick up deleted unix socket test (v2)
CRIU doesn't support relative unix sockets paths, so
tune the test to use absolute.

(v2: Off-by-one spotted by Filipe)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:13:41 +04:00
Andrey Vagin
d3819b756f test/socket-tcpbuf: add heartbeat to make blood flow in the connection
Otherwise the connection can be disconnected due to a timeout, because
the kernel may drop packets from a receive queue (RcvPruned in
/proc/net/netstat).

Half of buffers always stay in the socket, another half is circulated.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:09:57 +04:00
Andrey Vagin
437aff387a zdtm/socket-tcpbuf: add shortcuts for RDWRing a specified size of data
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:09:46 +04:00
Pavel Emelyanov
7efbdf2de4 zdtm: Add test for cwd and opened ghost directory
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:09:08 +04:00
Pavel Emelyanov
5be15df097 zdtm: Add test for cwd ghost directory
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:09:07 +04:00
Pavel Emelyanov
471d73e343 zdtm: Add test for opened ghost directory
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-04 15:09:01 +04:00
Andrey Vagin
8937bf7a72 test: add mounts/ext in the "other" list
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-03 19:21:20 +04:00
Pavel Emelyanov
daccf5ec97 zdtm: Add more verbosity to deleted_dev failure
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-03 13:29:09 +04:00
Pavel Emelyanov
0ce9ce408a zdtm: Fix deleted_dev and add to the runlist
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-03 13:29:04 +04:00
Pavel Emelyanov
731dc18332 zdtm: Pick up some tests that pass
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:14:14 +04:00
Pavel Emelyanov
0198590c5a zdtm: Factor out starting the test via Makefule
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:13:52 +04:00
Pavel Emelyanov
2fc837917f zdtm: Don't build test for the 2nd time
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:13:51 +04:00
Pavel Emelyanov
8eb1d662bf zdtm: Factor out getting pid of test
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:13:49 +04:00
Andrew Vagin
693bf79ffd test: add a script for jenkins to execute non-zdtm tests
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:13:17 +04:00
Andrew Vagin
2eb0a6b6cb test/meme-snap: remove an nonexistent target
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:13:11 +04:00
Pavel Emelyanov
f6111769c3 zdtm: Introduce per-test criu options
Some tests require custom options for dump and restore. Instead
of hard-coding test names into zdth.sh, introduce the $test.opts
file from which zdtm would pick the needed options.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:12:36 +04:00
Pavel Emelyanov
6021378ca6 zdtm: Introduce $cpt_args
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:12:35 +04:00
Pavel Emelyanov
3d14c71c52 zdtm: Rename $args into $gen_args
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:12:33 +04:00
Pavel Emelyanov
3b71200cd5 zdtm: Remove unused ARGS variable
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-02 12:12:28 +04:00
Pavel Emelyanov
bd93f9b49a .git: Add vdso01 and pdeath_sig into gitignore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-07-01 17:44:28 +04:00
Pavel Emelyanov
fba8aae300 zdtm: Tech that pdeath_sig is preserved
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-01 16:16:06 +04:00
Pavel Emelyanov
7dfcf2a4cb test: Test how criu_dump_iters from library works
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:29:56 +04:00
Pavel Emelyanov
7aee2619c6 test: Cleanup libcriu tests makefile
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:29:35 +04:00
Pavel Emelyanov
43e5d05134 libcriu: Ability to fetch arguments from notifications
After a bit more thinking I found a way to fetch arguments
from notifications -- pass opaque value into callback and
provide a set of calls for exploring one.

With this we can

a) provide more data if service supplies additional fields
   in the future
b) not check the action name to decide whether or not the
   requested argument is available

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:28:55 +04:00
Pavel Emelyanov
5cea861d7f test: Add test for notifications via libcriu
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:28:54 +04:00
Pavel Emelyanov
714dfdb7d9 test: Add lib.c to libcriu tests
Just some common stuff.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:48 +04:00
Pavel Emelyanov
5d75c52356 test: Rename libcriu run_sub.sh -> run.sh
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:47 +04:00
Pavel Emelyanov
022afe8b2f test: Clean old libcriu tests
New ones cover more and can be used in Jenkins

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:45 +04:00
Pavel Emelyanov
afa47b23aa test: Tune libcriu tests launcher (v2)
v2:
* introduce the run_test helper
* fix overall result detection

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:43 +04:00
Pavel Emelyanov
fd214e0031 test: Helper for checking child exit status
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:42 +04:00
Pavel Emelyanov
f929839ab8 test: Add test for self dump
It's derived from test.c, but is more self-contained
and explicitly checks for both C and R results.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-27 14:26:40 +04:00
Pavel Emelyanov
a137d9fd58 test: A simple test for criu_restore_sub call v2
Which is at the same time the demonstration of how to do the trick.
v2:
* remove stupid sleep 1 synchronization
* run internal version of child, not the external script

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
2014-06-27 14:24:37 +04:00
Andrey Vagin
6f45c38c18 mount: parse devpts options
The newinstance options isn't shown in mountinfo. Currently it is
detected in devpts_dump. It is added only for root mounts and it
isn't added for bind-mounts. So mounts_equal(a, b, true) returns false
for such mounts and criu doesn't understand that they should be
bind-mounted.

Reported-by: Tycho Andersen <tycho.andersen@canonical.com>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-25 19:51:01 +04:00
Cyrill Gorcunov
817bf78523 zdtm: posix_timers -- Add definition of CLOCK_BOOTTIME
On PI we've noticed that CLOCK_BOOTTIME might not be defined
in system headers, so ship own one.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-25 19:37:01 +04:00
Cyrill Gorcunov
1764db0fa1 zdtm: Make arch specific tests to have \Space at the end
Otherwise we might have a clash

| Execute zdtm/live/static/vdso01ns/static/pipe00

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-25 16:49:16 +04:00
Cyrill Gorcunov
905ceac7c5 zdtm: Add arch specific tests
To be able to run specific tests depending on
architecture we're executing on.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-25 14:11:50 +04:00