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

1777 Commits

Author SHA1 Message Date
Tycho Andersen
9c39c061ee test: block prctl in seccomp_filter
restore_creds uses prctl, so if we block this call in the seccomp filter
test, it causes things to fail (hang actually, seems we have some unhandled
error path here).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-18 19:54:30 +03:00
Tycho Andersen
267519c9fb test: setuid in seccomp_filter test to have it fail
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-18 19:54:28 +03:00
Andrew Vagin
4ed47b76c6 zdtm: check shared mounts more carefully
We call mount from one namespace and umount from another namespace,
so we check that their parents are from one shared group.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-18 19:52:02 +03:00
Andrew Vagin
b814c75295 zdtm.py: fix comparing files, maps and mounts
Now we save files, maps and mounts for each test process
and we need to compare them separately for each process.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-18 19:27:54 +03:00
Andrew Vagin
57f16168ed zdtm.py: tests should not inherite file descriptors from zdtm.py
Cc: Dmitry Safonov <dsafonov@odin.com>
Reported-by: Dmitry Safonov <dsafonov@odin.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Tested-by: Dmitry Safonov <dsafonov@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-18 16:54:07 +03:00
Dmitry Safonov
d58f6b705e zdtm: Change oom_score_adj score value
... so it can be used from non-root:
(Higher value means it would be killed earlier so everyone should be
possible to change his value to bigger than zero)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:42:17 +03:00
Andrew Vagin
dcd750a64f zdtm.py: bind-mount a test root as slave
In this case it has an external master_id and we want to test that
criu can handle it correctly.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:13:55 +03:00
Andrew Vagin
cba08fb788 makefile: use zdtm.py to execute tests
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:13:31 +03:00
Andrew Vagin
4986d1b51e zdtm.py: compare a set of mounts before and after c/r
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:13:03 +03:00
Andrew Vagin
36216c3c1b zdtm.sh: fix a value of ZDTM_THREAD_BOMB
The thread_bomb test was rewrited and
ZDTM_THREAD_BOMB should be equal 5 now.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:12:32 +03:00
Andrew Vagin
276eb6e823 zdtm.py: don't mix tab and spaces
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:12:07 +03:00
Andrew Vagin
3eac44ae85 zdtm.py: collect fds and maps for all test processes
It works for tests which are executed in a separate pidns

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:11:44 +03:00
Dmitry Safonov
4f68446ddf zdtm: add loginuid restore test
Signed-off-by: Dmitry Safonov <dsafonov@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:09:03 +03:00
Dmitry Safonov
f4216c5305 zdtm: add test for oom_score_adj restore
Signed-off-by: Dmitry Safonov <dsafonov@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:09:01 +03:00
Tycho Andersen
182ed5e811 test: report actual errno on seccomp prctl failure
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-15 15:02:40 +03:00
Pavel Emelyanov
4427a71560 zdtm.py: Add action for cleaning nsroot
When running test in ns/uns flavor zdtm.py builds a temp root in test/ directory.
The new action allows to remove all this stuff automatically.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-15 15:01:16 +03:00
Pavel Emelyanov
bde6d0dbf9 jenkins: No parallelizm for group test
The head test is zdtm/lib/group, so it is impossible to run several
instances of it in parallel

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 17:49:55 +03:00
Pavel Emelyanov
bfcea5623d zdtm.py: Add write perms for all bins in test
This is to make groups test start in uns flavors

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 17:39:05 +03:00
Pavel Emelyanov
ecd789bffa zdtm: Fix compilation after previous commit
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:54:35 +03:00
Pavel Emelyanov
e71d50894d jenkins: Add groups
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:51:18 +03:00
Pavel Emelyanov
fcf2276bf5 freebind: Use different ports
When run in groups ip-freebind and ip-freebind-false fail
to start simultaneously.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:51:08 +03:00
Pavel Emelyanov
9ed3f6f2c7 zdtm.py: Fix deps for group start
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:51:01 +03:00
Cyrill Gorcunov
46b664e11b test: Add inotify02 into the Makefile
Reported-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:49:38 +03:00
Pavel Emelyanov
3825c3e5d4 crit: Speed up jenkins test ~60 times
Running crit tool 4 times per test (decode, encode, decode --pretty
and encode back again) is way too slow. The majority of time, as
it turned out, goes on python load and arguments parsing. The en-
and de-coding works pretty fast.

So doing re-code logic in one python script for ALL images is way
way faster -- ~1 hour vs ~1 minute on my box.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-11 16:36:05 +03:00
Pavel Emelyanov
2d1083303d zdtm.py: Add step-by-step execution
When debugging it's useful to stop zdtm.py at certain points and
check what's going on out there. For this the --sbs (step-by-step)
option is introduced. It will make zdtm.py stop and wait for user
keypress before dump, before restore and after restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
2015-12-10 15:01:31 +03:00
Pavel Emelyanov
bfb98244fe zdtm.py: Print out and strace file names
Generated files are often analyzed after test, so it's handy to have
their full names on the screen at once.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
2015-12-10 15:01:30 +03:00
Pavel Emelyanov
dc3b525cd7 zdtm.py: Print test output on screen when possible
Right now zdtm spawns test into a pseudo-container and redirects its
output in a temp file. This is done not to mix outputs of tests, running
in parallel, with each other.

But if we run tests one by one or there's only one test in the list
we can safely print the output right on the screen.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
2015-12-10 15:01:29 +03:00
Andrey Vagin
b94119b023 zdtm.py: catch KeyError instead of ValueError for sets
In [3]: a
Out[3]: {1, 2, 3}

In [4]: a.remove(5)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-4-af76ca25878a> in <module>()
----> 1 a.remove(5)

KeyError: 5

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-10 15:00:45 +03:00
Andrey Vagin
b6d9bcd10d zdtm.sh: set a type argument for mknod
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-10 14:55:51 +03:00
Andrey Vagin
94d91458c9 zdtm.py: don't worry if uns isn't in run_flavs
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-09 17:03:07 +03:00
Pavel Emelyanov
16dccd5ca2 jenkins: Fix CRIT test to skip non-criu images and provide cumulative output
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 18:21:47 +03:00
Cyrill Gorcunov
2a25092152 test: Add inotify02
Its only purpose if to verify that we can show up
a huge number of inotify in fdoutput (before
the kernel v3.18-rc1-7-ga3816ab we can show
only handles which fit page size in summary).

In particular we revealed that hald daemon makes
up to 35 notification marks which kernel can't
show up in a one pass and dump fails.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:37:07 +03:00
Pavel Emelyanov
7ba43a5521 zdtm.py: Fix zdtm_test._env data type
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:19:25 +03:00
Andrew Vagin
b2b86052bc criu: add the mnt_id feature if a test uses more than one mntns
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:09:26 +03:00
Andrew Vagin
0c9db23f50 zdtm.py: skip the uns flavor if userns isn't suppported
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:09:05 +03:00
Pavel Emelyanov
77f9b7bfbb jenkins: Add test for crit de/encode correctness
The crit tool should decode and encode all images and after
de- and en- sequence the result should be the same as before.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
2015-12-08 15:06:08 +03:00
Pavel Emelyanov
7a5cef1ea2 zdtm.py: Run tests in best flavor
If someone wants to run all tests in any, but the most
difficult for criu, flavor, the 'best' one is introduced.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
2015-12-08 15:05:57 +03:00
Pavel Emelyanov
0ba3b88b4a zdtm.py: Count skipped tests
Currently launcher doesn't know that some tests are skipped
and draws incorrect progress bar :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
2015-12-08 15:05:50 +03:00
Kirill Tkhai
ea747b0755 unix: Add support for restoring receive queue for unix DGRAM sockets
Restore a receive queue in cases of:

1)socketpair with closed second end;
2)peer-less socket, who is a peer for others.

We use here a hack, it is the connect() with AF_UNSPEC family,
which clears peer of restoring socket. See unix_dgram_connect()
for the details.

This also makes socket_close_data test working.

SOCK_STREAM is supported in TCP_ESTABLISHED case in the same
function.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

v2: 1)Add a commentary near connect()
    2)Delete test/zdtm/live/static/socket_close_data.desc
v3: delete ui->ue->peer check
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:02:26 +03:00
Andrew Vagin
515e18e422 zdtm: add mntns_rw_ro_rw to the test list
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 15:01:22 +03:00
Pavel Emelyanov
0b0f40ecf8 zdtm.py: The groups_test class for running groups
So here's the new test class that handles the test from
groups set. The class is inherited from zdtm_test one as
what it does is -- starts the pseudo-init in ns/uns flavors
and asks one to spawn() the sub-tests from the list.

All groups tests can only be run inside ns flavor, so if
the host flavor is asked, just the pseudo-init is spawned.
This is because using ns flavor is the easiest way to spawn
all the sub tests under this init (however, h flavor can be
supported by marking the pseudo-init as sub-reaper).

On stop this pseudo-init is signalled to stop, it in turn
stops all the sub-tests and then exits. When the pid
namespace destruction is complete, the sub-tests .out-s are
checked.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:54:52 +03:00
Pavel Emelyanov
41296aaf88 zdtm.py: Generator of groups of tests
Introduce yet another tests set called 'groups'. Each test
in this set is a list of existing zdtm tests that can be
started side-by-side in an ns flavor.

To 'create' such a test the zdtm.py group action is used,
which lists tests and semi-randomly groups them together.
The grouping possibility is checked by comparing the .desc
files of those -- desc-s should coincide. One exception is
test dependencies, these are just merged together.

After running the group action there appears groups/ dir
with tests each containing just the list of zdtm tests
that are in a group. The respective .desc file is also
generated and this one matches the .desc for tests inside.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:54:41 +03:00
Pavel Emelyanov
23898bf166 zdtm.py: Prepare zdtm_test and flavors for mass test start
This is -- add ability to pull more than one binary into
mntns root and ability to start zdtm test with more stuff
in the environment than generated in start method itself.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:53:47 +03:00
Pavel Emelyanov
b96974825d zdtm: Remove unneeded re-exec
When starting inside ns flavor the test_init() routine prepares
the binary to be run inside namespaces. In particular this routine
fork()-s an init, execve()-s one to pick up mappings and exe from
the new mntns and then fork()-s the test itself. In order to go
back to test_init() for test initialization the execve() is done
again, but it's actually not required and confuses the reader.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:53:19 +03:00
Pavel Emelyanov
b3c8ee1b4f zdtm: Factor out ps showing code
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:53:11 +03:00
Pavel Emelyanov
0ecd6c336a zdtm: Introduce explicit prepare_namespaces() routine
This one is to set up uids for userns, do ip l s lo up for netns
and do the prepare_mntns(). BTW, the latter's code is shifted one
tab left as this is where it should be.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:53:05 +03:00
Kirill Tkhai
70b0e161c9 zdtm: Add socket_close_data01 test
This test is for unix sockets open in DGRAM mode.
Server opens a socket, binds it and waits for a signal.
Client connects to the socket and sends a message.

After the signal server checks that data is readable,
and that it's still possible to connect to the bound
socket.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 14:51:07 +03:00
Pavel Emelyanov
1c75d23cef zdtm.py: Remove no longer needed yaml module
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-04 19:02:25 +03:00
Pavel Emelyanov
12db8a47c3 zdtm.py: Get 'sat' option with .get method
When using non-run command the 'sat' option is not in opts dict,
so it should be checked with softer method.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-03 18:46:25 +03:00
Pavel Emelyanov
327f835d37 zdtm: Mark mountpoints as exclusive
This test does nasty things with the root it runs in, in
particular is kills and creates /dev/null which may result
in /dev/null become 'deleted' for the tests running in
paralles with this. The lattest is critical for uns flavor
as ghost /dev/null will not be re-created (mknod fails).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-03 18:21:48 +03:00