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
c30c6e38fe tests: add a test for cgroup perms/global props
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-27 16:45:30 +03:00
Tycho Andersen
5dc64eb61f gitignore: ignore some more generated testcases
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-21 16:14:26 +03:00
Kirill Tkhai
2f80e54cd9 zdtm: Add suid flag to binfmt_misc test
This fixes the following test error:

    FAIL: binfmt_misc.c:111: mount failed (errno = 1 (Operation not permitted))

CRIU tests (./test/zdtm.py run -a) passed.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-20 15:33:25 +03:00
Kirill Tkhai
bd27328b7d zdtm: Add binfmt_misc test
Generate random binfmt_misc entries of different types
and check that they remain registered after the signal.

v2: pr_perror() in cleanup, .desc file and TST_DIR in Makefile

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-20 11:04:47 +03:00
Laurent Dufour
406edb007b zdtm/test: Fix live/static/netns-nf dependency
This test calls iptables to set a new packet filter using a shared
library libxt_standard.so. Unfortunately, depending on the
distribution we are running on, this shared library may be stored on a
different place.

This patch allows this test to be run on Debian like systems.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-18 21:10:35 +03:00
Laurent Dufour
6b13731d02 zdtm.py: Add optional dependency support
Depending on the distribution, binaries or shared libraries a test is
dependent of may not be stored at the same place.

This patch introduces the ability to define option in the dependency
list, by separating the optional target names by a '|' character.

For instance the dependency of test may be described this way:
{'flavor': 'ns', 'deps': [ '/bin/foo|/usr/bin/foo' ], 'flags': 'suid'}

Note, there shouldn't be any spaces around the '|'.

If none of the optional dependency is satisfied, an error is raised.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-18 21:10:31 +03:00
Laurent Dufour
40184b9797 zdtm: Use /usr/bin/diff instead of /bin/diff
The descriptor for test netns-nf and netns are referencing /bin/diff.
On Fedora this is a hard link to /usr/bin/diff created during the
install of the package diffutils. However this hard link doesn't exist
on Debian like systems.

Referencing /usr/bin/diff works in both cases.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-18 21:05:51 +03:00
Tycho Andersen
c89fecfd6c remap: fix dead pid remap of /proc/<pid>
It turns out we can't just test for /proc/<pid>, because the kernel appends
(deleted), since the directory is actually deleted (vs. something like
/proc/1/mountinfo, where the file still exists in the unlinked directory,
so there is no (deleted)). See comment for details.

v2: s/ret/is_dead in /proc/<pid>/xxx test, split tests to correctly test
    both cases

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-18 20:53:30 +03:00
Andrew Vagin
ec8db4cb6c test/session00: close a signal pipe in all processes
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 20:01:29 +03:00
Pavel Emelyanov
d2183bb3eb fix compilation after previous commit
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 17:01:38 +03:00
Andrew Vagin
9c327c3128 zdtm/chroot: wait when a child closes a descriptor
A static test should not change its state during C/R.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 16:20:48 +03:00
Andrew Vagin
4ea3acb03c zdtm/session00: wait when a child closes fd
A static test should not change its state during C/R

===================== Run zdtm/live/static/session00 in ns =====================
Start test
./session00 --pidfile=session00.pid --outfile=session00.out
Run criu dump
Run criu restore
7: Old files lost: set(['4'])
7: New files appeared: set([])
############# Test zdtm/live/static/session00 FAIL at fds compare ##############

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 16:12:47 +03:00
Vijaya Kumar K
db0cc36417 zdtm: Correct syscall numbers for fanotify00 testcase
Define correct syscall numbers for fanotify_init
and fanotify_mark for arm64.

Signed-off-by: Vijaya Kumar K <vijayak@caviumnetworks.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 15:51:03 +03:00
Vijaya Kumar K
8a7c006bdd define macro for stack alignment
Replace stack alignment magic constant with
__stack_aligned__ macro.
Also align stack for sigaltstack test case.

Signed-off-by: Vijaya Kumar K <vijayak@caviumnetworks.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-01-13 15:50:42 +03:00
Pavel Emelyanov
0e891b3b0d zdtm.py: Force per-test logs if report is requested
Otherwise non-parallel jenkins jobs miss the error logs in e-mails

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-30 17:06:27 +03:00
Vijaya Kumar K
6aede7f18b zdtm: Align stack pointer for arm64
arm64 requires stack pointer to be aligned to 16 bytes.
Update all test cases that are using clone system call
to have 16 byte aligned stack pointer.

Signed-off-by: Vijaya Kumar K <vijayak@caviumnetworks.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-29 14:53:28 +03:00
Andrew Vagin
98cc46fc13 test: add a new test to check external terminals
It's an example how it can be used

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-29 14:48:47 +03:00
Andrew Vagin
df0be41e05 zdtm: add a new test to check inherited tty-s
v2: set a control terminal
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-29 14:48:36 +03:00
Andrew Vagin
5d75e1f4cf jenkins: add a script to check inherit file descriptors
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-29 14:45:13 +03:00
Andrew Vagin
9dc7155b73 zdtm.py: unfreeze test processes before killing them
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-28 13:11:28 +03:00
Dmitry Safonov
d63c2bbff0 cr-check: add logiuid feature
Loginuid tests should run only when kdat.has_loginuid set.
This is for > 3.13 kernels with CONFIG_AUDITSYSCALL enabled.

Signed-off-by: Dmitry Safonov <dsafonov@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-28 13:09:16 +03:00
Pavel Emelyanov
afc11b6a6c zdtm.py: When no logs, do not add them to report
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 14:47:24 +03:00
Pavel Emelyanov
517c0988e1 zdtm.py: Mark nouser tests as such
Some tests require criu to be root, e.g. tcp tests of unlink-mmaps ones,
so mark those in desc files as such.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
2015-12-24 14:42:44 +03:00
Pavel Emelyanov
b8d92bd4eb jenkins: Add user mode job
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
2015-12-24 14:42:41 +03:00
Pavel Emelyanov
dde2adbc9d zdtm.py: Check how user-mode works
There are several restrictions:

1. Onlu dump is checked (--norst) for now
2. Only host flavor as tests has to start themselves in non-root mode
3. Only non-suid tests
4. TCP doesn't work too, should be manually excluded :\

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
2015-12-24 14:42:37 +03:00
Cyrill Gorcunov
35cb599634 test: different_creds -- Enhance the testing
To test c/r of creds we need more precise way,
so lets add a few additional creds to test.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:30:25 +03:00
Cyrill Gorcunov
e8dd8c63f8 zdtm: Add ARRAY_SIZE into the header
Suitable macro.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:30:06 +03:00
Andrew Vagin
e09f7ea05c zdtm: set the dumpable flag after setuid (v2)
Otherwise we will not able to access /proc/pid/* for the process.

v2: s/__NR_WAIT4/__NR_setresuid

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:29:34 +03:00
Andrew Vagin
7c11b0b914 zdtm.py: don't worry if a test class doesn't have ns() and static()
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:25:06 +03:00
Andrew Vagin
57d73475af test/inhfd: use os.fdopen instead of a home-made class
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:24:36 +03:00
Pavel Tikhomirov
6aaa1a2efc cpt/rst: access and modification time of ghost files
Modification time changes after cpt/rst file_attr test in VZ7CT:
CT-102 criu# cat test/zdtm/live/static/file_attr.out
15:05:05.315:   146: FAIL: file_attr.c:101: modification time has
changed (errno = 11 (Resource temporarily unavailable))

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

v2: add timeval message, test seem to pass now - remove noauto
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 13:24:05 +03:00
Pavel Emelyanov
7f75e74ae7 zdtm_ct: Mount binfmt misc in ct creation
The mountpoints.c test creates such mount and criu will try to
kerndat-check one, so this fs should be on "host".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 17:42:44 +03:00
Pavel Emelyanov
a5c2e8cd86 jenkins: Mount binfmt misc in run_ct
The mountpoints.c test creates such mount and criu will try to
kerndat-check one, so this fs should be on "host".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 17:12:53 +03:00
Andrew Vagin
c3e9140304 jenkins: build criu with debuginfo
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 16:34:27 +03:00
Andrew Vagin
a21ea70df2 zdtm/file_locks04: use test_waitsig() to synchronize child and parent
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 15:50:48 +03:00
Andrew Vagin
bd806a7832 zdtm/fifo_wronly: wait when a child opens a file descriptor
A static test should not change its state during C/R

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 15:49:45 +03:00
Andrew Vagin
64744030f2 zdtm.sh: remove warnings about existent directories
and call mknod with correct argumetns

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-23 15:49:14 +03:00
Pavel Emelyanov
505896e664 zdtm.py: Test how freeze cgroup works (v2)
V2: Fix the test/Makefile

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by:  Andrew Vagin <avagin@virtuozzo.com>
2015-12-23 15:43:37 +03:00
Andrei Vagin
4d90c130d1 zdtm/pstree: check return codes
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 18:20:35 +03:00
Andrei Vagin
bd649cebbf zdtm/pstree: read from a correct file descriptor
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 18:20:23 +03:00
Andrei Vagin
09d00c411e test: wait when a prepartion stage will be completed
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 18:20:15 +03:00
Andrew Vagin
f8550e45d6 pipe00: when while a child is preparing file descriptors
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 15:44:13 +03:00
Andrew Vagin
d35efb4abe zdtm/socket_close_data01: wait a child before c/r
A static test should not change its state during C/R.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 15:14:29 +03:00
Andrew Vagin
2784095aaf zdtm/sigpending: wait a child before C/R
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 15:13:18 +03:00
Andrey Vagin
097d0618c4 zdtm: don't hardcode file names in test soruces
Cc: Kirill Tkhai <ktkhai@odin.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 14:00:29 +03:00
Cyrill Gorcunov
5ac87708a2 test: write_read10 -- Wait for children to create
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 11:05:52 +03:00
Cyrill Gorcunov
2529adceb5 test: write_read_10 -- Fix typo in testing opened file descriptor
Should be @child_fd instead of @fd

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 11:04:24 +03:00
Andrew Vagin
caeb8db5ce zdtm:mntns_open: wait when a child process opens descriptors
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-22 11:04:16 +03:00
Andrew Vagin
7edbcdac86 zdtm/mountpoints: wait when a child process opens descriptors
Otherwise we can see this error:
5: Old files lost: set([])
5: New files appeared: set(['5', '6'])

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-21 15:54:42 +03:00
Andrew Vagin
66468976c4 mountpoints: don't re-create /dev/null
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-21 12:03:39 +03:00