2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

1777 Commits

Author SHA1 Message Date
Andrew Vagin
2fbf267bfe test/libcriu: inlude all required headers
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-11 19:50:48 +03:00
Andrew Vagin
a668833905 zdtm/cgroup02: remove subgroups in the cleanup hook
systemd executes tests in subgroups:
 9679 ?        Ssl    0:41 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war -
[root@jenkins ~]# cat /proc/9679/cgroup
10:net_cls:/
9:hugetlb:/
8:cpuset:/
7:blkio:/system.slice
6:freezer:/
5:cpu,cpuacct:/system.slice
4:devices:/system.slice/jenkins.service
3:perf_event:/
2:memory:/system.slice
1:name=systemd:/system.slice/jenkins.service

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:38:38 +03:00
Andrew Vagin
45bc46ed8f zdtm: don't ignore hook's errors
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:38:31 +03:00
Andrew Vagin
c0970b59c7 zdtm/maps007: send SIGTERM to stop a child process
It's typo fix. SIGTERM generates code dump and it's a reason
why this test fails by timeout sometimes.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-04 12:38:51 +03:00
Andrew Vagin
5e1a8a258e zdtm/ptrace_sic: set types for function arguments
I've updated Mr Jenkins to fc22 and can't compile zdtm tests:
cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../../lib/arch/x86/include -I../../lib   ptrace_sig.c ../../lib/libzdtmtst.a   -o ptrace_sig
ptrace_sig.c: In function ‘child’:
ptrace_sig.c:33:5: error: type of ‘fd’ defaults to ‘int’ [-Werror=implicit-int]
 int child(fd)

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-02 15:23:16 +03:00
Andrey Vagin
5e55b71b93 test/other: save logs in the test directory
If a test fails, we save the criu directory and expect to have
all logs and images there.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-29 15:00:50 +03:00
Andrey Vagin
8cc07f058d zdtm: execute checkskip hooks
The currect version does nothing.

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-19 22:37:35 +03:00
Andrey Vagin
a6e13e1a44 zdtm: execute static/apparmor in CT
Tycho: Also, this makes sense to me now too (it tests the case
       where /sys isn't mounted inside the container, which the
       other patch fixes).

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-05-19 22:36:19 +03:00
Andrew Vagin
d8ee1b7ed2 test/pipes: don't use the shell_job option
It's required to execute the test in Jenkins.
We need to stop using a current terminal. For that we need to
* create a new session
* redirect stdout and stderr in a file.
* close stdin

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-15 00:28:20 +03:00
Andrew Vagin
e02af05469 test/secure: don't use the shell_job option
It's required to execute the test in Jenkins.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 20:20:54 +03:00
Andrew Vagin
5f572e0596 libcriu: don't use the shell_job option
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 12:33:14 +03:00
Andrew Vagin
07816f654b test/rpc: write all files into the build/ directory
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-12 11:28:35 +03:00
Andrew Vagin
8869d3ccc8 test/rpc: don't use shell-job
We want to execute this test in Jenkins.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 16:57:28 +03:00
Tycho Andersen
23426070ec test: fix syntax error in mnt_ext_master
Somehow this got lost in the shuffle, apologies.

CC: Andrew Vagin <avagin@openvz.org>
Reported-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 16:16:45 +03:00
Tycho Andersen
c6e724f61a lsm: add a test for apparmor
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:31:09 +03:00
Tycho Andersen
cf7a73389d test: add checkskip hook
Although there is the skip() macro, this doesn't actually do anything to skip
the test. I looked into adding a test_skip() function in the zdtm lib, but
there didn't seem an easy race-free way to propagate an exit code up to
run_test in zdtm.sh, so we add the checkskip hook for use in the apparmor test
(e.g. when apparmor isn't avialable in the kernel, or is disabled).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:31:06 +03:00
Tycho Andersen
a8b7e53b46 test: add mnt_ext_* tests to zdtm.sh
Note that we should only do the ns specific mounting when we are actually in a
ns test.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:30:12 +03:00
Tycho Andersen
8adbdbb1e6 test: add a test for mounts with external master peers
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:30:01 +03:00
Andrey Vagin
9997856e22 zdtm: check --ext-mount-map auto
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:29:56 +03:00
Andrey Vagin
4120637ffc zdtm: lock can belong to child or parent
Locks created by flock() are associated with an open file description
This means that duplicate file descriptors (created by, for  example,
fork or  dup)  refer  to  the  same  lock.

Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 22:01:24 +03:00
Andrew Vagin
76b4bad1fe test/Makefile: export ZDTM_ARGS
This variable is used from Makefile.zdtm

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 22:00:41 +03:00
Andrew Vagin
a2a0e2f2ed test/rpc: don't use shell-job
We want to execute this test in Jenkins.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 17:51:41 +03:00
Andrew Vagin
fe0afaa787 test/rpc: unlink pidfile at the end
It's required to execute the test a few times

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 17:51:34 +03:00
Andrew Vagin
bc3ee6c50d jenkins: use tmpfs for images in criu-iter
It resuces I/O load.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 17:51:30 +03:00
Andrey Vagin
4834c39d45 jenkins/criu-iter: reduce a number of jobs
maps007 fails due to intensive load

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 15:05:45 +03:00
Andrey Vagin
3785d112c5 test/unix-callback: don't use the --shell-job optios
It isn't required here and Mr Jenkins can't execute this job.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 15:03:23 +03:00
Andrey Vagin
76df748c6c jenkins: use tmpfs for images in criu-sibling
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-27 15:03:22 +03:00
Andrew Vagin
a049768242 test: Fix random jenkins-other tests failures
- ext pipe test should build binar
- criu no longer accepts "extra" empty arguments
- adduser doesn't add more than one same user

All this came unnoticed due to error in tests failure detection
(36a13cbd test: don't ignore errors other other tests)

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 19:21:09 +03:00
Pavel Emelyanov
80d913dc41 test: Run unix-ext test with more debugging
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 19:19:20 +03:00
Andrey Vagin
36a13cbd5a test: don't ignore errors other other tests
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 15:57:18 +03:00
Andrey Vagin
161cb0b1eb zdtm: add a test with a dead thread leader and alive threads
This case is not supported now
[root@avagin-fc19-cr criu]# bash test/zdtm.sh -r static/pthread02
Execute static/pthread02
./pthread02 --pidfile=pthread02.pid --outfile=pthread02.out
Dump 3186
WARNING: pthread02 returned 1 and left running for debug needs
Test: zdtm/live/static/pthread02, Result: FAIL
==================================== ERROR ====================================
Test: zdtm/live/static/pthread02, Namespace:
Dump log   : /root/git/locks/criu/test/dump/static/pthread02/3186/1/dump.log
--------------------------------- grep Error ---------------------------------
(00.033195) Error (cr-dump.c:886): Zombies with threads are not supported
(00.033256) Error (cr-dump.c:1943): Dumping FAILED.
------------------------------------- END -------------------------------------
================================= ERROR OVER =================================

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:31:55 +03:00
Andrey Vagin
cb9b6de396 zdtm: add ability to execute restore with the restore_sibling option
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:30:48 +03:00
Cyrill Gorcunov
58ef9bc4f2 zdtm: make -- Don't fail if symlink already exist
If symlink is present the test run fails with
"already exist" message. Lets make the link
unconditional, this is fine.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-21 16:06:04 +03:00
Cyrill Gorcunov
80a30a2279 test: fpu01 -- Run on x86-64 only
Looks like compiler can't encode wide variants
of memory copying and uses only xmm registers
in 32bit mode. Lets drio i386 from here for
a while.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-21 16:05:28 +03:00
Pavel Tikhomirov
e72ccc1dc6 zdtm: reset file position to the begginning of the file in netns-dev
writing to netdev configuration at non zero offset won't be supported:

```
[  301.431638] netns-dev wrote to accept_local when file position was
not 0! This will not be supported in the future. To silence this
warning, set kernel.sysctl_writes_strict = -1
```

v2: fix compilation

Sorry, please don't consider v1.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@odin.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-14 22:36:43 +03:00
Pavel Emelyanov
2085e078fa test: Add test for ext-mount-map option
It mostly reuses the infrastructure for plugin testing.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-10 18:05:57 +03:00
Pavel Emelyanov
ec5b0d849d test: Rework the ext mount plugin test
The existing set of shell scripts do hard-to-debug things and mess
with the root filesystem. We can make it better.

First, not to play with the system / the process that will be run in
a new mount namespace is statically compiled .c file. And this "init"
does a very simple thing -- waits for SIGTERM and check that the
given filepath contains the given string.

Second, the namespace's root will be some subdir, instead of system
/ bind-mount-ed into a subdir. This makes it easier to keep things
together and makes 100% sure the external bind mount cannot be
accessed by custom path.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-10 18:05:56 +03:00
Pavel Tikhomirov
fbb8b82ea2 zdtm: netns check ipv4 device config preserve while c/r
check it for default/lo, test values for config options are randomly
generated and restricted by rand_limit

changes:
v2: make for all config options, avoid use of "system".
v3: err->fail, run in own set of namespaces, add random,
check not all options.
v4: use all options because test is run in net-namespace,
use ARRAY_SIZE macro
v5: check fscanf and snprintf return values properly

Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
Acked-by:  Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-09 18:59:34 +03:00
Cyrill Gorcunov
79ca3eec37 tty: test -- Add /dev/tty testing into pty00
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-02 20:20:10 +03:00
Cyrill Gorcunov
f42c9b96d6 zdtm: Add /dev/tty into construct_root and prepare_mntns
We will need it for tty testing.

Based-on-patch-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-02 20:20:09 +03:00
Tycho Andersen
204c0771ff use SIGKILL in remap_dead_pid test
For some undiagnosed reason, this test hangs for me when using SIGINT. Since we
always want to kill this process anyway, use SIGKILL instead.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-31 22:09:51 +03:00
Cyrill Gorcunov
6608402c97 zdtm: Don't modify global @errno in test_msg
This is logging routine, lets it not affect the global @errno.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-27 14:06:23 +03:00
Andrey Vagin
019ab4b795 test: check read-only bind-mounts
Here is a real example how it's used.

Cc:  Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-27 14:04:26 +03:00
Andrey Vagin
8329f06145 zdtm: suppress error messages if a cgroup holder exists
mkdir: cannot create directory ‘zdtm.mpAWGL/holder’: File exists

Reported-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-27 14:02:17 +03:00
Cyrill Gorcunov
6d30f4680b test: poll -- Move it out of namespace list
For some reason it returns ENOENT sometime
when run in namespace. Need to figure out
why. Disable it for a while to continue
testing the rest.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-26 14:13:27 +03:00
Andrey Vagin
4988a57981 test: create /etc in a temporary root
inotify_irmap creates files in /etc so it should be able to do
this from userns.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-26 14:12:08 +03:00
Andrey Vagin
81a4d3b2eb test: don't run cow01 in userns
/proc/pid/pagemap is protected by the global CAP_SYS_ADMIN, so
it can't be opened in a non-root userns.

00:34:48.260 Execute ns/user/static/cow01
...
00:34:48.260 12:37:03.951:     4: ERR: cow01.c:87: Unable to open child pagemap file /proc/5/pagemap (errno = 1 (Operation not permitted))

Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-25 17:16:59 +03:00
Cyrill Gorcunov
089e81ac2f zdtm: test -- Add trivial poll() timeout test
The idea is simply make sure that timeour has not been
screwed during c/r cycle.

v2:
  - Drop unneeded early poll() call.
  - Make poll loop in cycle until caller passes c/r cycle.
v3:
  - Use test_go helper
  - Do poll in cycle

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-25 17:13:34 +03:00
Tycho Andersen
109ca471c4 fix error in tests when /bin/sh is not bash
== is a bashism, we should use = for /bin/sh; this prevents output like:

/home/ubuntu/criu/test/post-dump.sh: 3: [: post-dump: unexpected operator
/home/ubuntu/criu/test/post-dump.sh: 3: [: network-unlock: unexpected operator

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-24 11:24:02 +03:00
Andrey Vagin
9cabc3918a test: remove bashism from Makefile
* redirect both stdout and stderr
bash: >& and &>
dash: command > file 2>&1 or command 2>&1 | othercommand

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-24 11:05:26 +03:00