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

1473 Commits

Author SHA1 Message Date
Andrei Vagin
cf72cedd5f Revert "zdtm: use a unix socket instead of a pipe to synchronizer processes"
Unfortunately the kernel wakes up only one waiter even
if they waits with MSG_PEEK, so the introduced scheme doesn't work.

Reported-by: Mr Jenkins
travis-ci: success for Revert "zdtm: use a unix socket instead of a pipe to synchronizer processes"
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-25 10:45:21 +03:00
Andrei Vagin
63e128a968 test: skip pre-dump images in socket-tcp*.hook
These hooks opens inetsk.img, but it doesn't exist if
processes were pre-dumped.

travis-ci: success for test: skip pre-dump images in socket-tcp*.hook
Reported-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
1a89b88c08 zdtm: check sequence numbers for tcp sockets
They have to be the same on each iteration.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
d61c75bc5d zdtm: add test cases on TCP_SYN_SENT
travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
950b33c82e zdtm: add a test for unconnected tcp sockets
Check source and destination addresses for closed tcp sockets.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
7ce065a186 zdmt: add more checks into socket-closed-tcp
Check source and destination addresses for closed tcp sockets.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrey Vagin
16644f731b zdtm: check sockets in the TCP_CLOSING state
TCP_CLOSING both sides have shutdown but we still have
            data we have to finish sending

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrey Vagin
903ed07084 zdtm: add test cases on TCP_CLOSE_WAIT and TCP_LAST_ACK states
TCP_CLOSE_WAIT remote side has shutdown and is waiting for
               us to finish writing our data and to shutdown
               (we have to close() to move on to LAST_ACK)

TCP_LAST_ACK   out side has shutdown after remote has
               shutdown.  There may still be data in our
               buffer that we have to finish sending

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrey Vagin
7c07a7fb4b zdtm: add test cases on TCP_FIN_WAIT* states
TCP_FIN_WAIT1 our side has shutdown, waiting to complete
	  transmission of remaining buffered data

TCP_FIN_WAIT2 all buffered data sent, waiting for remote
	  to shutdown

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Dmitry Safonov
8cae4bdcfa zdtm/test: add infop to waitid()
The man page says, it's not optional argument:
  The application shall ensure that the infop argument
  points to a siginfo_t structure.

Fixes:
Test output: ================================
17:40:26.128:     5: FAIL: helper_zombie_child.c:33: waitid (errno = 14 (Bad address))
17:40:26.128:     4: FAIL: helper_zombie_child.c:78: read (errno = 2 (No such file or directory))
17:40:26.129:     3: ERR: test.c:229: Test exited unexpectedly with code 1

Test output: ================================
15:30:49.021:    30: ERR: sigpending.c:213: waitid (errno = 14 (Bad address))
15:30:49.021:    29: ERR: test.c:229: Test exited unexpectedly with code 1

and etc.

travis-ci: success for 32-bit tests fixes
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:30:06 +03:00
Vitaly Ostrosablin
ae48b5d676 test: add variable delta for poll.c test
For ZDTM purposes, poll.c uses delta of 5 seconds, which is fine, since
tests don't take a very long time to pass. However, in vzt-cpt, we start
a batch with multitude of tests and starting them all could take over an
hour. Hence, the test is bound to fail. An easy solution would be to
introduce an environment variable, which would allow to specify the
delta - ZDTM_DELTA. If it's unset (which is default behaviour in ZDTM) -
it would default to 5 seconds. However, if it's set (what we can do from
vzt-cpt) - then it will use delta which is set by our test.

travis-ci: success for test: add variable delta for poll.c test (rev2)
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:30:06 +03:00
Andrei Vagin
aabeb8e46d zdtm: use a unix socket instead of a pipe to synchronizer processes
A unix socket can be bound to itself, so we need only one socket
instead of a pair of pipe.

If we use a socket, we can peek a message and if it isn't for us
we don't need to send it back.

Currently a process reads message from pipe, if it isn't for him,
it sends it back and sleeps for a random timeout. In a worst case
each waiter will read and send a message back, before the right
one will get it.

travis-ci: success for series starting with [1/3] zdtm: call test_init() before doing anything
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:30:06 +03:00
Andrei Vagin
f5df0adac6 travis: build tests in docker containers
travis-ci: success for series starting with [1/3] zdtm: call test_init() before doing anything
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:30:05 +03:00
Andrei Vagin
4c3068cfca zdtm: call test_init() before doing anything
test_init() has to be executed first, because it prepares a container.

travis-ci: success for series starting with [1/3] zdtm: call test_init() before doing anything
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:29:29 +03:00
Gleb Valin
7a6b96aed7 zdtm: Add test for SOCK_PACKET sockets
This one covers the following cases:
* socket is bound to an interface
* socket isn't bound to an interface

https://github.com/xemul/criu/issues/73
travis-ci: success for series starting with [1/2] socket: Add support for SOCK_PACKET sockets
Signed-off-by: Gleb Valin <the7winds@yandex.ru>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:28:43 +03:00
Vitaly Ostrosablin
b82fc5e07c test: fix shell script tests (conntracks & route_rules)
Test seem to assume that zdtm lib directory is on PATH, but if it's not
- calling for parseargs.sh would fail (if cwd is static). Therefore,
this patch changes this to ../lib/parseargs.sh which should be fine both
for zdtm and vzt-cpt.

travis-ci: success for test: fix shell script tests (conntracks & route_rules)
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:28:43 +03:00
Adrian Reber
9a5ff1a075 zdtm: fix '"makedev" is defined by <sys/sysmacros.h>'
Compiling zdtm on the latest Fedora rawhide gives errors like this:

ns.c: In function ‘prepare_mntns’:
ns.c:122:13: error: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>. [-Werror]
   if (mknod("/dev/ptmx", 0666 | S_IFCHR, makedev(5, 2)) == 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This commit fixes those errors.

travis-ci: success for zdtm: fix '"makedev" is defined by <sys/sysmacros.h>'
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:28:43 +03:00
Andrei Vagin
879d6d1e03 test: check non-root shared mounts
The idea of this test is to check non-root shared mounts
which lives in a few shared groups.

v2: fix the link description.

travis-ci: success for test: check non-root shared mounts (rev2)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-12 18:28:43 +03:00
Andrei Vagin
b84d2b786c zdtm.py: pass a test PID into zdtm hooks
travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 12:37:29 +03:00
Vitaly Ostrosablin
a7faf367a6 test: Fix sockets03 default SIGPIPE handler not being set to IGN
By default, sockets03 doesn't set SIGPIPE handler to SIG_IGN. When run
by zdtm.py, it doesn't cause problem, because it inherits signal
handler. However, when run via vzt-cpt (which uses system() to launch
tests), it receives default handler (which would terminate test). As
result, test is guaranteed to fail, because it will attempt to write to
shutdown receiver and get SIGPIPE in the face.

travis-ci: success for test: Fix sockets03 default SIGPIPE handler not being set to IGN (rev2)
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:03 +03:00
Kirill Tkhai
924a9448c7 zdtm: Add binfmt_misc.hook
A hook to cleanup test temporary files

travis-ci: success for zdtm: Add binfmt_misc.hook
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:03 +03:00
Kirill Tkhai
7cb248ee2c zdtm: Add sock_peercred test
Check that SO_PEERCRED socket options restored correctly.
Now it's not supported, thus test is marked as "noauto".

(It seems support of this feature will require "ghost tasks",
when we introduce them).

travis-ci: success for zdtm: Add sock_peercred test
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:03 +03:00
Andrei Vagin
9c26bae05a fault: check link_remaps if the restore fails at the last moment
link-remap files has to be deleted only if processes have been
restored successfully. Otherwise we can want to repeat an attempt,
but it is imposible if some link-remap files were deleted.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:02 +03:00
Andrei Vagin
f85a04481a test: execute mntns_ghost and mntns_link_remap in userns
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:02 +03:00
Andrei Vagin
ff728932e3 zdtm.py: add a test name into a progress line
Now it is impossible to find when a test has been started,
but sometimes we want to knwo which tests were running in a specified moment.

travis-ci: success for zdtm.py: add a test name into a progress line
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:02 +03:00
Andrei Vagin
db1a0d30b3 zdtm: exit a test if the "root" process died
Each test has a process which controls other processes and
if it dies the other processes have to be killed.

travis-ci: success for zdtm: exit a test if the "root" process died
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:23:02 +03:00
Dmitrii Shcherbakov
1cadd1c3e8 zdtm:mnt_ext_dev: output a message if ZDTM_MNT_EXT_DEV is not set
Should be easier to debug if the variable is not passed by accident.

travis-ci: success for series starting with [1/2] zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
Signed-off-by: Dmitrii Shcherbakov <dshcherbakov@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:23 +03:00
Dmitrii Shcherbakov
99e77674a2 zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
If getenv returns a null pointer we get a segfault here.

Let's exit in a more sane way.

travis-ci: success for series starting with [1/2] zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
Signed-off-by: Dmitrii Shcherbakov <dshcherbakov@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:23 +03:00
Kir Kolyshkin
3c18e39660 test/zdtm: pr_perror() sanitization
Don't append \n as pr_perror() already does it for us.

travis-ci: success for more pr_perror() usage fixes
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:48 +03:00
Kir Kolyshkin
4d1c3f9834 test/zdtm: use pr_err() not pr_perror
In places where we are not supposed to print errno, or where
we already print in explicitly, use pr_err().

travis-ci: success for more pr_perror() usage fixes
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:48 +03:00
Pavel Emelyanov
6e4c1d9f05 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-12-21 11:19:01 +03:00
Andrei Vagin
ccc4456474 zdtm: move a tap header to a first line
org.tap4j.parser.ParserException: Error parsing TAP Stream: Invalid position of TAP Header.
It must be the first element (apart of Comments) in the TAP Stream.

Reported-by: Mr Jenkins
travis-ci: success for zdtm: move a tap header to a first line
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-19 20:58:40 +03:00
Andrei Vagin
7227e2ecc0 test: don't execute cgroup03 with other cgroup tests concurrently
https://github.com/xemul/criu/issues/253
travis-ci: success for test: don't execute cgroup03 with other cgroup tests concurrently
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Dmitry Safonov
6077c3d7f0 zdtm.py: print full pie errors in grep Error omitting line breaks
Before:
=[log]=> dump/zdtm/transition/shmem/142/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
------------------------ ERROR OVER ------------------------

After:
=[log]=> dump/zdtm/transition/shmem/62/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
------------------------ ERROR OVER ------------------------

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
890457ef75 zdtm: add a test to check a mount tree with overmounts
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Yixun Lan
f6c7c0735e include sys/sysmacros.h for minor/major/makedev funcs
Since glibc is moving away from implicitly including sys/sysmacros.h
all the time via sys/types.h, include the header directly in more
places.  This seems to cover most makedev/major/minor usage.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Adrian Reber
3e15360580 zdtm: set cpu.cfs_period_us to 100 during sched_policy00 test
To run the test zdtm/static/sched_policy00
/sys/fs/cgroup/cpu/user.slice/cpu.cfs_period_us needs to be non zero.
This changes it to 100 during the test and resets it to the original
value once the test finishes.

travis-ci: success for zdtm: set cpu.cfs_period_us to 100 during sched_policy00 test
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Cyrill Gorcunov
4a6b286c31 test: rmdir_open -- Delete two levels of directories
One level always been handled properly but
two levels may cause problems.

travis-ci: success for Multiple nested deleted dentries fix
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:26 +03:00
Raghavendra Prabhu
0bfa6a6cc1 Update the xtables deps for netns-test.
In some distros (such as Arch), libxtables_standard is part of iptables
as `/usr/lib/iptables/libxt_standard.so`. With this change, the test passes,
otherwise netns-nf test fails.

Tested with make test.

Signed-off-by: Raghavendra D Prabhu <me@rdprabhu.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:16 +03:00
Kirill Tkhai
d49fac1ab6 criu: Fix open() retval analysing
Negative retval is error, while 0 is OK.

v2: More places

travis-ci: success for criu: Fix open() retval analysing
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00
Mike Rapoport
3ead6f0c6e zdtm: allow --keep-going anytime when running multiple tests
Currently it's possible to continue testing despite failures only when
running zdtm.py with --all option. Let's make --keep-going option also
valid when more than one test is requested with --tests or --from.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00
Adrian Reber
94dfd0ca91 zdtm: print a summary of failed tests if using --keep-going
When using the option --keep-going to get a quick overview of the test
results there is now a summary which tests have failed like:

 ############# 7 TEST(S) FAILED (TOTAL 268/SKIPPED 83) ##############
  * zdtm/static/sched_policy00(unknown)
  * zdtm/static/pthread00(unknown)
  * zdtm/static/pthread01(unknown)
  * zdtm/static/maps01(unknown)
  * zdtm/static/maps00(unknown)
  * zdtm/transition/maps008(unknown)
  * zdtm/transition/shmem(unknown)
 ############################### FAIL ###############################

Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 11:49:19 +03:00
Vitaly Ostrosablin
c64010fe2d test: fix same socket names in socket-{dgram_data, snd_addr}
Those two tests use same socket name and if both of them are run
simultaneously, they would fight for socket and one will get EADDRINUSE.
This patch gives socket_dgram_data an unique name, so that everyone will
be happy.

travis-ci: success for test: fix same socket names in socket-{dgram_data, snd_addr}
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 11:49:19 +03:00
Venkateswara Rao Mandela
a2225308c9 test/others/rpc: fix build error
Build in tests/others/rpc folder was failing due to the use of LDFLAGS
variable instead of LDLIBS variable to link libprotobuf-c. The makefile
uses implicit build rules.

$(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)

Using LDFLAGS places -llibprotobuf-c before the object files, preventing
the library from being searched for required functions.  This commit
changes the variable to LDLIBS instead to fix the issue.

travis-ci: success for test/others/rpc: fix build error
Signed-off-by: Venkateswara Rao Mandela <venkat.mandela@ti.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 11:49:18 +03:00
Pavel Emelyanov
e8d05923e7 zdtm: Add simple test with descriptor in unix socket
https://travis-ci.org/criupatchwork/criu/builds/177945936
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 11:49:18 +03:00
Dmitry Safonov
87cf0cb56e test: combine remap_dead_pid{,_root} tests
1. Dropped check for (fd < 0) - there is check after open() in the
test, just two lines upper or so.
2. Combined two test to share common code: they differ only by proc
path to open in a dead process.

travis-ci: success for pstree: rename lookup_create_{item <=> pid} (rev2)
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-22 16:44:27 +03:00
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