Commit graph

901 commits

Author SHA1 Message Date
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
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