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

1777 Commits

Author SHA1 Message Date
Andrew Vagin
ae6294f4d2 zdtm: return non-zero code in a error case
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-26 12:11:59 +03:00
Kir Kolyshkin
628a488531 test: fix error messages
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-21 16:00:28 +03:00
Andrew Vagin
7235e9b50d zdtm: replace err() on pr_perror()
There is an another err() in glibc

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-21 14:54:53 +03:00
Andrew Vagin
f54e316eb0 zdtm: don't supply \n for err()
err() adds %m and \n at the end

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-21 14:54:43 +03:00
Andrew Vagin
087b5cd5d9 test/zdtm: print a file name as string
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-21 14:54:02 +03:00
Pavel Emelyanov
35603e51cc zdtm: Handle crfail tests (expected dump failure)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 17:10:22 +04:00
Pavel Emelyanov
896837cea8 zdtm: Do not compare maps and fds for non-static tests
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 15:52:59 +04:00
Pavel Emelyanov
43d78feb3e zdtm: Fix exit code propagation from failed tests
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 15:40:10 +04:00
Pavel Emelyanov
50ad633a9c zdtm: Fix mnt_id feature name in desc files
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 15:28:55 +04:00
Andrew Vagin
be16f4f09b jenkins: use zdtm.py to run criu-sibling
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 13:30:40 +03:00
Pavel Emelyanov
951a1e04f2 zdtm.py: Pass keep_img and fault option to sub-tasks
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-20 13:18:45 +03:00
Pavel Emelyanov
8ce58ec963 zdtm.py: Ability to run tests with faults injected
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:45:40 +03:00
Pavel Emelyanov
c405304fcc zdtm.py: Add inhfd tests for --inherit-fd option
This option cannot be tested using classic zdtm tests as it implies
some data created before restore and passed through criu restore down
to the restored process (descriptor in our case).

So add inhfd_test class that creates such.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:42:01 +03:00
Pavel Emelyanov
5193fa4a96 zdtm.py: Split per-test options into C and R ones
One for checkpoint another for restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:42:00 +03:00
Laurent Dufour
da1be409cc test: rtc don't use hard coded major value
The /dev/rtc device major value may change depending on the
architecture, and kernel release. To ensure the test rtc is working
all the time, we no longer belong on hard coded major value but peek
it from /dev/rtc itself.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:36:52 +03:00
Pavel Emelyanov
450fadb561 zdtm.py: Control whether or not to keep images after test
Tree ways are possible -- always, never and only for tests that failed. The
latter one is the default.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:35:57 +03:00
Pavel Emelyanov
0fdbffa10e zdtm.py: Run tests matching given regexp
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-19 12:35:38 +03:00
Ruslan Kuprieiev
86bb235b5c test: libcriu: switch to using swrk instead of service
As our tests serve as an example for people on how to preferably
use criu, we need to also switch to swrk.

Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-15 14:35:43 +03:00
Andrew Vagin
4c1ffde861 zdtm.py: print separators between tests
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-14 15:58:08 +03:00
Andrew Vagin
ed8a13b70f zdtm: show error messages in a error case
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-14 15:57:31 +03:00
Andrew Vagin
fee9021f5f zdtm: test inotifies in a sub mount namespace
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:14:49 +03:00
Pavel Emelyanov
1a6de2c643 zdtm.py: Support crlib flag for tests
This flag means that there's lib/ directory where a plugin is.
Currently rtc test is such. The wait_pid_die timeout is risen
since this test dies for more than 6 seconds :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:06:27 +03:00
Pavel Emelyanov
388df2a103 zdtm.py: Support tests' hooks
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:06:20 +03:00
Pavel Emelyanov
edc19f139c zdtm.py: Print out file if it exists
Sometimes tests fail before generating .out file, so print its
contents only if it exists.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:06:10 +03:00
Pavel Emelyanov
b84642ff33 zdtm: Tune mountpoints test
I constantly have binfmt_misc off on my set ups :) Looks like this fs is
far from being default for systems, so to make the test work (we plan to
rewrite it anyway) let's make this fs being optional.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:06:04 +03:00
Pavel Emelyanov
bdb549c961 zdtm.py: Allow specifying the test suit description file
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:05:43 +03:00
Pavel Emelyanov
6d5635e360 zdtm.py: Lower zdtm keyword usage
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:05:33 +03:00
Pavel Emelyanov
f698be0a12 zdtm.py: Print tests info when listing them
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:05:28 +03:00
Pavel Emelyanov
9db8bd8cf4 zdtm.py: Rework tests list generation
Hand-made list of tests is not great. As Christopher suggested we can find
all executables in a directory and treat them as tests. This idea is good,
but requires a little bit more trickery.

First, some executables in directory are not tests, e.g. these are per-test
scripts, which should be skipped. Next, not all tests in zdtm can be right
now run in continuous manner (they fail), but we want to run them manually.
To fix that such tests are marked with 'noauto' flag in the description.

So we have the test test descriptor file, which states in which file to
look for tests (executable) and which of them to exclude. Maybe more, can
be added on demand.

And, finally, the per-test description goes in a ${test}.desc file in native
python eval/repr-able format. If the file is absent a default description
is used.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:05:02 +03:00
Pavel Emelyanov
526b7826d1 zdtm.py: Test the --restore-sibling option
The main difficulty here is that restored test becomes zdtm.py's kid
and after killing one we should wait() the test's zombie. W/o the
--restore-sibling test gets restored under existing init and gets
wait()-ed automagically.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:04:17 +03:00
Pavel Emelyanov
206acdf225 zdtm.py: Print criu action in logs
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:04:06 +03:00
Pavel Emelyanov
31944f33d6 zdtm.py: Print "test FAIL" early
In case t.kill() raises an exception (sometimes it can) it becomes unclear
what's going on.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:03:59 +03:00
Pavel Emelyanov
7cbb5e5a37 zdtm.py: Save existing environment for zdtm-in-ct
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:03:53 +03:00
Pavel Emelyanov
0cc628915d zdtm.py: Auto-reap all ns children
When test is run in pseudo-container (--parallel execution) the new namespace's
init is the python script itself. Thus all dying tests get reparent-ed to it and
sit as zombies forever.

Create pseudo-init for such containers ripping all the children.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-12 13:03:41 +03:00
Andrei Vagin
896752471f zdtm: don't exclude ipc and uts namespaces in case of userns
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-07 15:16:50 +03:00
Pavel Emelyanov
6b83934e33 zdtm: Move towards the new generation of criu testing (v3)
A little bit more stuff added :) With these changes I can run the

  zdtm.py run --all -x cgroup -x maps04 -x different_creds -x rtc

To run cgroups tests need to add .hook calls, for maps04 I don't have
enough RAM and disk in my VM (will fix), for different_creds need to
support crfail test option (dump _must_ fail), for rtc -- plugins.

So changes since v2:

1. Added exclusion (-x option)
2. Bugfix in parallel run
3. Fixed NS root permissions
4. Fixed checks for maps before and after dump
5. Fixed thread_bomb launch
6. Print test output
7. Support .checkskip scripts
8. Support features
9. Fixed test list

Andrey, thoughts?

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@openvz.org>
2015-10-07 14:50:53 +03:00
Andrew Vagin
6d52d6ee21 zdtm: check a test result for static/different_creds
CRIU should not affect process states when it can't dump them.

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-05 13:13:21 +03:00
Andrew Vagin
baed9dd946 zdtm: check restoring of sockets in the TCP_CLOSE state
(00.004456) Error (sk-inet.c:188): Name resolved on unconnected socket
(00.004466) Error (cr-dump.c:1255): Dump files (pid: 7944) failed with -1
(00.004680) Error (cr-dump.c:1617): Dumping FAILED.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-28 22:01:36 +03:00
Andrew Vagin
cbf2c22d37 zdtm: show errors from dump logs
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-25 18:17:31 +03:00
Andrew Vagin
bb45f832bf A superblock can be remounted only from the root userns.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-23 18:02:33 +03:00
Andrew Vagin
aab2d1e8fa zdtm: check read-only tempfs mount
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-23 15:34:39 +03:00
Andrew Vagin
459fb8b7da zdtm: don't run file_locks* tests simultaneously
/proc/locks can contains the same locks twice, if someone
releases a lock when we are reading this file.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-21 11:56:38 +03:00
Andrey Vagin
0ee52669ac zdtm: check read-only bind mounts
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-21 11:55:40 +03:00
Andrey Vagin
fa66faec4d zdtm/different_creds: return smth from main()
Reported-by: Mr. Travis
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 15:05:58 +03:00
Laurent Dufour
f9d1bb507e test/ppc64: introduce VSX registers test
This test, specific to the ppc64 architecture, is checking that the content
of the VSX registers is correctly checkpointed and restored.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:29 +03:00
Laurent Dufour
196727d7f9 test: remove powerpc architecture fix
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:28 +03:00
Laurent Dufour
7b5c88f35f zdtm: fpu, mmx and sse tests are x86 specific.
The following tests are failing when run on ppc64 and are designed for
x86 architecture.

Moving them to the x86's test list.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:27 +03:00
Andrew Vagin
a99d47e032 zdtm: use pthread_create to create a thread
If you call clone directly you are responsible for setting up the TLS area yourself.

$ abrt-cli ls  | grep different_creds | wc -l
39
$ gdb -c /var/spool/abrt/ccpp-2015-07-24-10\:21\:14-8014/coredump  different_creds
 Core was generated by `./different_creds --pidfile=different_creds.pid --outfile=different_creds.out'.
 Program terminated with signal SIGILL, Illegal instruction.
 #0  0x00007f86e2d8c7d9 in _dl_x86_64_restore_sse () from /lib64/ld-linux-x86-64.so.2
 Missing separate debuginfos, use: dnf debuginfo-install glibc-2.21-7.fc22.x86_64 libattr-2.4.47-9.fc22.x86_64 libcap-2.24-7.fc22.x86_64
 (gdb) bt
 #0  0x00007f86e2d8c7d9 in _dl_x86_64_restore_sse () from /lib64/ld-linux-x86-64.so.2
 #1  0x00007f86e2d84add in _dl_fixup () from /lib64/ld-linux-x86-64.so.2
 #2  0x00007f86e2d8bbc0 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2
 #3  0x0000000000402da3 in sys_futex (val3=0, uaddr2=0x0, timeout=0x0, val=0, op=0, uaddr=0x6063f0 <sig_received>) at lock.h:29
 #4  futex_wait_while (f=0x6063f0 <sig_received>, v=0) at lock.h:121
 #5  test_waitsig () at test.c:367
 #6  0x0000000000401c4b in main (argc=<optimized out>, argv=0x7ffce16432f8) at different_creds.c:82

Reported-by: Mr Jenkins
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:08:11 +03:00
Andrey Vagin
68923c974b test: a static test should do nothing after test_daemon()
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:03:51 +03:00
Cyrill Gorcunov
a85b54ab54 zdtm: Fix building for @_BSD_SOURCE redefinition
Travis testing engine complained about @_BSD_SOURCE
which is not the case on my build environment.
Anyway lets do a safe thing -- conditional definition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 22:01:00 +03:00