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
50a20dfbdc zdtm: fix race in test_waitsig for multithreaded tests
A signal can be handled by non-leader thread and sigsuspend
will not be woken up.

kill can send signals to a specified thread, so a futex is used for
synchronization.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-06 00:31:14 +04:00
Pavel Emelyanov
fd0d380112 zdtm: Test HUGE mappings to dump/restore OK
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:13:42 +04:00
Andrew Vagin
d767625be9 zdtm.sh: fix the mainstream-kernel tests list
Currently the mainstream-kernel tests list is equal to cr test list.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:26:54 +04:00
Cyrill Gorcunov
7a74043c59 zdtm: Add mmap03 test case
To be able to test it one need indeed enough
physical memory on the node (at least 16G).
Thus I don't include this test for regular
passes.

Inspired by commit 40dcaf885eaf3f2f51d08ecb6c18c3f948655c6e

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:20:23 +04:00
Cyrill Gorcunov
96dd1d22d0 zdtm: Unlink link_remap files once dump complete
In case if only "dump" procedure is invoked we left service
"link_remap.%d" file(s) on disk. This prevents next "dump"
procedure of same test to fail because we hit the situation
where same named "link_remap.%d" already exist.

So, if test is passed with "-d" option we remove the link remap
file at the end.

Also with this patch we start passing --link-remap option
only for tests which have "unlink_" prefix in name. This applies
some limitation on how test could be named, thus maybe we need
more flexible solution here.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:07:16 +04:00
Cyrill Gorcunov
8afd8a4cb2 zdtm: make -- Add -f key on clean* ops
Otherwise if no such files present I'm getting warnings.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 01:40:34 +04:00
Andrey Vagin
ccbbb18ae2 zdtm: check that file permissions are restored for unix sockets
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-30 03:28:09 +04:00
Alexander Kartashov
d9adda7cd1 zdtm: autodetect the target machine v2
Andrew Vagin pointed out that the static testsuite compilation
may run as standalone so the variable ARCH won't be available.

This patch introduces the facility test/zdtm/Makefile.inc
designated to detect the target machine automatically
if the variable ARCH isn't defined. This makefile is supposed
to be included into all test subsuite Makefiles.

Andrew Vagin also pointed out that machine-dependent tests
may be added into non-static subsuites as well so the macro
adding machine-specific headers into CPPFLAGS goes to
the file test/zdtm/Makefile.inc.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 15:16:39 +04:00
Alexander Kartashov
8fa8ca9feb arm: added ARM-specific files modelled after arch/x86
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:53:24 +04:00
Alexander Kartashov
31f9ef8f90 zdtm: moved lib/atomic.h to lib/arch/x86/include/asm/atomic.h
The file lib/atomic.h is the only machine-dependent file in the test suite
that breaks compilation of the test static/session01 on ARM.

The file is moved into a separate directory and the build system is modified
accordingly to prevent this.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:52:00 +04:00
Andrey Vagin
5500145557 test: add ability to execute tests in parallel
All tests which executed in pid namespaces can be executed in parallel.

$ make zdtm_ns
real	0m54.806s
user	0m2.779s
sys	0m4.338s

$ make -j zdtm_ns
real	0m11.587s
user	0m3.361s
sys	0m5.134s

Another feature of this patch is that the subset of parallel tests is
executed before the subset of sequential tests.

If a first subset are not failed, the second one has a small chance to
fail, so a most part of bugs will be found in a few first seconds.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:48:00 +04:00
Andrey Vagin
f35bfe1f7d zdtm.sh: exec cleanout per test
It's required for parallel execution of tests.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:47:58 +04:00
Andrey Vagin
c8484f10ef zdtm: add ablitiy to execute cleanout per test
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:47:56 +04:00
Andrey Vagin
324e432cbb zdtm: get a test file name from arguments
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:18 +04:00
Andrey Vagin
abdaea2421 zdtm: don't hardcode file names
A test should get file names from arguments

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:13 +04:00
Andrey Vagin
cd88cafc37 app-emu/lxc: dump/restore file locks
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:36:38 +04:00
Andrey Vagin
ab2d10c247 zdtm: move file_locks test-cases to the common list
In this case they will be executed in other name-spaces.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:35:08 +04:00
Cyrill Gorcunov
8587f7dec1 zdtm: sched_prio -- Add missing headers
On glibc-2.16 I'm getting

 | sched_prio00.c: In function ‘main’:
 | sched_prio00.c:48:3: error: implicit declaration of function ‘setpriority’ [-Werror=implicit-function-declaration]
 | sched_prio00.c:48:19: error: ‘PRIO_PROCESS’ undeclared (first use in this function)
 | sched_prio00.c:48:19: note: each undeclared identifier is reported only once for each function it appears in
 | sched_prio00.c:60:3: error: implicit declaration of function ‘getpriority’ [-Werror=implicit-function-declaration]

fix it adding headers needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:32:18 +04:00
Qiang Huang
4a70646335 zdtm: add flock file lock's test case
We check shared lock, exclusive lock and mandatory-read lock for flock
file locks. After restore, by parsing /proc/locks file, we check if
the process holds the same file locks as it was dumped.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-17 14:42:50 +04:00
Qiang Huang
a52a66f652 zdtm: add posix file lock's test case
We check read lock and write lock for posix file locks. After restore,
we use fcntl(fd, F_GETLK, &lock), to see if the file is hold the same
lock as it was dumped.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-17 14:42:46 +04:00
Cyrill Gorcunov
c28573fda1 zdtm: fanotify00 -- Make test to check all flags we c/r
Just reading if event entry exist in buffer is not
enough we rathee need to be sure that all flags
and bits are recovered well.

For this sake we parse fdinfo before and after the
c/r sessions and compare results.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-16 18:19:05 +04:00
Cyrill Gorcunov
5730f8173c zdtm: fanotify00 -- Use exit instead of fail until test_daemon call
As Andrew pointed the logically it's more correct to use
err() instead of fail() if test_daemon() has not been
used.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 19:07:04 +04:00
Cyrill Gorcunov
bce18732d7 zdtm: Add fanotify00 test
This one is pretty trivial and need to be extented for
more masks and flags, but fine for now.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:52 +04:00
Andrey Vagin
456884ea8e zdtm.sh: exit with zero in case of success
A bash script exits with code of a last command,
so zdtm.sh return 1 if TMP_TREE is not initialized.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 17:57:45 +04:00
Andrey Vagin
64706655b6 zdtm: check SO_REUSEADDR is restored
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 18:47:26 +04:00
Alexander Kartashov
effe3294d9 zdtm: added target architecture checks into FPU tests
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 18:27:52 +04:00
Andrey Vagin
8018063933 zdtm.sh: execute all zdtm test case for a defined commit
This functionality can help to test a patch set:
for i in `git rev-list HEAD~15..HEAD`; do
	./test/zdtm.sh -c $i || break;
done

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:34 +04:00
Andrey Vagin
a19cf2be41 zdtm.sh: use another directory for a temporary crtools tree
It's more convinient for a few reasons
* don't need to recompile sources for each test case
* don't change the current tree

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:18 +04:00
Andrey Vagin
07f5c3fecf zdtm: compile a test before constructing a new root
A binary is required to get shared library dependencies

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:05 +04:00
Andrey Vagin
fb14f5d118 zdtm: remove mentions of test_init
test_init was removed a long ago

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:00 +04:00
Andrey Vagin
e513535b14 zdtm.sh: fix absolute path to crtools
zdtm.sh launched by an absolute path exits with an error due to
an incorrect path to crtools

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:51:54 +04:00
Andrey Vagin
b9645bb5ec zdtm: test shared file tables
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:55:36 +04:00
Andrey Vagin
0edb637463 zdtm.sh: detect unrecognized options
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 16:51:49 +04:00
Andrey Vagin
49a89764e1 zdtm: add an error message if crtools is absent
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 16:51:41 +04:00
Andrey Vagin
46c6b791a8 zdtm.sh: check backward compatibility
zdtm.sh -b <commit>
* save a current head, rollback on <commit> and compile crtools
* execute a test and dump its processes
* checkout the current head and comple crtools
* restore test processes and check results

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 11:34:03 +04:00
Alexander Kartashov
0fd2d39230 Test suite: added support for the Debian distribution.
* Replaced the shell interpreter with bash to run
  the script test/zdtm.sh correctly.

* Added new directories into the routine contruct_root()
  searched by the Debian version of the dynamic linker.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-10 20:12:44 +04:00
Pavel Emelyanov
60066f2dbb zdtm: Test that rlimits are c/r-ed
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-10 20:10:00 +04:00
Pavel Emelyanov
d2b3a26b2f zdtm: Don't allocate memory to mprotect with calloc
On my FC17 box calloc calls brk() and the subsequent mprotect(PROT_EXEC)
fails with EACCESS. Using mmap is safer here.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-10 18:40:01 +04:00
Pavel Emelyanov
d703f8260e fs: Support umask dump/restore
This one is bound to task's fs info (with cwd and root)
thus put it in the fs.img file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-10 12:48:31 +03:00
Andrey Vagin
3716fd67c1 zdtm: check only existent capabilities
Kernel started with 3.8-rc1 are not report non-existent caps in
/proc/pid/status, so crtools doesn't dump/restore such caps.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-28 23:47:01 +04:00
Cyrill Gorcunov
a1144f9fd1 zdtm: mountpoints -- Explicitly remove old /dev/null
We should explicitly unlink old /dev/null instance, otherwise
if such device already exist we might hit a problem as

 | (00.002984) 7412 fdinfo 0: pos: 0x               0 flags:           100002/0
 | (00.003015) Dumping path for 0 fd via self 42 [/dev/null]
 | (00.003025) Error (files-reg.c:422): Unaccessible path opened 2049:109720, need 5:10
 | (00.003033) Error (cr-dump.c:1565): Dump files (pid: 7412) failed with -1

Reported-by: Alexander Kartashov <alekskartashov@parallels.com>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-26 20:00:46 +04:00
Cyrill Gorcunov
6089f8c5a5 zdtm: Enable mmx00/sse00/sse20 tests
Since we supprt FPU c/r now we can run
these tests.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-21 17:35:50 +04:00
Cyrill Gorcunov
c7cc08b811 zdtm: Enable fpu01 test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-21 17:35:48 +04:00
Cyrill Gorcunov
ee9277562f zdtm: Add fpu01 test
This test loads ymm0/ymm7 registers and check if after
restore the contents is not changed.

The test requires xsave capability to present on the
test system, thus if we figure out that there is no
suitable cpu provided we skip the test.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-21 17:35:47 +04:00
Cyrill Gorcunov
5e9a65878c zdtm: Enable fpu00 test-case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-21 17:35:46 +04:00
Cyrill Gorcunov
4685b56336 zdtm: Add cpuid.h
The test for fpu transition will require to do
a runtime check for the cpu features it's running
on. For this sake we need to use cpuid. Thus make
it more widely available by providing in the general
header.

The code is adopted from the linux kernel code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-21 17:35:44 +04:00
Cyrill Gorcunov
d9df71dc87 zdtm: Extend inotify00 test to have ghost file used
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-06 11:11:22 +04:00
Konstantin Khlebnikov
c327e175c4 zdtm: cmdlinenv00 -- fix false positive fail on 'auxv' corruption after 32-bit -> 64-bit migration
Content of /proc/$pid/auxv declared as array of long and this file hasn't compat layer.

https://jira.sw.ru/browse/PSBM-16280

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-03 17:40:32 +04:00
Andrey Vagin
1bebe80c14 zdtm: execute tests on non C/R kernel (v2)
* add exclude list. Tests from this list are executed only on C/R kernels
* check that a version of a kernel is greater than 3.7

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 17:45:42 +04:00
Pavel Emelyanov
f43c1c2ade sk: Rework bound-dev dump/restore according to new API
The SO_BINDTODEVICE getter is changed in the kernel (before
official release) to report not index, but name to be in
harmony with setter.

Fix crtools accordingly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-28 20:24:42 +03:00