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
Cyrill Gorcunov
3423e3492b zdtm: Add vdso01 test case
It parses vDSO in memory (just like CRIU does) and
then use direct calls to vDSO entries instead of
.plt/.got bundle. The reason for that -- I must
be sure we're able to proceed calls without relying
on libc anyhow.

Note the test is x86-64 specific so I don't turn in
on in test suite by default.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-25 14:11:24 +04:00
Cyrill Gorcunov
99cd969595 zdtm: Add CLOCK_BOOTTIME test into posix_timers
To test CLOCK_BOOTTIME feature recently implemented in OpenVZ kernel.
Vanilla kernel and CRIU passes it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 23:37:18 +04:00
Andrew Vagin
876def9546 test: add a target to execute non-zdtm tests
make -C test other

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:50:43 +04:00
Andrey Vagin
ac2dc9fc7f test/ext-links: fix path to the ip tool
run.sh: line 17: xip: command not found

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:50:17 +04:00
Filipe Brandenburger
e0b3018b71 git: add /dev to test/.gitignore
The /dev directory is also created by zdtm when running ns/ enabled tests.
Add it to the list, together with entries such as /bin and /lib.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:44:42 +04:00
Filipe Brandenburger
340a246444 zdtm: add missing entries to test/zdtm/.gitignore
This adds new tests "cgroup00" and "clean_mntns" to the .gitignore file.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:44:40 +04:00
Filipe Brandenburger
6cf2906b0a zdtm: add new dumpable02 test to check that dumpable flag set to 0 or 2 works
This confirms that the fix to handle dumpable flag set to 2 still works after
restore.

To force dumpable flag set to 0 or 2 (whatever the fs.suid_dumpable is set to),
chmod the test binary to 0111 (executable, but not readable) and execv() it
while running as non-root.  The kernel will unset the dumpable flag to prevent
a core dump or ptrace to giving the user access to the pages of the binary
(which are supposedly not readable by that user.)

Tested:
- # test/zdtm.sh static/dumpable02
  Test: zdtm/live/static/dumpable02, Result: PASS
- # test/zdtm.sh ns/static/dumpable02
  Test: zdtm/live/static/dumpable02, Result: PASS
- Used -DDEBUG to confirm the value of the dumpable flag was 0 or 2 to match
  the fs.suid_dumpable sysctl in the tests (both in and out of namespaces.)
- Confirmed that the test fails if the commit that fixes handling of dumpable
  flag with value 2 is reverted and the fs.suid_dumpable sysctl is set to 2.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:44:39 +04:00
Filipe Brandenburger
1176081e1f zdtm: add new dumpable01 test to check that dumpable flag is preserved
This confirms that the fix in commit d5bb7e9748fd to preserve the dumpable flag
after migration is working as expected.

In this test case, the dumpable flag is expected to always be set to 1, as
test_init will use prctl to reset it to 1 after using setuid and setgid.

Tested:
- # test/zdtm.sh static/dumpable01
  Test: zdtm/live/static/dumpable01, Result: PASS
- # test/zdtm.sh ns/static/dumpable01
  Test: zdtm/live/static/dumpable01, Result: PASS
- Confirmed that the test fails after reverting commit d5bb7e9748fd.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-24 22:44:34 +04:00
Andrey Vagin
2ad1ba72fa zdtm: check bind-mounted files in static/mountpoints
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-17 10:40:23 +04:00
Pavel Emelyanov
bd7bddb889 zdtm: Add test for mount namespace w/o mountpoints
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
2014-06-09 15:29:52 +04:00
Pavel Emelyanov
d9e7a5f155 zdtm: Add ability just to start the test
When running test with ns/ prefix zdth.sh does complex preparations.
Make it possible to make them and let started process ready for
manual investigation.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
2014-06-09 15:29:44 +04:00
Pavel Emelyanov
0457c94c69 zdtm: Make it possible for test to get ZDTM_NEWNS variable
I will need to make cgroup test behave slightly differently
when it's in and out of ns/ run. To do so it's handy to use
the ZDTM_NEWNS variable set by zdtm.sh

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-06 12:18:50 +04:00
Pavel Emelyanov
441b9b9ee5 zdtm: Stupid test for task-in-cgroup
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-28 00:24:54 +04:00
Filipe Brandenburger
ff1cf6b2ca zdtm: add missing entries to test/zdtm/.gitignore
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:56 +04:00
Filipe Brandenburger
5b14a32e35 zdtm: keep entries in test/zdtm/.gitignore sorted
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:54 +04:00
Filipe Brandenburger
733bbb337c make: use -pthread when linking with -lrt
This is required when linking statically.  It is also consistent with
the rules for other zdtm tests that link with -lrt.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:53 +04:00
Filipe Brandenburger
81fe07e54d make: respect USERCFLAGS in zdtm makefiles
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:52 +04:00
Filipe Brandenburger
9f415abdb7 zdtm: fix cow01 test to fail on system errors
Add extra troubleshooting messages for errors and failures so that the
output can help troubleshoot the issue.

Make error handling more uniform by using -1 for errors (e.g. opening
files, reading from pagemap, etc.) and 1 for failures (data mismatch,
pages not COWed when expected to be, etc.)

Tested: Ran this test with criu versions known to have problems with COW
and with problems to read from pagemap due to the dumpable flag not
being preserved.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-21 00:51:44 +04:00
Andrey Vagin
8e1842aec1 zdtm/pty02: ignore SIGHUP
The test proces opens master and slave points. The slave point becomes
the control terminal for this process. Then the test process forks a
second process and the first process closes the master point. So when a
master point is closed in a second process, the first one will be killed
by SIGHUP.

Reported-by: Victor Konyashkin <vkonyashkin@parallels.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-14 17:35:53 +04:00
Andrey Vagin
be10e0e157 git: update .gitignore
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-14 17:34:41 +04:00
Cyrill Gorcunov
ebd2e88c9a zdtm: maps05 -- Test a flood of small VMAs
Here we test a big number of small VMAs to survive c/r. The main
idea is to use a big number of IOVs needed for page transferring.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-12 14:46:48 +04:00
Andrey Vagin
63c9478a4a zdtm: add a new test case for growdown vma-s
This test case creates two consecutive grows down vmas with a hole
between them.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-07 21:03:50 +04:00
Andrey Vagin
08960eb1fb zdtm: check mnt_id in /proc/PID/fdinfo/X
Nested mount namespaces should be checked only if fdinfo contains mnt_id

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-24 11:55:40 +04:00
Pavel Emelyanov
5975c94e3c zdtm: Add testing of irmap cache generation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-23 17:24:19 +04:00
Andrey Vagin
a3ea8102ea zdtm: check opened files in a second mntns
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-21 22:40:25 +04:00
Andrey Vagin
9ea2baa2db zdtm: reexec the mountpoints test in a target mntns
Otherwise it will have external files (from another namespace,
which isn't dumped).

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-21 22:39:17 +04:00
Andrey Vagin
15a457bde8 zdtm: Mark all mounts as private with one call
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-21 22:38:52 +04:00
Andrey Vagin
c51e91f6ec zdtm/mountpoints: test nested mount namespaces
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-21 22:38:38 +04:00
Tikhomirov Pavel
72dd148a44 zdtm: add --track-mem to final snapshot
otherwize it won't use/check parent snapshots, only last one
on restore.

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-14 18:37:55 +04:00
Andrey Vagin
8d87596e13 zdtm: check bind mounts of the root mount
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-11 16:04:36 +04:00
Andrey Vagin
8135116a71 zdtm: mount devpts with the newinstance flag
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-11 15:41:01 +04:00
Alexander Kartashov
4fb51b89c5 zdtm: added the AArch64-specific implementation of bit operations
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-11 15:19:21 +04:00
Jamie Liu
4848ef660f zdtm: fix integer literal type bug in maps03
maps03 should have caught the bug fixed by 288cf5174165 "restore: mutate
tgt_addr in map_private_vma", but didn't because integer literals
(defaulting to 32-bit ints) were shifted out of range.

Signed-off-by: Jamie Liu <jamieliu@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-04 20:38:37 +04:00
Jamie Liu
13371c6a85 zdtm: add maps_file_prot
Tests for the bugs fixed by "criu: fix filemap open permissions".

Signed-off-by: Jamie Liu <jamieliu@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-04 20:37:25 +04:00
Cyrill Gorcunov
08e0b1de20 test: bers -- Initial commit
bers stads for berserker which should eat computer
resources emulating "load" for CRIU performance testing.

It's still far from being complete but can do trivial things:

 - generate mmap's with memory dirtified
 - open files

Nothing serious.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-18 11:57:12 +04:00
Tikhomirov Pavel
5a6e9b17c1 v2 (v6) zdtm: test for auto-dedup on restore
if final size of all pages images is zero than dedup works

use :
bash test/zdtm.sh --auto-dedup
bash test/zdtm.sh --auto-dedup static/maps04
bash test/zdtm.sh -P -i 3 --auto-dedup -t transition/maps007

changes: aplicable for all tests, -ad changed to --auto-dedup,
simplify, check all private pages images, check shmem images
and go with shmem patch set.

Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-18 11:49:00 +04:00
Andrey Vagin
485766bc38 zdtm: check posix_timer with sival_ptr = NULL
Here is a regresion test cae for

commit 1934e1a9638cdb8cd546cd0499fe7804317593d8
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Feb 18 16:53:00 2014 +0400

    posix-timer: take into account that sival_ptr can be NULL (v3)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-11 22:17:17 +04:00
Andrey Vagin
223a998265 zdtm/tempfs: check that overmounted parts are restored (v2)
v2: check that plain file opened on tempfs
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 20:32:51 +04:00
Tikhomirov Pavel
f65714de1b v2 test: auto-dedup on restore
Use maps04, on tmpfs, check if size of pages image is zero in the end

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 14:12:18 +04:00
Tikhomirov Pavel
0766cf39c0 v2 test: auto-deduplication on restore
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 14:12:00 +04:00
Andrey Vagin
8dd4134189 test: add scripts, which are used by jenkins (v2)
v2: split one job on a few parts
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:30:22 +04:00
Andrey Vagin
5fab7f3239 maps007: save core files in a error case
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:29:31 +04:00
Andrey Vagin
e16f0976fc zdtm/maps007: remove spinlocks from the test
Use futex for synchronization instead of spinning on atomic variables.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:18:44 +04:00
Andrey Vagin
8ce7ef75ec zdtm/lock: add futex_add_and_wake and futex_wait_while_lt
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:18:43 +04:00
Andrey Vagin
1b16fa048c zdtm/maps007: limit delta betwen parent and child from both sides
Currenty a parent can go far away from child and we will need to wait
too long for checking results.

This pach limits delta to [MIN_DELTA, 2 * MIN_DELTA].

Thi patch should fix current errors for the CRIU-iter job in Jenkins.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:09:32 +04:00
Andrey Vagin
1a89dbb5da zdtm/lock: make futex_inc and futex_dec atomical
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:09:19 +04:00
Andrey Vagin
db3371bea1 zdtm: add maps007 in the test list
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-18 19:37:11 +04:00
Christopher Covington
d6005ed12e Use SRCARCH internally
ARCH is a user-facing variable and setting it on the command line
clobbers any manipulation attempted in the makefile. Following
the example of the Linux kernel makefiles, use a SRCARCH variable
instead for the internal, potentially fixed-up, architecture name.
This fixes the following error.

make ARCH=x86_64
Makefile:69: *** "The architecture x86_64 isn't supported".  Stop.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:33:47 +04:00
Pavel Emelyanov
1c265edd37 zdtm: A bunch of test for various flavors of unlinked/opened/maped files
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-05 16:18:37 +04:00
Andrey Vagin
084a1f7dea zdtm: setup sigchld handler after starting the test
When a process is started in a new pid namespace, the init process must
colleck zombies.

But before this the init process must waits the root test process, which
returns a status of preparation stage.

Currently these two operation can race, because the both ones call waitpid().

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-04 20:58:23 +04:00