2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-25 11:27:40 +00:00

283 Commits

Author SHA1 Message Date
Adrian Reber
ee149cf54c 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:37:19 +03:00
Adrian Reber
8d7742a167 Revert "Revert "travis: run test/other/rpc tests""
This reverts commit 3abb6f5cd6a2d3056ed7ba372f8439ae4d66163d.

This reverts the revert as the tests are now fixed.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-29 01:06:06 +03:00
Adrian Reber
eba1fba8b3 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-06-29 01:06:06 +03:00
Andrei Vagin
3abb6f5cd6 Revert "travis: run test/other/rpc tests"
This reverts commit 5c26d8063923bdf4213c1e8a83157ac7beede88c.

This test fails in Travis.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-23 10:14:32 +03:00
Adrian Reber
396c37dd62 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-06-23 08:25:07 +03:00
Adrian Reber
8697e7837c 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-06-20 21:29:39 +03:00
Adrian Reber
5c26d80639 travis: run test/other/rpc tests
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-19 19:59:14 +03:00
Andrei Vagin
1a1e3d7f56 test: run a full set of tests in docker containers
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-08 09:54:22 +03:00
Andrei Vagin
c4b398fd0a build/docker: install packages to run tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-08 09:54:22 +03:00
Andrei Vagin
dec375f87e travis: run the crit-recode test
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-08 09:54:22 +03:00
Andrei Vagin
81c37c2fc6 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-06-08 09:54:22 +03:00
Andrei Vagin
1509147abe 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-06-08 09:54:22 +03:00
Adrian Reber
579872a530 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-05-25 00:23:00 +03:00
Adrian Reber
222ad25bed 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-05-25 00:23:00 +03:00
Adrian Reber
af353d0f69 crit: make crit python2/python3 compatible
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-25 00:23:00 +03:00
Andrei Vagin
35e8a3446f 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-05-15 03:05:15 +03:00
Mike Rapoport
a50ae653b2 Revert "travis: temporarily disable lazy-pages testing"
This reverts commit 4459590d5ffd1fb9ee23927ee08f2f5fb0969577.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-10 00:37:01 +03:00
Andrei Vagin
3bc9e95e49 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-09 10:17:38 +03:00
Dmitry Safonov
4cbd3ac447 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-04-30 00:35:49 +03:00
Mike Rapoport
85fd6abea4 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-04-19 23:26:34 +03:00
Mike Rapoport
4459590d5f travis: temporarily disable lazy-pages testing
lazy-pages is currently broken, so to avoid false positives in travis
because of that, temporarily disable lazy-pages testing

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2018-04-11 15:37:36 +03:00
Andrei Vagin
1d5438310b 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-04-06 02:37:28 +03:00
Andrey Vagin
251dad530b 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-03-28 00:31:53 +03:00
Kir Kolyshkin
d8d9a67d5d 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-03-23 00:46:11 +03:00
Kir Kolyshkin
1c67bbf1a7 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-03-23 00:46:11 +03:00
Kir Kolyshkin
b5fe770f8d 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-03-23 00:46:11 +03:00
Kir Kolyshkin
b21fda47fd 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-03-23 00:46:11 +03:00
Andrei Vagin
44dadb9a56 [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-03-10 01:15:23 +03:00
Andrei Vagin
9ca8953baa 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-07 19:56:24 +03:00
Andrei Vagin
59770d4f8b phaul: run the phaul test in a docker container
golang from the Ubuntu Trusty is too old.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:36:15 +03:00
Andrei Vagin
ff599cd966 travis: run phaul tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:36:15 +03:00
Andrei Vagin
a04f8ae965 travis: check docker checkpoint
Install the last version of Docker, start a container and C/R it a few times.

v2: call make to install criu
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:34:50 +03:00
Andrei Vagin
a6d717b7bc 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>
2017-11-30 01:22:16 +03:00
Pavel Emelyanov
4c50326ed6 crns.py: New attempt to have --unshare option
So, here's the enhanced version of the first try.

Changes are:

1. The wrapper name is criu-ns instead of crns.py
2. The CLI is absolutely the same as for criu, since the script
   re-execl-s criu binary. E.g.
	   scripts/criu-ns dump -t 1234 ...
   just works
3. Caller doesn't need to care about substituting CLI options,
   instead, the scripts analyzes the command line and
   a) replaces -t|--tree argument with virtual pid __if__ the
      target task lives in another pidns
   b) keeps the current cwd (and root) __if__ switches to another
      mntns. A limitation applies here -- cwd path should be the
      same in target ns, no "smart path mapping" is performed. So
      this script is for now only useful for mntns clones (which
      is our main goal at the moment).

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Looks-good-to: Andrey Vagin <avagin@openvz.org>
2017-11-30 01:18:53 +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