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

579 Commits

Author SHA1 Message Date
Cyrill Gorcunov
6ed2532b36 nmk: Filter out already seen targets from collect-deps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
faa8bae6f2 nmk: Don't include deps on mrproper
mrproper doesn't require inclusion of deps similar
as clean target.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Adrian Reber
077409c197 travis: fix rawhide test by also installing sudo
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Adrian Reber
ae55a6ccd5 tests: fix builds on alpine and centos
Install sudo, create test user with ID 1000, install bash,
fix pidfile creation and pidfile chmod.

v2:
 * use sleep to give the criu daemon some time to start up

v3:
 * Andrei is of course right and sleep is not good solution.
   After adding --status-fd support to criu service, this
   is how we now detect that criu is ready.

v4:
 * This was much more complicated than expected which is related
   to the different versions of the tools on the different travis
   test targets. There seems to be a bug in bash on Ubuntu
    https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html
   which prevents using 'read -n1' on Ubuntu. As a workaround
   the result from CRIU's status FD is now read via python.

   Another problem was discovered on alpine with the loop restore test.
   CRIU says to use setsid even if the process is already using setsid.
   As a workaround, still with setsid, this process is now using
   shell-job true for checkpoint and restore.

Parts of v2 have been committed before. So the changes from this commit
are partially already in another commit.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
2c5b2785ed tests: fix builds on alpine and centos
Install sudo, create test user with ID 1000, install bash,
fix pidfile creation and pidfile chmod.

v2:
 * use sleep to give the criu daemon some time to start up

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
6a49d037aa travis: run test/other/rpc tests
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
fc11d59db1 travis: fix building on s390x
The travis build for s390x started to fail with:

Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/InRelease Unable to find expected entry 'main/binary-s390x/Packages' in Release file (Wrong sources.list entry or malformed file)

This changes the repository definition just like it is done for ppc64le.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-10 08:38:09 +03:00
Andrei Vagin
b988fae544 travis/docker-test: use make to install criu
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:52 +03:00
Adrian Reber
55d0f98fc9 scripts/systemd-autofs-restart.sh: fix variable name
The script checks if $NSENTER is executable and sets $NS_ENTER if not.
This seems to be a typo (once with '_' and once without).

Untested and not reproducible. It just looks wrong.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:50 +03:00
Andrei Vagin
d76ddb5e83 test: run a full set of tests in docker containers
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
5604ccbe60 build/docker: install packages to run tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
0e05bdfe27 travis: run the crit-recode test
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
841edaf317 lib: a few fixes to be compatible with python3
All these issues was found by running test/crit-recode.py

https://github.com/checkpoint-restore/criu/issues/495

v2: drop FD_CLOEXEC for swrk descriptors
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
0dab224be6 travis: set python3 as default for fedora containers
We need a few jobs to check a compatibility with python3

v2: fix inhfd and rpc tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Adrian Reber
553dd546b5 travis: fix python2 package installation
For python2/python3 compatibility install additional (python2-future)
and different (python2-ipaddress) packages during test.

Also switch Fedora tests to explicitly install versioned python packages
(python2-* instead of python-*).

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Adrian Reber
1a0ad1ae87 Makefiles: auto-detect python version - prefer python2
This prepares CRIT for python2/python3 compatibility by auto-detecting
the installed python version. python2 is detected first and then the
variable PYTHON is set.

By setting the variable PYTHON to python2/python3 the user can override
the auto-detection.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Adrian Reber
98cb5c627d crit: make crit python2/python3 compatible
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Andrei Vagin
1099cf0639 travis: build criu and run tests on centos
It is one of our target platforms.

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-04 04:16:09 +03:00
Andrei Vagin
7af751b569 test/other: add a test to check the --shell-job option
This test creates a pty pair, creates a test process and sets a slave
pty as control terminal for it.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-14 08:45:49 +03:00
Andrei Vagin
5d3ea878fb travis: rollback to fedora 27
We have a few issues with fc28. For example:
https://github.com/checkpoint-restore/criu/issues/469

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Dmitry Safonov
c2876c2f25 nmk: Don't redefine MAKEFLAGS
$(MAKEFLAGS) already contains -r -R and --no-print-directory: those
flags are being added in include.mk.. which is included two lines above.
There is no comment and I see no big sense in erasing $(MAKEFLAGS),
rather than adding those flags. So I considered this as a typo.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Andrei Vagin
3e66125e9b [v2] criu: add -fprofile-update=atomic for builds with gcov
Sometimes we see errors like this:
criu/cr-restore.gcda:Merge mismatch for function 106

It proabably means that this gcda file was corrupted. According to the
gcc man page, the -fprofile-update=atomic should fix this problem.

v2: this options appered in gcc7, so we need to install it.

Reported-by: Mr Travis CI
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:32 +03:00
Mike Rapoport
bb2af52190 test: lazy-pages: exclude maps007
With userfaultfd we cannot reliably service process_vm_readv calls. The
maps007 test that uses these calls passed previously by sheer luck.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Andrey Vagin
6a66b87e12 zdtm: check an exit code of a straced restore
Currently zdtm doesn't detect when restore failed, if it is executed
with strace. With this patch, fake-restore.sh creates a test file, and
zdtm is able to distinguish when restore failed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Kir Kolyshkin
0284e70f4d scripts/build/binfmt_misc: fix for bash
There was a "; done" leftover here, somehow ignored by dash
but not bash. Remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:33 +03:00
Kir Kolyshkin
a2ab074eca scripts/build/Dockerfile.rawhide: rm
It is not used, probably was committed by mistake.

Fixes: 2d093a170227 ("travis: add a job to test on the fedora rawhide")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Kir Kolyshkin
c75cb2b58b CI: fix Fedora rawhide
Fix Fedora rawhide CI failure caused by coreutils-single and our
way of running under QEMU.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Kir Kolyshkin
7c4ddebc35 scripts/build/Dockerfiles: nitpicks
1. Sort lists of packages to be installed, unify indentation.

2. Merge "ccache -s" and "ccache -z".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Andrei Vagin
6aa4a9c2f1 netns: restore internal veth devices
When we dump a veth device, the kernel reports where a peer device lives
and we use this information to restore this veth pair.

On restore we set a net ns id for a peer and it is created in the required
netns.

v2: add more comments
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-02-15 21:45:08 +03:00
Andrei Vagin
b2494eae61 test/docker: check a continaer with a read-only file system
Now it's probably one valide use case, because there is no way to commit
a container when a container is being checkpointed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-12 09:13:37 +03:00
Dmitry Safonov
585dda236c ia32: Get rid of R_X86_64_32S relocation
Distributions starts to supply GCC that is configured to compile
-pie and -fPIC code by default due to security reasons.

CONFIG_COMPAT was unfriendy to -pie by the reason of R_X86_64_32S
relocation in call32.S helper:
  LINK     criu/criu
/usr/bin/ld: criu/arch/x86/crtools.built-in.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [criu/Makefile:92: criu/criu] Error 1
make: *** [Makefile:225: criu] Error 2

Use %rip-relative addressing to avoid ld errors for shared binary linking.
Puff, all needs to be done with bare hands!

Now CONFIG_COMPAT can be used with -pie binaries and all should
also work for debian toolchain (#315).

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:23 +03:00
Andrei Vagin
008db0cb7a zdtm: run page-server via rpc
v2: typo fix
v3: run criu pre-dump via rpc
v4: don't use status-fd for rpc

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:23 +03:00
Cyrill Gorcunov
8db0f03758 build: nmk -- Move phony targets to include.mk
So they can be reused.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Cyrill Gorcunov
d62e01929e build: nmk -- Add .FORCE target
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Andrei Vagin
15b29140a8 travis: check compilation for arm64v8/fedora:rawhide
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-22 06:36:12 +03:00
Mike Rapoport
9ad1287669 travis/lazy-pages: exclude lazy-thp for older kernels
The lazy-thp may fail with older kernels if khugepaded will be fast enough
to merge pages in the partially populated areas.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-22 06:34:39 +03:00
Andrei Vagin
ac21ffe215 travis: set umask before a first criu run
so that .gcda (coverage data) files are created with read-write
permissions for all, otherwise uns tests will not be able to
modify these files and code coverage data will not be collected
for them.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 10:21:45 +03:00
Mike Rapoport
3fb3e87058 travis/lazy-pages: explicitly define the tests to verify lazy-pages
Running all the tests with --lazy-pages and --remote-lazy-pages takes too
long. Let's run only several representing tests for those cases.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
5dc2e922d7 travis: mount tmpfs into /run for docker containers
Otherwise we will see warnings like these ones:
Warn  (criu/kerndat.c:805): Can't load /run/criu.kdat
Warn  (criu/net.c:2726): Unable to get a socket network namespace
Warn  (criu/kerndat.c:844): Can't keep kdat cache on non-tempfs

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
251b4d06a9 zdtm: report test results in the junit format
We found a good plugin for Jenkins to analize test results,
but it can handle only the junit format.

v2: work without the junit python module
v3: install junit-xml, because zdtm.py is executed
    with the --report option from jenkins scripts.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
061a407ce3 alpine: compile all tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
2d093a1702 travis: add a job to test on the fedora rawhide
This job is optional and it don't affect the status of a whole job.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Andrei Vagin
833c10450d travis: use a last alpine release to build criu
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Andrei Vagin
32191ac444 travis: use xenial instead of zesty
xenial is LTS and it is more stable and popular.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
d723061b53 CI x86_64: switch to Zesty, add clang build
The x86_64 job is the one we run inside Docker (as opposed to 'local',
which runs on the host). Let's update this to use Ubuntu Zesty, and
since it has clang-4 (unlike the 'local' one) it makes sense to add
a clang build.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
4ccafdd920 CI: update ARM 32 bit build to Zesty
Also, use more official / better maintained Docker image repo.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
5b158804e8 scripts/build/extract-deb-pkg: fix/improve
Numerous improvement to extract-deb-pkg, in no particular order:

 * Use bash
 * More strict error checking (set -u -o pipefail)
 * Print error message if target dir exists
 * Check number of arguments, provide usage info
 * Separate mirror to a variable for easier changing
 * Use mirrors.kernel.org
 * Use https and check cert with curl
 * Make curl silent
 * Use zgrep instead of gunzip | grep
 * Error out with a message in case more than 1 package was found
 * Do not create a target directory before we need it
 * Fix shellcheck warnings (way too many to mention)
 * ...
 * PROFIT!!!111

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
d23617e95d travis ppc64: use ubuntu zesty
This comes with newer libc headers so we can catch errors earlier.
Also, clang 4.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
7b8ed84cd9 scripts/build/binfmt_misc: fix for ppc64le
Got this error trying to build criu on ppc64le under qemu, after
updating the Dockerfile to use Ubuntu Xenial (rather than Trusty):

> $ rm -rf .ccache; make -C scripts/build ppc64le-clang
>
> ...
>
> Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
> /sbin/ldconfig.real: 1: /sbin/ldconfig.real: Syntax error: "(" unexpected
> /sbin/ldconfig.real: 1: /sbin/ldconfig.real: Syntax error: "(" unexpected
> dpkg: error processing package libc-bin (--configure):
>  subprocess installed post-installation script returned error exit status 2
> ...

Apparently, ldconfig.real binary header differs from others:

root@3c7593d3298d:/# od -x /bin/ls | head -2
0000000 457f 464c 0102 0001 0000 0000 0000 0000
0000020 0002 0015 0001 0000 5680 1000 0000 0000

root@3c7593d3298d:/# od -x /sbin/ldconfig.real | head -2
0000000 457f 464c 0102 0301 0000 0000 0000 0000
0000020 0002 0015 0001 0000 1d58 1000 0000 0000

Amend the mask in binfmt_misc entry to take this into account.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Kolyshkin
0b044ecb44 travis arm64: switch to zesty
Let's use Ubuntu 17.04 "Zesty" for ARM-64 bit CI.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00