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

366 Commits

Author SHA1 Message Date
Adrian Reber
e7cbeddff3 CI: rename 'travis' to 'ci'
CRIU is already using multiple CI systems and not just Travis. This
renames all Travis related things to 'ci' to show it is actually
independent of Travis.

Just a simple rename.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-11-08 14:04:12 -08:00
Adrian Reber
5a655e890a travis: install gzip and redhat-rpm-config for Fedora Rawhide based tests
Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
32b162831d CI: add Travis test script to 'lint'
Running 'make lint' will now also check our travis-tests script with
shellcheck.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
025ef090d2 CI: switch to loop based apt-get
The previously introduced apt_install loop function to make package
install more robust against network errors is now moved to its own
script used in multiple places.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
0def9bc1ff tests: only run 'make lint' once in CI
Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
84215e0355 scripts: run shellcheck on the scripts folder
Shellcheck (https://github.com/koalaman/shellcheck) can identify common
errors in shell scripts. This initial integration of shellcheck only
checks the scripts in the 'scripts/' folder. This commit fixes (or
disables) all reports of shellcheck to ensure this part starts error
free. I am not convinced this is really necessary as most changes do not
seem to be necessary for their circumstances. On the other hand it
probably does not hurt to use a checker to avoid unnecessary errors.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Sebastiaan van Stijn
3957d9533b Switch to python 3 variants of dependencies on debian-based builds
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-20 00:18:24 -07:00
Adrian Reber
596276a9af travis: use Fedora rawhide images from Fedora
The docker hub container registry is not updated as fast as Fedora's
registry at registry.fedoraproject.org. Fedora's registry gets a new
image whenever there is a new version of rawhide, docker hub's rawhide
image can take a couple of weeks because the process is not automated.

Especially when Fedora branches of a new release we see lot's of errors
in CRIU's Fedora rawhide based Travis runs. Switch to Fedora's registry
to always have the newest rawhide images for our tests.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Mike Rapoport
df0c793d52 travis: restore lazy-pages tests for uns flavor
Since commit cdd08cdff ("uffd: use userns_call() to execute
ioctl(UFFDIO_API)") UFFD_API ioctl() is wrapped with userns_call() and this
allows runing lazy-pages tests on recent kernels in uns.

Restore testing of lazy-pages in uns in travis.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2020-10-20 00:18:24 -07:00
Abhishek Vijeev
20d87bbfac scripts: adding libbpf for Travis tests
Source files modified:

* travis/vagrant.sh - Adding libbpf-devel

Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
d6735616a9 travis: add a focal based test run
It seems travis supports now Ubuntu 20.04. Let's run at least one test
also on 20.04 (focal).

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
ca360ce30b travis: switch travis to Python 3
Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
18f42b3021 travis: loop over apt-get to recover from errors
One of the most common CI errors we see is that package install fails
due to some hashsum mismatch or some DNS errors.

This adds a loop around each apt-get install call to do a clean, update
and install and if one of the steps fails it repeats it up to 10 times.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Radostin Stoyanov
7646deed61 vagrant: Update to Fedora 32
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2020-10-20 00:18:24 -07:00
Andrei Vagin
f96cd8c749 tests: skip cgroup04 and cgroup_ifpriomap on pure cgroup2 systems
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-10-20 00:18:24 -07:00
Nicolas Viennot
0d8d7f2329 tests: criu-image-streamer change dev branch to master branch
Now that the new CRIU to criu-image-streamer protocol is in, we can use
the master branch of criu-image-streamer.

Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
3490d997be test: test external namespace support
Adapt netns_ext tests to also work with pid namespaces and move it from
test/others/netns_ext/ to test/others/ns_ext/.

Also enable ns_ext tests in Travis runs.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
41b535d312 test: skip vdso test on non-vdso systems
Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
cbf099400a Travis: use Vagrant to run VMs
This adds the minimal configuration to run Fedora 31 based VMs on
Travis.

This can be used to test cgroupv2 based tests, tests with vdso=off and
probably much more which requires booting a newer kernel.

As an example this builds CRIU on Fedora 31 and reconfigures it to boot
without VDSO support and runs one single test.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-10-20 00:18:24 -07:00
Guoyun Sun
b5c34c74c5 mips:support docker-cross compile
Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
2020-10-20 00:18:24 -07:00
Nicolas Viennot
27ab533cbe tests: run tests with criu-image-streamer with --stream
One can pass --stream to zdtm.py for testing criu with image streaming.
criu-image-streamer should be installed in ../criu-image-streamer
relative to the criu project directory. But any path will do providing
that criu-image-streamer can be found in the PATH env.

Added a few tests to run on travis-ci to make sure streaming works.
We run test that are likely to fail. However, it would be good to once
in a while run all tests with `--stream -a`.

Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
2020-10-20 00:18:24 -07:00
Adrian Reber
d23d1fc0f9 travis: fix alpine builds
With the latest version of the alpine container image it seems that
alpine changed a few package names. This adapts the alpine container
to solve the travis failures.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-06-06 11:45:21 -07:00
Andrei Vagin
1ad8657ddb config/nftables: include string.h for strlen
Fixes: 9433b7b9db3e ("make: use cflags/ldflags for config.h detection mechanism")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-03-27 19:36:20 +03:00
Nicolas Viennot
f42ae70c75 make: use cflags/ldflags for config.h detection mechanism
The config.h detection scripts should use the provided CFLAGS/LDFLAGS
as it tries to link libnl, libnet, and others.

Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
2020-03-27 19:36:20 +03:00
Mike Rapoport
c3ad4942d4 travis: add ppc64-cross test on amd64
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2020-03-27 19:36:20 +03:00
Dmitry Safonov
1f74f8d770 travis: Use debian/buster as base for cross build tests
Jessie is called 'oldoldstable', migrate to Buster.

Suggested-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-03-27 19:36:20 +03:00
Dmitry Safonov
18ac1540c4 travis: Add aarch64-cross test on amd64
Fixes: #924
Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-03-27 19:36:20 +03:00
Nicolas Viennot
c1e72aa936 memfd: add file support
See "man memfd_create" for more information of what memfd is.

This adds support for memfd open files, that are not not memory mapped.

* We add a new kind of file: MEMFD.
* We add two image types MEMFD_FILE, and MEMFD_INODE.
  MEMFD_FILE contains usual file information (e.g., position).
  MEMFD_INODE contains the memfd name, and a shmid identifier
  referring to the content.
* We reuse the shmem facilities for dumping memfd content as it
  would be easier to support incremental checkpoints in the future.

Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
2020-03-27 19:36:20 +03:00
Adrian Reber
f5181b2767 Travis: fix podman test case
Podman changed the output of 'podman ps'. For the test only running
containers are interesting. Adding the filter '-f status=running' only
returns running containers as previously.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-16 09:15:15 -08:00
Adrian Reber
8fea2647b6 travis: reduce the number of podman tests
We are running each podman test loop 50 times. This takes more than 20
minutes in Travis. Reduce both test loops to only run 20 times.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:44 -08:00
Nidhi Gupta
0c218746d5 Switch open-j9 alpine tests to python3
Signed-off-by: Nidhi Gupta <itsnidhi16@gmail.com>
2020-02-04 12:39:44 -08:00
Nidhi Gupta
1e9ff2aa03 Add Socket-based Java Functional Tests
Signed-off-by: Nidhi Gupta <itsnidhi16@gmail.com>
2020-02-04 12:39:44 -08:00
Adrian Reber
8b5dea33f6 travis: switch alpine to python3
Now that Python 2 has officially reached its end of life also switch the
Alpine based test to Python 3.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:44 -08:00
Alexander Mikhalitsyn
acb42456dc zdtm: nft tables preservation test
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
Signed-off-by: Alexander Mikhalitsyn <alexander@mihalicyn.com>
[Added test_author to zdtm test]
Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-02-04 12:39:43 -08:00
Alexander Mikhalitsyn
e1c4871759 net: add nftables c/r
After Centos-8 nft used instead of iptables. But we had never supported nft rules in
CRIU, and after c/r all rules are flushed.

Co-developed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
Signed-off-by: Alexander Mikhalitsyn <alexander@mihalicyn.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-02-04 12:39:43 -08:00
Adrian Reber
79559bef92 Fix tests on Ubuntu
It seems like Ubuntu introduced a overlayfs change which breaks CRIU:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1857257

This disables overlayfs (unfortunately) in most tests by switching to
devicemapper or vfs.

Upstream kernels do not seem to have this problem.

This also adds the 'docker-test' for xenial which still has a working
overlayfs from CRIU's point of view.

Also adjust Podman Ubuntu package location

Podman Ubuntu packages are now available via OBS and no longer via PPA.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:05 -08:00
Radostin Stoyanov
00bb068785 scripts: alpine: Install py2 packages with pip
The py-future package has been renamed to py3-future [1] and py2 package
for yaml has been dropped [2].

[1] https://git.alpinelinux.org/aports/commit/main?id=316d44abaed13964e97eb43c095cd1b64e3943ad
[2] https://git.alpinelinux.org/aports/commit/main?id=e369c1fd7707a73f2c3e2b11b613198d9a4106de

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2020-02-04 12:39:05 -08:00
Andrei Vagin
b5b1c4ec45 kerndat: check whether the new mount API is supported of not
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04 12:39:05 -08:00
Dmitry Safonov
1dbc835954 travis: Add armv7-cross as cross-compile test
Fixes: #455
Based-on-patch-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04 12:39:04 -08:00
Dmitry Safonov
df66aa99b6 build/nmk: Provide proper SUBARCH
It's always equal ARCH and not very useful (so nothing actually uses it).
Time for a change: SUBARCH now is meaningful and gives a way to detect
what kind of ARCH flavor build is dealing with.

Also, for cross-compiling sake don't set SUBARCH if the user supplied it.
(and don't call useless uname during cross compilation)

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04 12:39:04 -08:00
Dmitry Safonov
a4fa4162d4 build/nmk: Remove SRCARCH
It's not used anywhere now.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04 12:39:04 -08:00
Mike Rapoport
75fcec0ecb travis: exclude uns tests for lazy-pages on newer kernels
Kernels 5.4 and higher will restrict availability of UFFD_EVENT_FORK only
for users with SYS_CAP_PTRACE. This prevents running --lazy-pages tests
with 'uns' flavor.

Disable 'uns' for lazy pages testing in travis for newer kernels.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2020-02-04 12:39:04 -08:00
Mike Rapoport
8f45330d16 travis: group lazy-pages options
The amount of lazy-pages options keeps growing, let's put the common ones
into a variable.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2020-02-04 12:39:04 -08:00
Adrian Reber
fe668075ad travis: switch pcp64le and s390x to real hardware
Now that Travis also supports ppc64le and s390x we can remove all qemu
based docker emulation from our test setup. This now runs ppc64le and
s390x tests on real hardware (LXD containers).

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:04 -08:00
Adrian Reber
eab8cf0775 travis: switch all arm related tests to real hardware
This switches all arm related tests (32bit and 64bit) to the aarch64
systems Travis provides. For arm32 we are running in a armv7hf container
on aarch64 with 'setarch linux32'.

The main changes are that docker on Travis aarch64 cannot use
'--privileged' as Travis is using unprivileged LXD containers to setup
the testing environment.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:04 -08:00
Adrian Reber
6be414bb2b travis: Do not run privileged containers in LXD
Travis uses unprivileged containers for aarch64 in LXD. Docker with
'--privileged' fails in such situation. This changes the travis setup
to only start docker with '--privileged' if running on x86_64.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:04 -08:00
Adrian Reber
62953d4334 travis: fix copy paste error from previous commit
In my previous commit I copied a line with a return into the main script
body. bash can only return from functions. This changes return to exit.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:04 -08:00
Nidhi Gupta
2b4e653361 Run java functional tests on travis
Signed-off-by: Nidhi Gupta <itsnidhi16@gmail.com>
2020-02-04 12:39:04 -08:00
Adrian Reber
a7c625938e travis: start to use aarch64 hardware
With the newly introduced aarch64 at Travis it is possible for the CRIU
test-cases to switch to aarch64.

Travis uses unprivileged LXD containers on aarch64 which blocks many of
the kernel interfaces CRIU needs. So for now this only tests building
CRIU natively on aarch64 instead of using the Docker+QEMU combination.

All tests based on Docker are not working on aarch64 is there currently
seems to be a problem with Docker on aarch64. Maybe because of the
nesting of Docker in LXD.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-02-04 12:39:04 -08:00
Ashutosh Mehra
321f826621 Enable libcriu testing in travis jobs
Updated scripts/travis/travis-tests to run libcriu test.

Signed-off-by: Ashutosh Mehra <asmehra1@in.ibm.com>
2020-02-04 12:39:04 -08:00