2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00

311 Commits

Author SHA1 Message Date
Adrian Reber
767534f10f Adapt zdtm for python3 compatibility
As python3 imports are working a bit differently the structure of the
imported files needs to change. Instead of having symlinks to criu.py
and rpc_pb2.py which does not match the import structure just create
symlink to ../lib/py (like crit) to make zdtm usable again with the
python3 compatibility.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Andrey Vagin
8d709e67d5 zdtm: don't print one line twice
(00.566486)pie: 1: seccomp: mode 0 on tid 1
(00.566601)pie: 1: Error (criu/pie/restorer.c:460): seccomp: Unexpected tid ->
(00.566601)pie: 1: 1 != 1
(00.566601)pie: 1: 1 != 1
(00.566639)pie: 1: Error (criu/pie/restorer.c:1817): Restorer fail 1

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-17 03:17:04 +03:00
Andrei Vagin
2139c955ed zdtm: handle --tcp-established in the rpc mode
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-14 08:45:49 +03:00
Andrei Vagin
8a85222afe zdtm: create /run in a test root
iptables 1.6.2 fails without /run, because it tries to create
the /run/xtables.lock file

Test output: ================================
Fatal: can't open lock file /run/xtables.lock: No such file or directory
23:29:06.098:     4: ERR: netns-nf.c:21: Can't set input rule (errno = 2 (No such file or directory))
23:29:06.098:     3: ERR: test.c:315: Test exited unexpectedly with code 255

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Andrei Vagin
3d5ee99974 zdtm: always run criu dump with --track-mem if --snaps is set
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Andrey Vagin
6a66b87e12 zdtm: check an exit code of a straced restore
Currently zdtm doesn't detect when restore failed, if it is executed
with strace. With this patch, fake-restore.sh creates a test file, and
zdtm is able to distinguish when restore failed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Andrei Vagin
4960d44129 zdtm.py: fix a logic about determing a test flavor in a error case
The get() method requires a key and now we are using an index. That
will never work correctly as it is now.

Acked-by: Adrian Reber <adrian@lisas.de>
Reported-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Kirill Tkhai
6dd7eaccfa zdtm: Make possible to claim for features list
Currently, one feature is supported. Add possibility
for a test to depend on several features.

v2: Delete excess "if" as suggested by Andrey Vagin.
    Rename variables to decrise patch size.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:44:32 +03:00
Andrei Vagin
d499aeadf6 zdtm: enable lazy migration testing
The --lazy-migrate option allows testing of lazy migration when running ns
or uns flavor.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2018-03-02 21:52:14 +03:00
Andrei Vagin
7f936f3bbb zdtm: fix a lint warning
$ make lint
flake8 --config=scripts/flake8.cfg test/zdtm.py
test/zdtm.py:323:19: F841 local variable 'e' is assigned to but never used

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-03-02 21:52:12 +03:00
Andrei Vagin
901d0de945 zdtm: suppress useless error messages
Start test
./mxcsr --pidfile=mxcsr.pid --outfile=mxcsr.out
Run criu dump
Unable to kill 44: [Errno 3] No such process <--------------- this one
Run criu restore
Run criu dump

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
2018-03-02 21:52:12 +03:00
root
638c14f2ed zdtm: grep errors from page-server.log and lazy-pages.log
This can help to investigate logs from Mr Jenkins.

Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:23 +03:00
Andrei Vagin
008db0cb7a zdtm: run page-server via rpc
v2: typo fix
v3: run criu pre-dump via rpc
v4: don't use status-fd for rpc

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:23 +03:00
Andrei Vagin
cae6262ce9 zdtm: add an option to show criu statistics
v2: defining crit_bin and using it for Popen() // Mike

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Andrei Vagin
5785dbd93d zdtm.py: fix decode_flav()
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:13 +03:00
Andrei Vagin
c9ca83f05a tests: fix lint warnings for zdtm.py
flake8 was updated recently and now it shows a few new warnings:

[root@fc24 criu]# make lint
flake8 --config=scripts/flake8.cfg test/zdtm.py
test/zdtm.py:181:4: E722 do not use bare except'
test/zdtm.py:304:2: E722 do not use bare except'
test/zdtm.py:325:3: E722 do not use bare except'
test/zdtm.py:445:3: E722 do not use bare except'
test/zdtm.py:573:4: E722 do not use bare except'
test/zdtm.py:1369:2: E722 do not use bare except'
test/zdtm.py:1385:3: E722 do not use bare except'
test/zdtm.py:1396:2: E722 do not use bare except'
test/zdtm.py:1420:3: E722 do not use bare except'
test/zdtm.py:1820:2: E741 ambiguous variable name 'l'
make: *** [Makefile:369: lint] Error 1

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:13 +03:00
Andrei Vagin
105765830b zdtm: skip vsyscall vmas for x32 tests
It is known issue that a vsyscall vmas are not unmapped
from x32 processes.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 10:21:45 +03:00
Andrei Vagin
f54acb48f9 zdtm: fix warnings from flake8
test/zdtm.py:1535:30: E711 comparison to None should be 'if cond is not None:'
test/zdtm.py:1538:31: E711 comparison to None should be 'if cond is not None:'
test/zdtm.py:1601:31: E711 comparison to None should be 'if cond is not None:'

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
251b4d06a9 zdtm: report test results in the junit format
We found a good plugin for Jenkins to analize test results,
but it can handle only the junit format.

v2: work without the junit python module
v3: install junit-xml, because zdtm.py is executed
    with the --report option from jenkins scripts.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
d5d41bac19 zdtm: don't use find to get executable files
find: unrecognized: -executable
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Mike Rapoport
1dc55aef45 test/zdtm: do not allow running with --lazy-pages on kernel without uffd
Raise an exception for kernels that do not have userfaultfd. For the
kernels that have userfaultfd but do not provide non-cooperative events
(4.3 - 4.11) just print a warning.

Fixes: #363

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-17 03:27:02 +03:00
Mike Rapoport
eb261b579d zdtm: introduce 'noremotelazy' flag
This allows skipping tests that are not yet run with --remote-lazy-pages,
but can be run with --lazy-pages

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-16 12:29:43 +03:00
Mike Rapoport
a9ea60f8b3 zdtm: check lazy-pages and page-server exit status after test is gone
When running with --lazy-pages or --remote-lazy-pages, the daemons should
run in the background, rather than complete before t.stop() is called.
Many tests try to verify things are ok after test_waitsig() and that's
exactly the place where they access memory and cause page faults.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-16 12:29:43 +03:00
Andrei Vagin
6110ce00a1 zdtm.py: use --status-fd instead of --daemon for lazy stuff
It works faster and allows to check exit codes.

travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:02 +03:00
Andrei Vagin
f75db3cdc9 test: check exit codes for criu criu lazy-pages
travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:02 +03:00
Mike Rapoport
e5b4fcb6cd zdtm.py: postpone waiting for lazy-pages daemon
Currently we are waiting for lazy-pages daemon to finish as a part of
.restore method, which may cause filling test process memory before the
test process resumed it's execution after call to test_waitsig(). In such
case, no page faults occur, but rather all the memory is copied in
handle_remaining_pages method in uffd.c.
Let's move wait(<lazy-pages-pid>,..) after call to test.stop().

travis-ci: success for lazy-pages: add non-#PF events handling
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:02 +03:00
Mike Rapoport
c89a22a8e9 zdtm: simulate lazy migration with page server that can send pages
Lazy migration requires both dumped and restored processes to coexist at
the same time. This breaks some basic assumptions in the zdtm design.
Simulation of lazy migration with the page server allows testing most of
the involved code paths without major intervention into zdtm
infrastructure.

travis-ci: success for lazy-pages: improve testability (rev2)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:02 +03:00
Mike Rapoport
ac6b3b0a1e zdtm: add 'nolazy' flag for tests not compatible with lazy pages
The kernel support for lazy pages (userfaultfd) lacks many important
features which effectively prevents success in certain tests.
Allow skipping such test with somewhat informative message

travis-ci: success for lazy-pages: improve testability (rev2)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:01 +03:00
Pavel Emelyanov
0086dca47d uffdd: Implement --daemon mode
Right now the zdtm.py hacks around core code and waits for
a second for the socket to appear. Let's better make proper
--daemon mode for lazy-pages daemon and pidfile generation.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
b711f89cf4 test: allow lazy-pages tests in namespaces
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Andrew Vagin
f59b45fba2 zdtm: check lazy-pages
Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:32 +03:00
Mike Rapoport
b34efd5591 test/zdtm.py: allow setting test timeout in the test description
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-15 15:24:11 +03:00
Mike Rapoport
5d6392358d test/zdtm.py: ignore UNIX sockets during report creation
When files are added to the report shutil.copytree is unhappy with
lazy-pages.socket. Tell shutil.copytree that it should ignore *.socket.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-15 15:24:10 +03:00
Andrei Vagin
624aa178dc zdtm: don't call Popen() without wait()
We have to collect all zombies

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Andrei Vagin
c0857d2517 zdtm: check /proc/sys/kernel/taint and fail if it is non-zero
We don't want to run tests, if a kernel has a problem. And we want
to know when the taint flag is changed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 09:34:46 +03:00
Pavel Begunkov
70c0b47d44 zdtm: skip 'tcp-close' tests if restore is skipped
'tcp-close' is a option that replaces connected tcp-sockets with
'closed' ones during restoring, therefore it have no sense without
restore stage. Thus let's skip related tests if the 'norst' flag was
specified.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 09:34:46 +03:00
Andrei Vagin
a7281b11fd test: restore ns_last_pid before executing restore in a second time
It is required for cases when we inject a fault in criu restore.
In this case we execute "criu restore" and check that it fails,
then we execute "criu restore" without a fault and check that it passes.

If the first "criu restore" restores only a part of processes,
the second criu can get PID of one of restored processes.

https://github.com/xemul/criu/issues/282
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-10 04:20:37 +03:00
Andrei Vagin
88e5db749c zdtm: print 5 lines before an error
It's very hard to understand an error without a context

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:12:11 +03:00
Adrian Reber
905c4084cf zdtm: print test case summary also if all test cases pass
If using the '--keep-going' option, zdtm prints out an overview how many
tests were run, failed and skipped. This would also be useful to know if
it did not fail. This patch changes the output like this:

 ################## ALL TEST(S) PASSED (TOTAL 297/SKIPPED 36) ###################

or in the case of a failure it is unchanged:

 ################### 2 TEST(S) FAILED (TOTAL 297/SKIPPED 34) ####################
  * zdtm/static/sched_policy00(ns)
  * zdtm/static/cgroup02(h)
 ##################################### FAIL #####################################

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:09:34 +03:00
Adrian Reber
3edd0576f4 zdtm: fix decode_flav()
decode_flav() was doing 'if i in flavors:' where 'i' was an integer but
the keys from the flavors dict are strings 'h', 'ns' and 'uns'.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:09:34 +03:00
Andrey Ryabinin
e23c1d4ed9 zdtm.py: run tests with ASAN_OPTIONS
To run CRIU with ASan we have to use some non-default options:

 - detect_leaks=0 - We have to many leaks for know. Let's disable until fixed.
 - disable_coredump=0 - without this ASan library changes RLIMIT_CORE which
                         break rlmimits00 tests.
 - log_path=asan.log - For some reason default output to stderr sometimes
                        doesn't work in CRIU. So error log will be stored
                        in asan.log.<pid> file instead.

travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy()
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-03-15 09:36:04 +03:00
Andrei Vagin
0d979b2934 zdtm.py: use --status-fd instead --daemon
It works faster and allows to check exit codes.

travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-03-02 00:19:02 +03:00
Cyrill Gorcunov
b56c5f8a82 zdtm: Extend vim settings in zdtm.py
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-02 00:19:02 +03:00
Andrei Vagin
68bfb80a51 test: check exit codes for criu page-server
travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:17 +03:00
Cyrill Gorcunov
fe68441bf4 zdtm.py: Fix eval error if empty desc file provided
If desc is empty we should not try to eval it,
otherwise it would lead to exceptio. So test
for its size as well.

travis-ci: success for zdtm.py: Fix eval error if empty desc file provided
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Andrei Vagin
1a89b88c08 zdtm: check sequence numbers for tcp sockets
They have to be the same on each iteration.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
b84d2b786c zdtm.py: pass a test PID into zdtm hooks
travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 12:37:29 +03:00
Andrei Vagin
ff728932e3 zdtm.py: add a test name into a progress line
Now it is impossible to find when a test has been started,
but sometimes we want to knwo which tests were running in a specified moment.

travis-ci: success for zdtm.py: add a test name into a progress line
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:02 +03:00
Andrei Vagin
ccc4456474 zdtm: move a tap header to a first line
org.tap4j.parser.ParserException: Error parsing TAP Stream: Invalid position of TAP Header.
It must be the first element (apart of Comments) in the TAP Stream.

Reported-by: Mr Jenkins
travis-ci: success for zdtm: move a tap header to a first line
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-19 20:58:40 +03:00
Dmitry Safonov
6077c3d7f0 zdtm.py: print full pie errors in grep Error omitting line breaks
Before:
=[log]=> dump/zdtm/transition/shmem/142/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
------------------------ ERROR OVER ------------------------

After:
=[log]=> dump/zdtm/transition/shmem/62/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
------------------------ ERROR OVER ------------------------

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00