2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-26 20:07:28 +00:00

1777 Commits

Author SHA1 Message Date
Andrei Vagin
9117dd66ad zdtm: fix flake8 warnings
flake8 --config=scripts/flake8.cfg test/zdtm.py
test/zdtm.py:66:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:127:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:971:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:1618:1: E305 expected 2 blank lines after class or function definition, found 1
Makefile:377: recipe for target 'lint' failed

travis-ci: success for zdtm: fix flake8 warnings
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-17 11:33:09 +03:00
Pavel Emelyanov
cde33dcb06 empty-ns: Don't C/R iptables too (v2)
When C/R-ing a net namespace with --empty-ns net option we should also
skip netfilter rules too (as per https://github.com/docker/docker/issues/27597).

However, there's one thing to be handled -- local TCP blocking rules are
expected to be there on restore by restore_iptables() which is no longer
the case, so put them back manually.

Test included, checked on zdtm/static/socket-tcpbuf-local :)

v2: Full scripts for empty netns setup.

https://github.com/xemul/criu/issues/246
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-17 11:05:37 +03:00
Pavel Emelyanov
19ae737cb9 zdtm: Handle --external option in RPC
Travis sets up the GCOV variable to collect coverage and
provides an external mount for this. Thus handling this
option in RPC mode is essential.

travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-12 11:06:00 +03:00
Pavel Emelyanov
65b7d746e3 zdtm: Handle dump/restore error in RPC mode
travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-12 11:06:00 +03:00
Pavel Emelyanov
2e6375416b zdtm: Fix --ext-mount-map to --external
Now the --ext-mount-map is deprecated option, so fix it to
become the --external one.

travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-12 11:06:00 +03:00
Tycho Andersen
d5fc5dbb41 zdtm.py: run --clean hook on test failure
It seems to me most of the clean hooks (used by cgroup*, macvlan* cr_veth*
and mnt_tracefs* were all designed to be run to clean up after the test, no
matter whether it failed or succeeded. Let's always run them, so Andrei
doesn't hate me :D

travis-ci: success for zdtm.py: run --clean hook on test failure
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-12 11:06:00 +03:00
Andrei Vagin
abc8fba67f zdtm: cleanup fifo_loop.test-0*
06:46:44.191:    24: ERR: fifo_loop.c:52: can't make fifo "fifo_loop.test-00" (errno = 17 (File exists))

Reported-by: Mr Jenkins
travis-ci: success for zdtm: cleanup fifo_loop.test-0*
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-12 11:06:00 +03:00
Andrei Vagin
5cb1ce94fe zdtm: check read-only tmpfs in userns
travis-ci: success for Fix a few issues to dump/restore Docker containers with userns
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 20:47:41 +03:00
Andrei Vagin
58c4791d4f net: restore macvlan by the same way with and without userns
If userns_restore_one_link() is called outside of usernsd,
it switches into the criu namespace and switches back before exiting.

v2: rid of the include of linux/net_namespace.h in criu/include/net.h,
    as well as the associated defines and feature checks

travis-ci: success for net: simplify restore of macvlan-s (rev2)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:17:14 +03:00
Andrei Vagin
8837f0eea1 zdtm/cr_veth: use the --clean alias of the cleanup action
travis-ci: success for zdtm/cr_veth: use the --clean alias of the cleanup action
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:16:06 +03:00
Pavel Emelyanov
ee5617640c cr_veth: More debug to EEXISTS failure on travis 2016-11-03 18:16:06 +03:00
Pavel Emelyanov
6bfb3950f1 zdtm: Switch mnt tests onto new opts
travis-ci: success for mnt: Deprecate --ext-mount-map for --external
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:16:05 +03:00
Tycho Andersen
043a9c9020 test: use .pid.inprogress file for macvlan test
Note, this depends on Pavel's patch here:
https://lists.openvz.org/pipermail/criu/2016-October/032499.html which is
not yet applied.

travis-ci: success for test: use .pid.inprogress file for macvlan test (rev2)
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:15:03 +03:00
Pavel Emelyanov
9d417188e2 zdtm: Test --external veth option (v5)
Inspired by Tycho's macvlan test, here's the same thing for
--external veth option. In master we still have the --veth-pair
one, but the plan is to move this all under the --external opt.

v2:
* Travis doesn't have /usr/bin/sed
* Added .checkskip hook for older environments

v3:
* Delete bridge hanging around after previous flavor
* Wait for host veth end to die after dump

v4:
* Get the pid of task to move veth into from .pid.inprogress file

v5:
* Wait for host veth end to die after test stop too :\

Travised-by: https://travis-ci.org/xemul/criu/builds/170726663
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:15:03 +03:00
Tycho Andersen
a25d6c7f99 tests: add a test for macvlan
Note that this test doesn't run in uns mode, even though we have support
for that. Without a full container engine, I couldn't think of a nice way
to pass a macvlan device into the zdtm "container" when in UNS mode.

v2: use the nsid_manip feature flag

travis-ci: success for series starting with [v10,01/11] net: pass the struct nlattrs to dump() functions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:15:02 +03:00
Pavel Emelyanov
36343f196b unix: Test the --external instead of --ext-unix-sk
The latter option should hide, the official API is the --external.
This patch tests the option, thus completing the deprecation.

The legacy -x|--ext-unix-sk test is still in zdtm/static/socket-ext.

travis-ci: success for unix: Test the --external instead of --ext-unix-sk
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 18:14:16 +03:00
Pavel Emelyanov
3e455dad73 zdtm: Use have older --ext-mount-map options in test
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 07:19:59 +03:00
Pavel Emelyanov
7b30c78fcf zdtm: Test for manual ext-mount-map option
The same as for --ext-mount-map auto, but with manual key:val
setting in .desc file.

travis-ci: success for mnt: Deprecate --ext-mount-map for --external
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-03 01:32:55 +03:00
Pavel Emelyanov
ba5919282c zdtm: Split long .desc lines
Done with python pprint module (indent = 4, width = 80)
for files with more than one field in and with length
exceeding 80 characters.

Travised-by: https://travis-ci.org/xemul/criu/jobs/171350152
travis-ci: success for zdtm: Split long .desc lines
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Kirill Tkhai
49baebf935 test: Add debian dependency at netns-nf.desc
Make Debian great again!

Travis: https://travis-ci.org/criupatchwork/criu/builds/171342703
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Andrey Vagin
d339e8f3e1 zdtm: Clean *.state files for per-test cleanout too
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Tycho Andersen
980f4e8d8c test: make write_pidfile atomic
This is useful so that hooks can do a $(cat $pidfile) or [ -f $pidfile ]
and rely on the result.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
It-makes-sence-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Pavel Emelyanov
27a481c888 zdtm: Write .inprogress pidfile
This one will contain pid of the task living in a sub-ns and
waiting for the rest of the test to get daemonized.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Travised-by: https://travis-ci.org/xemul/criu/builds/170726663
2016-11-02 20:35:57 +03:00
Laurent Dufour
f23f8ef8bf test/zdtm: fix netns-nf dependency on ppc64
On Ubuntu ppc64le, the libxt_standard.so is installed under a
different path.
Adding this path to the dependency list to make the test running on
ppc64le.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:57 +03:00
Tycho Andersen
124fd587b6 test: add a --post-start hook
This hook runs after the test is started, in parallel with the actual test.
This can be used in case the test and the host need to coordinate somehow
in order to set something up (e.g. for a macvlan interface).

travis-ci: success for series starting with [v10,01/11] net: pass the struct nlattrs to dump() functions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:16 +03:00
Tycho Andersen
6178668e6a test: robustify mnt_tracefs test
* make sure that tracefs is actually loaded, and try and access it after
  restore
* don't mount debugfs in /, leaving an ugly directory in /test
* clean up the debugfs mount point (with a hook, since the test can't
  unmount it due to perms)

travis-ci: success for test: robustify mnt_tracefs test
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
391bdbe44f zdtm/grow_map: fix test failure for clang
When this code is compiled by clang, it optimizes two byte writes into
one word write, like this:

>        fake_grow_down[0] = 'c';
>        *(fake_grow_down - 1) = 'b';
> 401b60:       66 41 c7 46 ff 62 63    movw   $0x6362,-0x1(%r14)

This is incorrect, as the stack is supposed to grow page by page,
so we need to touch one page then another, i.e. the order is important.

To fix, let's use volatile pointer. After this change, the following
(correct) code is generated:

>        *p-- = 'c';
>   401b60:       41 c6 06 63             movb   $0x63,(%r14)
>        *p = 'b';
>   401b64:       41 c6 46 ff 62          movb   $0x62,-0x1(%r14)

[v2: same fix for another similar place]

Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
f18fce45a2 maps007 test: fix for clang
CLang doesn't like explicit NULL pointer dereference:
> maps007.c:176:2: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
>         *((int *) 0) = 0;
>         ^~~~~~~~~~~~
> maps007.c:176:2: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
>

Apparently, we need to add volatile to make it happy.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
2ac1cc67a5 cmdlinenv00 test: fix for clang
clang complains:
> cmdlinenv00.c:35:11: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>                 if (ret < 0) {
>                     ~~~ ^ ~

The fix is to use ssize_t not size_t.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
2479c25d32 apparmor test: fix for clang
clang complains:
> apparmor.c:86:20: error: too many arguments in call to 'checkprofile' [-Werror]
>         if (checkprofile(0) == 0)
>             ~~~~~~~~~~~~  ^

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
514ca4e93b rtc.c test: fix for clang
clang complains:
> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   rtc.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o rtc
> rtc.c:50:7: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
>                 if (labs(delta - 1000000 / TEST_HZ ) > 100000) {
>                     ^

Declare delta as long.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:15 +03:00
Kir Kolyshkin
21c4675304 groups.c test: fix for clang
clang complains:
> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   groups.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o groups
> groups.c:22:9: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>         if (ng < 0) {
>             ~~ ^ ~

Declare ng as int.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
Kir Kolyshkin
4be8daa153 vdso01 test: fix for clang
clang complains:
> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   vdso01.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -lrt -o vdso01
> vdso01.c:305:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value
>       [-Werror,-Wabsolute-value]
>         if (abs(ts1.tv_sec - ts2.tv_sec) > TIME_DELTA_SEC) {
>             ^
> vdso01.c:305:6: note: use function 'labs' instead

Let's use labs() indeed.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
Kir Kolyshkin
fe21d145de inotify_system tests: fix for clang
When compiling with clang, it complains like this:

> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   inotify_system.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -o inotify_system
> inotify_system.c:323:50: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>         if ((common_desc.inot < 0) || (common_desc.file < 0) || \
>                                        ~~~~~~~~~~~~~~~~ ^ ~
> inotify_system.c:324:21: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>                         (common_desc.dir < 0) || (common_desc.link < 0)) {
>                          ~~~~~~~~~~~~~~~ ^ ~
> inotify_system.c:324:47: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
>                         (common_desc.dir < 0) || (common_desc.link < 0)) {
>                                                   ~~~~~~~~~~~~~~~~ ^ ~
> 3 errors generated.

Indeed these fields are uint32_t. As they are used to store the results of
inotify_init() and inotify_add_watch() function calls, the type should be int.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
Kir Kolyshkin
8f9c6ff529 fpu00 test: fix for clang
clang complains a number of times on our inline asm code, like this:

> fpu00.c:13:6: error: ambiguous instructions require an explicit suffix
> (could be 'flds', 'fldl', or 'fldt')
>                           "fld  %0\n"
>                           ^
> <inline asm>:1:2: note: instantiated into assembly here
>         fld     -4(%rsp)
>         ^

As floats are used, the suffix should be 's' ("short", 32-bit, float).

Add it where needed.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
Kir Kolyshkin
a95939c089 zombie00 test: fix for clang
CLang doesn't like explicit NULL pointer dereference:

> zombie00.c:52:5: error: indirection of non-volatile null pointer will be
> deleted, not trap [-Werror,-Wnull-dereference]
>                                 *(int *)NULL = 0;
>                                 ^~~~~~~~~~~~
> zombie00.c:52:5: note: consider using __builtin_trap() or qualifying
> pointer with 'volatile'
> 1 error generated.

Apparently, we need to add volatile to make it happy.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
Kir Kolyshkin
3c75cf5198 zdtm: compile fix for clang
clang complains about an unused function:

> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
> -iquote ./arch/x86/include  -c -o parseargs.o parseargs.c
> parseargs.c:12:1: error: unused function '__check_help'
> [-Werror,-Wunused-function]
> TEST_OPTION(help, bool, "print help message and exit", 0);
> ^
> ./zdtmtst.h:71:2: note: expanded from macro 'TEST_OPTION'
>         param_check_##type(name, &(name));
> \
>         ^
> <scratch space>:46:1: note: expanded from here
> param_check_bool
> ^
> ./zdtmtst.h:84:35: note: expanded from macro 'param_check_bool'
> #define param_check_bool(name, p) __param_check(name, p, int)
>                                   ^
> ./zdtmtst.h:78:22: note: expanded from macro '__param_check'
>         static inline type *__check_##name(void) { return(p); }
>                             ^
> <scratch space>:47:1: note: expanded from here
> __check_help
> ^
> 1 error generated.
> <builtin>: recipe for target 'parseargs.o' failed

As far as I can tell, the functions __check_##name are generated in
order to check the argument type by the compiler.

For gcc, the "inline" keyword is enough to suppress the "unused function"
warning even when -Wunused-function is used. For clang, it's not the
case (see https://llvm.org/bugs/show_bug.cgi?id=22712).

A way to "use" the function is to use its name as a pointer and cast it
to void. This is what this patch does.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-24 16:00:14 +03:00
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
Tycho Andersen
f3e412f900 python lib: rename rpc.py to rpc_pb2.py
Unfortunately, newer versions of protobuf check that the file suffix ends
in _pb2.py:

sudo ./zdtm.py run -t zdtm/static/apparmor_stacking
Traceback (most recent call last):
  File "./zdtm.py", line 23, in <module>
    import criu as crpc
  File "/home/ubuntu/criu/test/criu.py", line 12, in <module>
    import rpc
  File "/home/ubuntu/criu/test/rpc.py", line 36, in <module>
    type=None),
  File "/usr/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 652, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors should not be created directly, but only retrieved from their parent.

v2: fix up the clean target, and remove some comments that were about the
    old rename

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-10 12:49:28 +03:00
Kir Kolyshkin
c42f6ce2e6 test/Makefile: rm bad code
The 'umount2: umount2' doesn't make sense as it's a circular dependency.
It came from commit e7b152fd and probably meant to say
"umount2: umount2.c" instead.

But it's not needed either as make has implicit rules like that.

Drop the "zdtm_ct: zdtm_ct.c" for same reason.

travis-ci: success for test/Makefile: rm bad code
Cc: Andrei Vagin <avagin@openvz.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-10 12:48:20 +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
Andrei Vagin
2dc2d8c56f zdtm: add a program to umount a test root
This program doesn't parse /etc/fstab or /etc/mtab,
it just calls the umount2 syscall.

It is another attempt to fix the error:
subprocess.CalledProcessError: Command '['mount', '--make-private', '/tmp/criu-root-C7MZS9']' returned non-zero exit status 1
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-C7MZS9'

Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:40 +03:00
Andrew Vagin
3b366c3141 zdtm: check "criu dedup"
Add a new option to zdtm.py to run "criu dedup" after "criu dump"
or "criu pre-dump".

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:40 +03:00
Pavel Emelyanov
2076a16031 zdtmpy: Fix flake8 warnings
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:24 +03:00
Andrei Vagin
7df7d9bb67 zdtm.py: call clean_tests_root() from one process only
An atexit hook is executed for forked processes too,
clean_tests_root() has to be called only once.

v2: fix flak8 warnings
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:24 +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