2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-05 00:35:23 +00:00
Commit Graph

2223 Commits

Author SHA1 Message Date
Mitul Karnik
116e3cb649 test: Kill dead code from pipes test
Signed-off-by: Mitul Karnik <mitulkarnik.92@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
fd9fb7d339 socket-tcp-skip-in-flight: Use set_nonblock
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
635db4895a socket-tcp-skip-in-flight: Don't fail on EAGAIN
The server socket is marked as nonblocking, and if the client doesn't
connect, accept() will fail and set errno to EAGAIN (or EWOULDBLOCK).
Instead, use poll to wait for POLLIN event on the file descriptor.

Suggested-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-04-20 20:25:26 -07:00
Pavel Tikhomirov
c77a52ec7f zdtm.py: expect test to fail if crfail flag is set
Suppress the false positive fail in criu-live-migration job:
https://ci.openvz.org/job/CRIU/job/criu-live-migration/job/criu-dev/1796/

[criu]# ./test/zdtm.py run -t zdtm/static/overmounted_file -f uns --lazy-migrate

=== Run 1/1 ================ zdtm/static/overmounted_file
=================== Run zdtm/static/overmounted_file in uns ====================
Start test
Test is SUID
./overmounted_file --pidfile=overmounted_file.pid --outfile=overmounted_file.out --dirname=overmounted_file.test
Run criu dump
Test zdtm/static/overmounted_file FAIL at criu dump exited with 1 ######
Send the 9 signal to  49
Wait for zdtm/static/overmounted_file(49) to die for 0.100000

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Pavel Tikhomirov
f572d1de7e zdtm.py: also check that mount flags are restored correct
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Pavel Tikhomirov
0aef3d975e zdtm: test dumping file on overmounted mount fails
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Pavel Tikhomirov
830d1a1894 zdtm: ghost on readonly fs
Test creates two shared mounts, both are readonly, on each mount we have
a different ghost file. Also let these mounts have different mount
flags. That makes us both test do_new_mount hunk for delaying readonly
and do_bind_mount, as one mount will bind from another on restore.

https://jira.sw.ru/browse/PSBM-82991

v2: minor cleanup

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Mike Rapoport
f487c965d4 zdtm/thp_disable: increase memory size to 2M
Somehow in travis tests the mmap of 8K gets "rounded" down and the actual
VMA starts 4K below the returned address. This causes /proc/pid/smaps
parsing to fail.

Increasing the allocation size to 2M seems to resolve the problem and until
the root cause is identified it looks like a viable workaround.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2019-04-20 20:25:26 -07:00
Mike Rapoport
513ab44ac8 zdtm: add test for prctl(PR_SET_THP_DISABLE)
Verify that enabling / disabling THP with prctl(PR_SET_THP_DISABLE) does
not change VMA flags

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Takashi Iwai
0493724c8e Documentation: Allow to use asciidoctor for formatting man pages
Since asciidoc is based on Phyton 2, we want to move to alternative,
and a promising one is asciidoctor.  This patch allows to use
asciidoctor for formatting man pages instead of asiidoc, by passing
a make option, USE_ASCIIDOCTOR=yes.

Although asciidoctor is almost compatible with asciidoc, it can
produce a man page directly from a text file without XML, which is
more efficiently.  So in asciidoctor mode, we don't require xmlto.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Takashi Iwai
f73e5d181b Documentation: Remove unused a2x check
a2x is never used although its presence is checked mandatorily.
Let's remove this superfluous check and the unused entry.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Kir Kolyshkin
b368e66165 test/others/libcriu/Makefile: fix phony targets
Add run as a phony target. Move .PHONY declarations next to
their targets.

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
1be8269cd0 Avoid unnecessary getpid() calls
getsid(0) and getpgid(0) will return session ID and PGID of
the calling process.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
7cd1cf0b16 test/socket-tcp-skip-in-flight: clean up the test by using the test library
The test library has functions to create tcp sockets.

Cc: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Reviewed-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
8a90bc8302 test/static: Add test for --skip-in-flight
Changes since v1:
- Refactor test case based on Andrei's comments

Changes since v2:
- Use ZDTM_FAMILY instead of AF_INET

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
5c71e3e028 test/inhfd: redirect stdin to /dev/null
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
034fc1424f zdtm.py: cache test messages
Currently, we rely on the fact that nobody else is using random and
parent and child processes will get the same random values.

Now, this test fails on the fedora rawhide. There will be nothing wrong
if we will generate test messages before forking the test process.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Adrian Reber
bada5e1ada Fix RPC configuration file test case
The relevant test case test_rpc_with_configuration_file_overwriting_rpc()
was actually designed around the broken behaviour. It was only working
if a previous configuration file (set via environment variable in this
case) and the RPC configuration file have the same name. The test case
which tests that RPC configuration file settings are overwriting direct
RPC settings now makes sure that no other configuration file is set via
the environment variable. If it would be set, the test case would still
succeed, even with the previous patch applied. Which is and which was the
correct behaviour.

So the main reason for this change is to test the more likely use case
that the environment based configuration file and the RPC configuration
file have different names.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Mike Rapoport
73d553f316 test: lazy-migration: don't try to run pre-dump with --lazy-pages
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Mike Rapoport
738d081def test/jenkins: actually test lazy migration
The criu-lazy-migration.sh was copied from criu-lazy-pages.sh and was not
updated enough to actually run zdtm.py with --lazy-migrate.

Fix it.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Cyrill Gorcunov
c2a74d661d test: inet, raw -- Storm the test with all protos
Raw sockets may carry any protocol they want so
lets try them out.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
2e9490f1c2 Remove unused #include <dirent.h>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
1bdfa1caac Replace references to MAP_ANON with MAP_ANONYMOUS
MAP_ANON has been deprecated, use MAP_ANONYMOUS instead.

https://lkml.org/lkml/2007/2/3/55

Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
02018f01f1 travis: switch to the Ubuntu Xenial
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
bc522bcc94 test/socket-tcp: run iptables with -w
Start test
Test is SUID
./socket-tcp-nfconntrack --pidfile=socket-tcp-nfconntrack.pid --outfile=socket-tcp-nfconntrack.out
Another app is currently holding the xtables lock. Perhaps you want to use the -w option?

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
81c113e325 test/alpine: add a new path to libxt libraries
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
ae2ab548eb test/abrt: skip core dumps from the seccomp_filter test
It is expected behaviour.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
f046de70e5 socket-tcp: ignore SIGPIPE
The test is trying to write into a closed socket and the kernel sends
SIGPIPE in this case, which is perfectly normal and should not fail the
test.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Dmitry Safonov
d4f3c7cd55 compel: Provide piegen_opt_t in library
Fixes:
verify-elf: ERROR: ./usr/lib64/libcompel.so.1.0: undefined symbol: opts

Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Alexey Shabalin <>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Pavel Tikhomirov
4e1c7f5134 zdtm: check criu restore with --auto-dedup
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Cyrill Gorcunov
cfee62ac21 inet: raw -- Add socket-raw test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
d7d5f9fd2d zdtm/sigpending: check only relevant part of siginfo
Recently, a kernel behaviour how siginfo is copied into user-space was
changed:

4ce5f9c9e754 ("signal: Use a smaller struct siginfo in the kernel")

According to the rt_sigqueueinfo man page, the caller should set
si_code, si_pid, si_uid, si_value and there is no guarantee about other
fields.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-02-14 21:22:35 +03:00
Andrei Vagin
deef94ce7c test: use yaml.safe_dump to avoid dump without tags
safe_dump produces only standard YAML tags and
cannot represent an arbitrary Python object.

Reported-by: Mr Jenkins
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-11-04 21:45:27 +03:00
Adrian Reber
565498a774 tests: more python3 compatibility
This makes two zdtm test scripts python3 compatible to run
zdtm on a system without python2.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-11-04 21:45:06 +03:00
Andrei Vagin
d01899e15b test/file_locks: use F_GETLK instead of F_GETLK64
F_GETLK64 has to be used with flock64

Reported-by: Mr Jenkins
2018-11-04 21:43:43 +03:00
Andrei Vagin
54daec1899 test/file_locks: use struct flock instead of struct flock64
If we want to use flock64, we have to use fcntl64. Otherwise we will get
errors like this:
ERR: file_locks07.c:49: Can't set ofd lock (errno = 22 (Invalid argument))

Reported-by: Mr Jenkins
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-11-04 21:43:35 +03:00
Dmitry Safonov
2c5e8fd7ab zdtm/x86: Don't override %ebx in fpu00
%ebx, %ecx aren't specified as clobbers in chk_proc_fpu(),
while asm cpuid overwrites them.

In the turn, %ebx is used as a code position by gcc now:
    1661:       e8 9a 00 00 00          call   1700 <__x86.get_pc_thunk.bx>
    1666:       81 c3 46 68 00 00       add    $0x6846,%ebx

Which results in dereferencing some ugly garbage (result of cpuid).

Let's use zdtm/lib cpuid() function instead.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-11-04 21:43:05 +03:00
Andrei Vagin
f25f9d57c8 test/file_lock01: don't limit a maximum field width for device numbers
Invalid lock info: lock: 1: FLOCK  ADVISORY  READ  61 103:00:1188168 0 EOF

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Andrei Vagin
eccdf07ae3 python fix lint warnings
flake8 started to report warnings like this:
test/zdtm.py:1337:6: W605 invalid escape sequence '\S'

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Andrei Vagin
de62bf764c test/ipc_namespace: set random values less that IPCMNI for *mni sysctls
There are a few patches in linux-next, which added this check:
    ipc: IPCMNI limit check for semmni
    ipc: IPCMNI limit check for msgmni and shmmni

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Pavel Tikhomirov
e4d8dc6f29 zdtm: check criu restore with --auto-dedup
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Andrey Vagin
89c5fc9b06 zdtm: create a few external descriptros
Currently, we create only one external resource to check how it is
handled by criu. It is better to create more than one.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Andrey Vagin
a96d229876 test/inhfd: fix lint warnings
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Mike Rapoport
114af54fe8 jenkins: lazy-pages: exclude maps04
On loaded systems running maps04 with lazy-pages takes too much time. The
same functionality is anyway covered by other tests so excluding  maps04
shouldn't decrease the test coverage.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:18 +03:00
Mike Rapoport
3e7cfd114d jenkins: split common part of lazy pages tests into a separate file
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:18 +03:00
Radostin Stoyanov
c36b5dab05 python: Replace xrange with range
In Py2 `range` returns a list and `xrange` creates a sequence object
that evaluates lazily. In Py3 `range` is equivalent to `xrange` in Py2.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:14 +03:00
Radostin Stoyanov
147660f02f Convert to python3 style print() syntax
Use __future__ imports to keep this working for python2

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:01 +03:00
Radostin Stoyanov
7ce23b2a74 python: Remove unused imports
Auto-detected with pylint.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:01 +03:00
Andrei Vagin
bd8fa1528a test/rpc: Specify --address for page-server
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:28:01 +03:00
Radostin Stoyanov
4416c58efe zdtm: Explicitly close opened files
CPython currently uses a reference-counting scheme with (optional)
delayed detection of cyclically linked garbage, which collects most
objects as soon as they become unreachable, but is not guaranteed to
collect garbage containing circular references.

Some objects contain references to "external" resources such as open
files. It is understood that these resources are freed when the object
is garbage-collected, but since garbage collection is not guaranteed to
happen, such objects also provide an explicit way to release the
external resource, usually a close() method.

Programs are strongly recommended to explicitly close such objects.

Reference: https://docs.python.org/3.6/reference/datamodel.html

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:28:01 +03:00