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
Cyrill Gorcunov
eb02c8c1fd test: file_locks -- Use device from mountinfo for BTRFS
BTRFS uses own device numbering scheme so lets do a trick
close one to what we have in CRIU itself -- mangle
device to match mountinfo output.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:36:27 +03:00
Cyrill Gorcunov
954ba48d1d zdtm: Add filesystem specific helpers
In particular we have to find out if we're
running on btrfs filesystem for proper device
number mangling.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:35:59 +03:00
Andrey Vagin
ec31527be1 jenkins: include criu-lib.sh and call prep()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:46:25 +03:00
Andrey Vagin
2971fb187f jenkins: add a script to execute tests on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:43 +03:00
Andrew Vagin
f20dfbdd95 zdtm: skip linux-vdso64.so when a new root is contructed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:12 +03:00
Andrew Vagin
edd552619e zdtm: fix compilation on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:11 +03:00
Cyrill Gorcunov
911bb68283 test: mntns_deleted -- Add bindmount for regular files
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:33:58 +03:00
Andrew Vagin
bee835ebeb zdtm/file_locks01: fix testing devices
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 13:18:28 +03:00
Andrey Vagin
4b0c0c5828 zdtm/file_locks03: don't use pipe for synchronization
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 15:20:36 +03:00
Andrew Vagin
2ce6a6a2af file_locks02: don't use pipe for synchronization
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 13:14:06 +03:00
Andrew Vagin
8189eda7b9 zdtm/file_locks1: compare devices in addition to inodes
You can see two equal inode numbers with differen devices and
it was a reason why the test failed.

4: C: 12491/12495/12496
4: c: 1: POSIX  ADVISORY  WRITE 0 fc:03:12468 0 EOF
4: c: 2: POSIX  ADVISORY  READ  0 fc:03:12421 0 EOF
4: c: 3: POSIX  ADVISORY  WRITE 0 00:14:16285 0 EOF
4: c: 4: FLOCK  MSNFS     READ  4 fc:03:12496 0 EOF
4: c: 5: FLOCK  ADVISORY  WRITE 4 fc:03:12495 0 EOF
4: c: 6: FLOCK  ADVISORY  READ  4 fc:03:12491 0 EOF
4: c: 7: POSIX  ADVISORY  WRITE 0 00:14:16280 0 EOF
4: c: 8: POSIX  ADVISORY  WRITE 0 00:14:12677 0 EOF
4: c: 9: FLOCK  ADVISORY  WRITE 0 00:14:12520 0 EOF
4: c: 10: FLOCK  ADVISORY  WRITE 0 00:14:12495 0 EOF
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:01:40 +03:00
Andrey Vagin
439de67a4b test/rpc: don't use the shell_job option
It isn't required.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:37 +03:00
Andrey Vagin
5075f278f6 test/rpc: don't call criu_resp__free_unpacked for NULL
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:29 +03:00
Andrey Vagin
bba4000c40 test/rpc: import the errno module
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:20 +03:00
Andrey Vagin
31475ffa6d test/rpc: track changes of the criu binary
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:13 +03:00
Andrey Vagin
f837310e13 zdtm/fdt_shared: wait until children finish the preparation stage
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 15:59:59 +03:00
Cyrill Gorcunov
e6e56a6294 test: mount -- Add simple testcase for deleted bindmounts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:25 +03:00
Andrey Vagin
311e927b5c test: execute other tests in a new session
The main reason is to execute tests without a control termnal and avoid
a case when tests try to use the --shell-job options.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:13:47 +03:00
Andrey Vagin
ad80227a37 test/mem-snap: wait util a zdtm test isn't stopped
before checking results.

Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:13:43 +03:00
vkonyashkin
4cf4acc598 criu tests: It's necessary to align data to use MOVAPS command
It 's necessary to align date, because the operand of movaps command
must be aligned on a 16-byte (128-bit version) boundary or a general-protection
exception (#GP) will be generated.

Signed-off-by: vkonyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-13 17:16:02 +03:00
Andrew Vagin
1f97db8a0b other/overlayfs: don't use the shell-job option
Jenkins runs all tests in a new session without a control terminal.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-12 17:23:56 +03:00
Andrew Vagin
8086675625 test/rpc: compile test-c
Fixes: 94928cf85d81 ("test/rpc: include unistd.h")
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-12 10:25:58 +03:00
Andrey Vagin
1676c86d7d zdtm.sh: add ability to use a freezer cgroup
It allows to freeze processes faster

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-10 16:47:53 +03:00
Andrew Vagin
94928cf85d test/rpc: include unistd.h
gcc -c test.c -I ./
test.c: In function ‘recv_resp’:
test.c:18:8: warning: implicit declaration of function ‘read’ [-Wimplicit-function-declaration]
  len = read(socket_fd, buf, MAX_MSG_SIZE);
        ^
test.c: In function ‘send_req’:
test.c:45:6: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  if (write(socket_fd, buf, len)  == -1) {
      ^
test.c: In function ‘main’:
test.c:165:2: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
  close(fd);

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-10 16:38:35 +03:00
Andrey Vagin
e0bc24ec97 zdmt: enable tmpfs tests
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-07 14:42:03 +03:00
Gabriel Guimaraes
aabba6b20c Adding overlay-bug test
This test checks that the OverlayFS fixup for CRIU works correctly
by dumping and restoring a process that has an open file in an
OverlayFS mounted directory. This should work no matter if the
Kernel has the OverlayFS bug or not.

Signed-off-by: Gabriel Guimaraes <gabriellimaguimaraes@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-07 14:31:16 +03:00
Andrey Vagin
231b61d692 zdtm: don't skip userns test cases
Currently we skip all userns tests if "criu check" fails. This code was
written when the "freature" options of criu check didn't exist.

Currently we add userns tests only if "criu check --feature userns" passes.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-05 18:32:57 +03:00
Andrey Vagin
098e3a2f8f zdtm: replace sockets03 on socket_dgram_data
They should do mostly the same, but the first one checks nothing after
c/r.

v2: remove sockets03 from Makefile
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-05 13:44:44 +03:00
Andrey Vagin
bbc2cbc419 zdtm: check that data in unix dgram sockets are restored correctly
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-05 13:44:20 +03:00
Andrey Vagin
6ae3539f4c zdtm: check that a sender address is restored
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-05 13:42:37 +03:00
Andrey Vagin
528cbe3705 zdtm: check one end of socketpair with data (v2)
This test fails currently, because these data are not restored.

v2: remove the test from the execution list.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-05 13:42:28 +03:00
Ruslan Kuprieiev
9d9518b852 gitignore: ignore binaries from test/libcriu
Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-03 17:06:48 +03:00
Artem Kuzmitskiy
d50cd344d0 Add test for dumping\restoring unnamed unix sockets.
* Added test for dumping\restoring of unnamed unix sockets.
  Also test added to test/Makefile. Use make run for launch.

* Cleanup env after call run.sh in test/libcriu.

Signed-off-by: Artem Kuzmitskiy <artem.kuzmitskiy@lge.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-29 17:53:39 +03:00
Cyrill Gorcunov
b925971218 test: Add testing of a unix socket with relative name
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-29 17:44:10 +03:00
Tycho Andersen
03c2a0a632 test: add a test for dgram queue error
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-28 13:53:09 +03:00
Andrey Vagin
430a9be90f zdtm: remove busy loops from seccomp_strict
Don't heat a planet! :)

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-23 15:14:38 +03:00
Andrey Vagin
337c73114f zdtm: add a new test to check escaped charecter in mountinfo
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-21 16:45:43 +03:00
Ruslan Kuprieiev
5551bbb301 test: libcriu: include protobuf dir
We only need a rpc.pb-c.h header.

Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-16 14:30:02 +03:00
Andrey Vagin
686467832f test/pipes: execute two test cases
* reopen a pipe descriptor via /proc/self/fd/X
* give another end of a pipe to "criu restore"

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-15 17:36:11 +03:00
Andrey Vagin
bea8903d38 test/pipes: check that file status flags are restored
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-15 17:36:05 +03:00
Andrey Vagin
9c96c55b7a zdtm: don't include linux/seccomp.h
linux/seccomp.h doesn't use in the different_creds test.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-15 17:34:43 +03:00
Tycho Andersen
e880dbd9b8 test: add test for failing to dump different creds
v2: use the test list instead of the file for telling zdtm.sh the test will
    fail

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-14 14:06:09 +03:00
Tycho Andersen
6e218166b4 test: add support for expecting dump failures
We'll use this in the next patch when testing the creds comparison for
threads.

v2: use an explicit list in zdtm.sh instead of a file in the test dir

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-14 14:06:07 +03:00
Laurent Dufour
b857ca947c test/zdtm: Adding ppc64 support
Adding ppc64le specific parts to run test on this architecture.

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-07-13 14:52:26 +03:00
Laurent Dufour
5a34ae1891 test/zdtm: Fix test_msg massive stack usage
In test_msg() a buffer is allocated on stack to cook the outputed message.
This buffer's size was defined using the PAGE_SIZE constant defined in
zdtmtst.h file.

On some system like ppc64, the page size is large (64K), leading to massive
stack allocation, which may be too large in case of alternate stack like
the one used in the sigaltstack test.

This fix, defines a 2048 characters buffer for test_msg, and expose a
constant to allocate stack accordingly in the sigaltstack test.

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-07-13 14:52:25 +03:00
Laurent Dufour
6f119a22a6 test/zdtm: Fix pagesize issue in PACKET_RX/TX_RING
Calls to setsockopt(PACKET_RX_RING/PACKET_TX_RING) are dependent of the
system's page size.
Using sysconf() page size makes these tests working on ppc64 where page
size is 64K.

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-07-13 14:52:25 +03:00
Laurent Dufour
cf4496beba test/zdtm: Do not use hard coded PAGE_SIZE value
Since the page size may be different from an architecture/a system to
another it should not be hard coded to 4096.

As a consequence, several tests are failing on ppc64 due to a wrong page
size value.

This fix belongs to sysconf to get the current page size.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-13 14:52:23 +03:00
Tycho Andersen
209693d49b don't assume the kernel has CONFIG_SECCOMP
linux/seccomp.h may not be available, and the seccomp mode might not be
listed in /proc/pid/status, so let's not assume those two things are
present.

v2: add a seccomp.h with all the constants we use from linux/seccomp.h
v3: don't do a compile time check for PTRACE_O_SUSPEND_SECCOMP, just let
    ptrace return EINVAL for it; also add a checkskip to skip the
    seccomp_strict test if PTRACE_O_SUSPEND_SECCOMP or linux/seccomp.h
    aren't present.
v4: use criu check --feature instead of checkskip to check whether the
    kernel supports seccomp_suspend

Reported-by: Mr. Jenkins
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-13 14:50:35 +03:00
Tycho Andersen
c03df1ba2d add a test for SECCOMP_MODE_STRICT
Note that we don't add the test into the list of tests to run, because it will
fail without the associated kernel patch.

v2: spin lock until seccomp strict is set on the child

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-24 17:38:33 +03:00
Andrey Vagin
2a0c8db72b proc: mount proc with minimal permissions
Eric wants to restrict permissions for proc mounts in a non-root userns
according with proc mounts in the root userns.

Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Fri May 8 23:49:47 2015 -0500

    mnt: Modify fs_fully_visible to deal with locked ro nodev and atime

    Ignore an existing mount if the locked readonly, nodev or atime
    attributes are less permissive than the desired attributes
    of the new mount.
...

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-19 12:20:15 +03:00