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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>