Commit graph

756 commits

Author SHA1 Message Date
Andrei Vagin
11adfc3422 zdtm: check pre-dump of shared memory
[root@fc24 criu]# python test/zdtm.py run -t zdtm/transition/shmem  --pre 3
=== Run 1/1 ================

======================== Run zdtm/transition/shmem in h ========================
cc -g -O2 -Wall -Werror -fno-strict-aliasing  -iquote ../lib/arch/x86/include -I../lib   shmem.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o shmem
Start test
./shmem --pidfile=shmem.pid --outfile=shmem.out
Run criu pre-dump
Run criu pre-dump
Run criu pre-dump
Run criu dump
Run criu restore
Send the 15 signal to  33
Wait for zdtm/transition/shmem(33) to die for 0.100000
Test output: ================================
15:12:25.444:    33: FAIL: shmem.c:70: checksum mismatch: ea71000 109c9000

Cc: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-13 15:51:08 +03:00
Stanislav Kinsburskiy
0bda4caa43 zdtm: add test for shared threads FS structure migration
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-27 17:03:54 +03:00
Tycho Andersen
7a1cdd2661 tests: cgroup02 should use --cgroup-root on dump
To mimic the environment that systemd is in when it causes the problem, we
preserve a prefix cgroup path across checkpoint and restore which the tasks
live below, and then we open a fd to this path. Without
--cgroup-root /prefix on dump, this test fails:

(00.030429)     32: Error (criu/files-reg.c:1487): File home/ubuntu/criu/test/zdtm/static/cgroup02.test/zdtmtst/prefix has bad mode 040600 (expect 040777)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:44 +03:00
Pavel Tikhomirov
1ede31b77e zdtm/cgroup02: fix test using ropts instead of opts
In commit 07d259f365f2 ("cgroup: support --cgroup-root on dump too")
criu starts to understand --cgroup-root option on dump, but our
cgroup02 test in cgroup02.desc file sets these opt to /newroot
unintentionaly, as on dump we don't have /newroot dump fails:

https://ci.openvz.org/job/CRIU/job/CRIU-x86_64/branch/criu-dev/989

======================== Run zdtm/static/cgroup02 in h
=========================
Start test
Test is SUID
./cgroup02 --pidfile=cgroup02.pid --outfile=cgroup02.out
--dirname=cgroup02.test
Run criu dump
=[log]=> dump/zdtm/static/cgroup02/30/1/dump.log
------------------------ grep Error ------------------------
(00.023103) Error (criu/cgroup.c:620): cg: failed walking
/proc/self/fd/10/newroot for empty cgroups: No such file or directory
(00.023129) Error (criu/cr-dump.c:1359): Dump core (pid: 30) failed with
-1
(00.023944) Error (criu/cr-dump.c:1675): Dumping FAILED.
------------------------ ERROR OVER ------------------------

So fix this by using restore-only ropts instead of opts.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:44 +03:00
Tycho Andersen
61227252a9 tests: add a test for memory/devices "specialness"
v2: add cgroup04.hook which removes the cgroups in between, so things are
    actually restored :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:42 +03:00
Eugene Batalov
44c4ef842d test: fix bug with huge PAGE_SIZE in transition/maps008
Before this patch vma sizes were hardcoded and weren't derived
from PAGE_SIZE value.
But all the actions with these vmas are based on PAGE_SIZE value.
That's why maps008 on PowerPC with "huge" PAGE_SIZE of 64k was simply
terminating due to invalid memory access.

This commit sets vma sizes to safe values derived from PAGE_SIZE.
New sizes are enough to perform all the actions test does with vmas.

Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:42 +03:00
Cyrill Gorcunov
eb22658ea4 test: pty01 -- Add custom uid/gid
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:22 +03:00
Dmitry Safonov
a007f53bc1 arm/test: fix printing formats in tests
Fixes:

cow01.c: In function 'parent_check':
../lib/zdtmtst.h:120:11: error: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
  test_msg("FAIL: %s:%d: " format " (errno = %d (%s))\n", \
           ^
cow01.c:287:5: note: in expansion of macro 'fail'
     fail("%s[%#x]: %p is not COW-ed (pagemap of "
     ^~~~
In file included from inotify_system.c:14:0:
inotify_system.c: In function 'read_set':
../lib/zdtmtst.h:117:11: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=form
at=]
  test_msg("ERR: %s:%d: " format " (errno = %d (%s))\n", \
           ^
inotify_system.c:299:3: note: in expansion of macro 'pr_perror'
   pr_perror("read(%d, buf, %lu) Failed, errno=%d",
   ^~~~~~~~~
deleted_dev.c:53:36: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type '__dev_t {aka long long unsigned
 int}' [-Werror=format=]
   test_msg("mode %x want %x, dev %lx want %lx\n",
                                    ^
deleted_dev.c:53:45: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'dev_t {aka long long unsigned i
nt}' [-Werror=format=]
   test_msg("mode %x want %x, dev %lx want %lx\n",
                                             ^
../lib/zdtmtst.h:117:11: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'off64_t {aka long long int
' [-Werror=format=]
  test_msg("ERR: %s:%d: " format " (errno = %d (%s))\n", \
           ^

Nothing really interesting, but printings with right format specifier.

Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:21 +03:00
Dmitry Safonov
0ca79b6d6c arm/test: fix _XOPEN_SOURCE define
It looks like, on arm32 in <features.h>:
  #ifdef  _XOPEN_SOURCE
  # define __USE_XOPEN    1
  # if (_XOPEN_SOURCE - 0) >= 500
  #  define __USE_XOPEN_EXTENDED  1
  /* ... */

And ptsname(), unlockpt(), grantpt() are under:
  #ifdef __USE_XOPEN_EXTENDED
  extern int grantpt (int __fd) __THROW;
  extern int unlockpt (int __fd) __THROW;
  extern char *ptsname (int __fd) __THROW __wur;
  #endif
  /* ... */

Fixes:
pty00.c:50:2: error: implicit declaration of function 'grantpt' [-Werror=implicit-function-declaration]
  grantpt(fdm);
  ^~~~~~~
pty00.c:51:2: error: implicit declaration of function 'unlockpt' [-Werror=implicit-function-declaration]
  unlockpt(fdm);
  ^~~~~~~~
pty00.c:52:14: error: implicit declaration of function 'ptsname' [-Werror=implicit-function-declaration]
  slavename = ptsname(fdm);
              ^~~~~~~
pty00.c:52:12: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
  slavename = ptsname(fdm);
            ^

Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:21 +03:00
Dmitry Safonov
d7f21ac880 tests/arm/compat: don't build maps03 test
Fixes:
maps03.c: In function 'main':
maps03.c:15:32: error: result of '10l << 30' requires 35 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
  mem = (void *)mmap(NULL, (10L << 30), PROT_READ | PROT_WRITE,
                                ^~
maps03.c:22:9: error: result of '4l << 30' requires 34 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
  mem[4L << 30] = 1;
         ^~
maps03.c:23:9: error: result of '8l << 30' requires 35 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
  mem[8L << 30] = 2;
         ^~
maps03.c:30:13: error: result of '4l << 30' requires 34 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
  if (mem[4L << 30] != 1 || mem[8L << 30] != 2) {
             ^~
maps03.c:30:35: error: result of '8l << 30' requires 35 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
  if (mem[4L << 30] != 1 || mem[8L << 30] != 2) {
                                   ^~

Proceses virtual address space is smaller than 4Gb - omit this test for
those archs.

Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:21 +03:00
Andrei Vagin
d43fff4d74 zdtm: remove *.opts files
This files are used by zdtm.sh. zdtm.py uses *.desc files.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:21 +03:00
Eugene Batalov
40a7f3854f test: fix race in transition/maps008 that lead to fail of test
Running test/zdtm.py run -t zdtm/transition/maps008 --snap --pre 30
in a loop I got test failure with "Mem differs"
error each ~20 minutes. The cause of the bug is in lack of
synchronization between processes that still do datagen stage of
test and processes that already do datacheck stage of test.
As a result we can get "Mem differs" error if:
1. Process P1 being on datacheck stage fetches a byte with
   offset X from ashmem vma VMA1 into CPU register.
2. Process P2 still being on datagen stage changes byte with offset X
   in the same ashmem vma VMA1.
3. Process P1 fetches byte with offset X from another ashmem vma VMA2
   mapped to the same physical memory as VMA1.
4. Process P1 compares two fetched bytes and finds out that they
   have different values.
5. Process P1 reports "Mem differs" error.

Race is fixed by waiting for all processes to exit datagen stage
before proceeding to datacheck stage.

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:20 +03:00
Andrei Vagin
42058dc7ce test: don't do MS_REC|MS_PRIVATE for host mounts
Here is a race when someone umounted something and this operation
isn't propagated into our namespace.

CRIU                                | Another process
-----------------------------------------------------------------
pivot_root(".", put_root)           |
mount(put_root, MS_REC|MS_PRIVATE)  |
                                    | umount /xxx/yyy
                                    | umount /xxx -> EBUSY
umount(put_root)

We do this to not affect mounts in put_root, but we can mask
these mounts as slave and this will work for us and for external
users.

Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:20 +03:00
Andrei Vagin
ada6312984 zdtm: don't trigger BUG if futex returns EINTR
It can hapen in tty tests, where we get SIGHUP.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:19 +03:00
Pavel Tikhomirov
54febc11f4 zdtm/ipc_namespace: add msg_next_id, sem_next_id, shm_next_id
as these sysctls can not be set to -1(default) leave them uninitialized
sometimes

https://jira.sw.ru/browse/PSBM-48397
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:19 +03:00
Eugene Batalov
40f56d5dc3 test: add test for anon shmem dedup
Main test features:
- Non trivial ps tree with non trivial anon shmem regions
  (no such test exists now).
- Each ps tree process continuously writes parts of anon shmem
  vmas and validates these writes after restore
  (required for dedup testing).
- Checking simultaneous changing of anon shmem contents in different
  processes.

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:19 +03:00
Andrei Vagin
379215e1f1 zdtm: check a case when a root of sub-mntns is read-only
It's what we have when ReadOnlyDirectories=/ is set for systemd services.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:00:21 +03:00
Dmitry Safonov
df81b884d4 test: add printf-attribute to test_msg
...and fix misprints that weren't caught before.

I guess, I never fixed that much (possible) bugs by one commit, heh.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 18:58:12 +03:00
Egor Gorbunov
5d4cf6269f files-reg: find appropriate dir to create link remap
Currently during criu dump we create link remap in the same dir
where original file was opened. But that dir may not exist during
link remap creation. At the same time it's okay to create link
remap in any dir on the same mount point.
In this patch we do this. We check existance of every dir bottom
up through the original file path. We use the first existing dir.

Similar approach is used on criu restore during ghost file creation.

Signed-off-by: Egor Gorbunov <egor-mailbox@ya.ru>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-11 16:18:44 +03:00
Tycho Andersen
dfe5f4e586 tests: add a test for the case when there is a helper with a zombie child
v2: drop /bin/ps from test deps
v3: wait for the zombie to make sure it exits

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:34 +03:00
Tycho Andersen
d5bee200a1 tests: only wait for the pid we spawned
In the next patch, we'll introduce an option to allow for leaving zombie
processes in the pid ns for the test so that we can test the behavior of
zombies. Let's not reap everything after restore, since we'll reap the
restored zombies as well.

v2: restore the old behavior when in reap mode

CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:34 +03:00
Tycho Andersen
b3c42b28a9 tests: add a ZDTM_NOREAP variable
We'll use this variable in the next test to make sure the test suite
doesn't accidentally reap the zombie we want to leave around for the actual
test.

This is kind of ugly and there might be a better way to pass information to
the test's init, I'm open for suggestions :)

CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:34 +03:00
Pavel Tikhomirov
9803bd2c2d zdtm/ipc_namespace: add msg_default msgsize_default
and move fs.mqueue.xxx from get_shared_memory_info to get_messages_info

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:33 +03:00
Tycho Andersen
96caa4da4a tests: rename deleted_standalone_unix to del_standalone_un
The directory that the tests run in on jenkins is:

/var/lib/jenkins/workspace/CRIU/CRIU-restore-sibling/criu-dev/test/zdtm/static

which makes the whole path too long. This commit makes the whole path:

/var/lib/jenkins/workspace/CRIU/CRIU-restore-sibling/criu-dev/test/zdtm/static/del_standalone_un.test/sock

which is 105 chars, less than 108 of sun_path.

Closes #191

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:32 +03:00
Dmitry Safonov
fe45e3626a make/test: generate .gitignore for tests
It's quite boring to add your test to .gitignore and one may forget
to do that boilerplate -- put this labour on computer.
For that I make real targets for tests instead of implicit and
add test's binary name to .gitignore on make stage.
Also added *.pidns to .gitignore -- do not wanna do this as separate
trivial patch.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00
Dmitry Safonov
3cbde46dba make/test: drop dependencies dead code
static/transition tests are built with implicit rules.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00
Tycho Andersen
0a68b6297c tests: add a (failing) test for standalone unix sockets
v2: open two sockets, one "on top" of the other
v3: also drop unnecessary unlink(), we can just rely on rename()

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00
Kirill Tkhai
f6df5d0789 zdtm: Make file_locks04 test based on /proc/{pid}/fdinfo/{fd}
/proc/locks is racy with adding/removing locks,
so we may lose lock on check.

Use fdinfo's list of locks instead.

v2: Feature 'fdinfo_lock'

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00
Tycho Andersen
7d09451721 tests: expand the list of cgroup devices written
Hopefully this would/will trigger more of these types of bugs; I took this
list straight from Adrian's report.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Adrian Reber <adrian@lisas.de>
Tested-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-09 22:04:26 +03:00
Tycho Andersen
123551cc76 tests: test that multi-line cgroup devices are restored correctly
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-07 13:53:32 +03:00
Eugene Batalov
aaf87286de zdtm: add --link-remap opt to unlink_regular00 test desc
--link-remap opt is obligatory for unlink_regular00 test.
Without it CRIU dump will fail because it won't be able to
create link remaps.

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-07 13:53:32 +03:00
Sebastian Pipping
78ab4a548f Add missing "proto2" syntax marker
.. to address protobuf 3.x proto-c warnings

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-07 12:38:39 +03:00
Tycho Andersen
8db33d9033 tests: don't duplicate mnt_enablefs entry
this avoids:

===================== Run zdtm/static/socket-tcpbuf6 in h ======================
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
Start test
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
./socket-tcpbuf6 --pidfile=socket-tcpbuf6.pid --outfile=socket-tcpbuf6.out
Run criu dump
Run criu restore
Wait for zdtm/static/socket-tcpbuf6 to die for 0.100000
Wait for zdtm/static/socket-tcpbuf6 to die for 0.200000
Removing dump/zdtm/static/socket-tcpbuf6/27
===================== Test zdtm/static/socket-tcpbuf6 PASS =====================

in every test.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-07 12:38:39 +03:00
Andrew Vagin
f25ad84ad1 zdtm: check enabled file systems
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-07 12:38:39 +03:00
Stanislav Kinsburskiy
54a333a0b9 zdtm: add autofs test
1) Support autofs kernel-user exchange protocol
2) Test mounts: direct, indirect, offset (?) (migrated and operational).
3) Test cases, when write end of the pipe is closed, and when it's not.
4) Test catatonic mounts.
5) Test nested mounts are migrated (tmpfs suits it good)

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-07-05 23:18:14 +03:00
Andrew Vagin
1d0fcfa8f7 zdtm: don't run cgroup04 concurrently with other cgroup tests
It uses --manage-cgroup full and can dump and restore cgroup of other tests.

Reported-by: Mr Jenkins
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:15:28 +03:00
Pavel Tikhomirov
d7f9e824d3 zdtm/net/sysctl: add all to test and fix order
1. First save/check all,default,lo together and only after - set them,
as setting some sysctls can affect the others
2. Set "accept_redirects" after "forwarding" both for ipv4 and ipv6
3. Change order to "all", "default", "lo"

*One can not set ipv6.conf.all.stable_secret, so don't even try, see:
commit 622c81d57b39 ("ipv6: generation of stable privacy addresses for
link-local and autoconf")

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:12:26 +03:00
Tycho Andersen
e3b686f864 tests: remove commented out code
An oddity (bug?) means that we don't preserve empty cgroups in in the criu
cgset, since we don't dump it. So we do need to move things into tasks.

(This probably got commented out due to a bug in the Ubuntu kernel that I
ran across [1] which should be fixed shortly :)

[1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1588056

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:12:26 +03:00
Tycho Andersen
c8d79fcbbb tests: cgroup04 needs "full" cgroup mode
Because we're doing this on the same host, the cgroups will already exist.
We need to write the properties in full mode to exercise these cases.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:12:26 +03:00
Andrew Vagin
39e4073daf zdtm/socket_aio: add the nouser flag
======================= Run zdtm/static/socket_aio in h ========================
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
Start test
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
./socket_aio --pidfile=socket_aio.pid --outfile=socket_aio.out
Run criu dump
=[log]=> dump/zdtm/static/socket_aio/24/1/dump.log
------------------------ grep Error ------------------------
(00.003450) Error (util.c:665): exited, status=3
(00.009104) Error (util.c:665): exited, status=3
(00.024564) Error (util.c:665): exited, status=3
(00.024598) Error (netfilter.c:88): Iptables configuration failed: Success
(00.024625) Error (cr-dump.c:1297): Dump files (pid: 24) failed with -1
(00.025117) Error (cr-dump.c:1605): Dumping FAILED.
------------------------ ERROR OVER ------------------------
Wait for zdtm/static/socket_aio to die for 0.100000

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:12:26 +03:00
Andrew Vagin
55de67a7fa zdtm/shm-unaligned: don't overriding recipe for target 'shm-unaligned.pid'
Makefile:305: warning: overriding recipe for target 'shm-unaligned.pid'
Makefile:290: warning: ignoring old recipe for target 'shm-unaligned.pid'
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:40 +03:00
Andrew Vagin
2a835eb8d1 zdtm: remove or replace noauto on crfail where it's possiable
CRIU dump should fail if criu can't handle something.

v2: add a separate patch to remove noauto for a few tests

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:40 +03:00
Andrew Vagin
99c6e840fc zdtm: remove the noauto flags for tests which can be executed
Looks like noauto was set by mistake for these tests

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:40 +03:00
Tycho Andersen
b734cd4003 tests: add a test for cgroup kernel controller props
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:40 +03:00
Cyrill Gorcunov
e47c3684fa test: static, fanotify00 -- Don't compare @s_dev in test
The s_dev as well as mnt_id may change during container
migration, so exclude them from the comparision.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:39 +03:00
Andrew Vagin
f1015e4cdf zdtm/tty*: wait when processes complete a preparation stage
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:09:39 +03:00
Andrew Vagin
51970afa5e zdtm: don't fail if a test changed cwd
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:05:53 +03:00
Andrey Vagin
1cd1da9ca1 zdtm/ptrace_sig: don't print from signal handlers
It can be dead-lokced:
 #0  0x00007fafbf49f6ac in __lll_lock_wait_private () from /lib64/libc.so.6
 #1  0x00007fafbf44af1c in _L_lock_2460 () from /lib64/libc.so.6
 #2  0x00007fafbf44ad57 in __tz_convert () from /lib64/libc.so.6
 #3  0x00000000004022e2 in test_msg (format=0x404508 "Receive signal %d\n") at msg.c:51
 #4  <signal handler called>
 #5  0x00007fafbf3f2483 in __GI__IO_vfscanf () from /lib64/libc.so.6
 #6  0x00007fafbf408f27 in vsscanf () from /lib64/libc.so.6
 #7  0x00007fafbf4032f7 in sscanf () from /lib64/libc.so.6
 #8  0x00007fafbf449ba6 in __tzset_parse_tz () from /lib64/libc.so.6
 #9  0x00007fafbf44c4cb in __tzfile_compute () from /lib64/libc.so.6
 #10 0x00007fafbf44ae17 in __tz_convert () from /lib64/libc.so.6
 #11 0x00000000004022e2 in test_msg (format=format@entry=0x40458c "PASS\n") at msg.c:51
 #12 0x0000000000401ceb in main (argc=<optimized out>, argv=<optimized out>) at ptrace_sig.c:172

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:05:53 +03:00
Laurent Dufour
f6cc277cad test/zdtm : shm-mp fix page size
Test should not assume that page size is 4096.

The test was failing on ppc64 where page size is usually 64K.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-14 11:23:58 +03:00
Pavel Emelyanov
67038451a9 ipc: SysVshmem segment can be unaligned
It's possible to create sysvshmem segment with size not being
multiple of page_size. And this very size will be reported
everywhere in the interfaces.

Support this type of segments too.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2016-06-01 14:52:22 +03:00