2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

104 Commits

Author SHA1 Message Date
Radostin Stoyanov
36a53fe23c ci: test interrupt-only mode with frozen cgroup
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2025-03-21 12:40:31 -07:00
Radostin Stoyanov
4196268eef seize: enable support for frozen containers
Container runtimes like CRI-O and containerd utilize the freezer cgroup
to create a consistent snapshot of container root filesystem (rootfs)
changes. In this case, the container is frozen before invoking CRIU.
After CRIU successfully completes, a copy of the container rootfs diff
is saved, and the container is then unfrozen.

However, the `cuda-checkpoint` tool is not able to perform a 'lock'
action on frozen threads.  To support GPU checkpointing with these
container runtimes, we need to unfreeze the cgroup and return it to its
original state once the checkpointing is complete.

To reflect this new behavior, the following changes are applied:
 - `dont_use_freeze_cgroup(void)` -> `set_compel_interrupt_only_mode(void)`
 - `bool freeze_cgroup_disabled` -> `bool compel_interrupt_only_mode`
 - `check_freezer_cgroup(void)` -> `prepare_freezer_for_interrupt_only_mode(void)`

Note that when `compel_interrupt_only_mode` is set to `true`,
`compel_interrupt_task()` is used instead of `freeze_processes()`
to prevent tasks from running during `criu dump`.

Fixes: #2508

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2025-03-21 12:40:31 -07:00
Andrei Vagin
e1331a4b60 fault: allow to check dont_use_freeze_cgroup
Adds a new "fault" to call dont_use_freeze_cgroup.

Signed-off-by: Andrei Vagin <avagin@google.com>
2024-09-19 15:23:42 -07:00
Bhavik Sachdev
f171649264 test/dump-crash: check code path when dump crashes
Signed-off-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
2024-09-11 16:02:11 -07:00
Adrian Reber
900909d95e test: check for btrfs in the current directory
The old test was checking if '/' is btrfs but we should check if the
current directory is btrfs.

Signed-off-by: Adrian Reber <areber@redhat.com>
2024-09-11 16:02:11 -07:00
KKrypt
34e2b02219 Optimized shell code with <'s (instead of cat + |)
This patch optimizes shell code as reading a single file as input using a 'cat' command to a program.

It is considered to be a Useless Use of Cat (UUOC).

It's more efficient to simply use redirection.

However, in some cases, even using the redirection operator '<' seems unnecessary.

Signed-off-by: KKrypt <sankalpacharya1211@gmail.com>
2023-04-15 21:17:21 -07:00
Bui Quang Minh
c830643d86 Revert "ci: skip new hugetlb maps09/maps10 tests for pre-dump"
This reverts commit 37ea8c5fcfef2108800b6d53054f3a7c4f710752.

Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2023-04-15 21:17:21 -07:00
Alexander Mikhalitsyn
991f27c841 ci: skip new hugetlb maps09/maps10 tests for pre-dump
This commit has to be reverted once we fix the issue.

Issue: https://github.com/checkpoint-restore/criu/issues/1868

Reported-by: Mr. Jenkins
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-05-05 12:42:14 -07:00
Alexander Mikhalitsyn
5c0b4fbcda ci: criu-fault: skip inotify_irmap fault-injection on btrfs
It looks like we've got broken fhandles from fdinfo
for inotifies/fanotifies for btrfs. I will look into that.

Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-28 17:53:52 -07:00
Adrian Reber
4adec8e8ef cgroup: test for --manage-cgroups=ignore
Test to ensure that --manage-cgroups=ignore works correctly.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-04-28 17:53:52 -07:00
Pavel Tikhomirov
c8121ed746 test/jenkins: test for old mount engine
Let's run zdtm in jenkins with --mntns-compat-mode option and same for
device-external mount test from others.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-28 17:53:52 -07:00
Alexander Mikhalitsyn
583e8ca055 ci: enable x86 xsave fault injection tests back
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-28 17:53:52 -07:00
Adrian Reber
14075baf72 test: do not use --keep-going for single zdtm tests
Looking at CI logs there are often messages like:

 "[WARNING] Option --keep-going is more useful when running multiple tests"

This commit removes '--keep-going' from single zdtm test runs.

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-04-28 17:53:52 -07:00
Adrian Reber
a52185ffe3 ci: disable broken tests until fixed
Broken tests are being tracked at

 * https://github.com/checkpoint-restore/criu/issues/1669
 * https://github.com/checkpoint-restore/criu/issues/1635

This also enables previously disabled BPF related tests:

 * https://github.com/checkpoint-restore/criu/issues/1354

Signed-off-by: Adrian Reber <areber@redhat.com>
2022-04-28 17:53:52 -07:00
Adrian Reber
dd0e66149f ci: fix 'crit.sh: 3: source: not found'
Jenkins test runs are failing with:

 ./test/jenkins/run_ct ./test/jenkins/crit.sh
 ./test/jenkins/crit.sh: 3: source: not found

Switch to bash which has 'source'.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-09-03 10:31:00 -07:00
Dmitry Safonov
39b7252c6f fault-injection: Run fpu corruption tests
For the thread leader and for subthreads too.

Signed-off-by: Dmitry Safonov <dima@arista.com>
2021-09-03 10:31:00 -07:00
Andrei Vagin
d38851c9bd test/jenkins: use bash to run shell scripts
We permanently have issues like this:
./test/jenkins/criu-iter.sh: 3: source: not found

It looks like a good idea to use one shell to run our jenkins scripts.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-10-20 00:18:24 -07:00
Pavel Tikhomirov
38793699e7 test/jenkins: remove empty line at the end of file
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2020-03-27 19:36:20 +03:00
Andrei Vagin
f1714ccce7 test/vdso: check the code path when here is no API to map vDSO
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-16 09:14:37 -08: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
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
Andrei Vagin
4ce3fc0b98 jenkins/criu-lazy-migration: clean old files
Otherwise files from a previous build can affect the current one.

Reported-by: Mr Jenkins
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:28:00 +03:00
Andrei Vagin
6c169c5173 test: don't save content of /sys/kernel/debug/tracing/trace
We don't tune tracers, so we don't expect to get anything.
In docker containers, debugfs isn't mounted and this command failed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
f992f469e8 jenkins: add a pipeline file for criu-lazy-migration
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
Mike Rapoport
455b5aea2b test/jenkins: add script for lazy migration testing
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-03-02 21:52:14 +03:00
Cyrill Gorcunov
78d4f7c352 test: jenkins -- Add huge shmid fault into the tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:13 +03:00
Mike Rapoport
f7e52b8b4a jenkins: lazy-pages: split lazy-pages runs to local and remote
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Mike Rapoport
737a561703 jenkins: criu-lib: add BUILD_NUMBER to the archive filename
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Dmitry Safonov
8459a3de9d vdso/zdtm: Add iterative proxification test
Test for previously fixed bugs for vdso-trampolines insertion:
- unmapping original vvar (which went unnoticed)
- leaving rt-vvar after each C/R cycle and resulting pollution

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-21 00:56:51 +03:00
Mike Rapoport
440a2a864a jenkins: lazy-pages: skip maps04 for remote-lazy-pages
Even with 2 parallel jobs maps04 takes too much time with
--remote-lazy-pages. Let's skip it for now.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-17 03:27:03 +03:00
Mike Rapoport
97fbb1bdc4 jenkins: lazy-pages: reduce amount of parallel runs for --remote case
Running zdtm/static/maps04 with --remote-lazy-pages in parallel with 3
other tests takes too much time on the Jenkins builder. Let's try running
with --parallel 2.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-17 03:27:03 +03:00
Mike Rapoport
0ebf7b81fa test/jenkins: update lazy-pages testing
* select excluded tests based on the kernel version
* test local and remote lazy-pages with and withour pre-dump

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-16 12:29:57 +03:00
Mike Rapoport
6de76ba0ac test/jenkins: extend lazy-pages testing
Add pre-dump and remote-lazy-pages passes to criu-lazy-pages.sh

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 11:47:02 +03:00
Mike Rapoport
a29f84a4ab jenkins: fix criu-lazy-pages.sh permissions
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:33 +03:00
Mike Rapoport
4bb1272ba5 test: add scripts to allow Mr. Jenkins check lazy-pages
Very minimalistic at the moment, no remote pages and namesapces.
Still better than nothing :)

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-09-16 09:16:32 +03:00
Dmitry Safonov
a90c07d6dd fault/vdso/restorer: add force-injection of trampolines
To check that jump trampolines to rt-vdso works.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:07 +03:00
Pavel Emelyanov
649280e31d pagemap: Fault inject partial pages.img read
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-03-02 00:19:03 +03:00
Andrei Vagin
9c26bae05a fault: check link_remaps if the restore fails at the last moment
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>
2016-12-21 11:23:02 +03:00
Andrew Vagin
3b366c3141 zdtm: check "criu dedup"
Add a new option to zdtm.py to run "criu dedup" after "criu dump"
or "criu pre-dump".

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:40 +03:00
Andrei Vagin
42058dc7ce test: don't do MS_REC|MS_PRIVATE for host mounts
Here is a race when someone umounted something and this operation
isn't propagated into our namespace.

CRIU                                | Another process
-----------------------------------------------------------------
pivot_root(".", put_root)           |
mount(put_root, MS_REC|MS_PRIVATE)  |
                                    | umount /xxx/yyy
                                    | umount /xxx -> EBUSY
umount(put_root)

We do this to not affect mounts in put_root, but we can mask
these mounts as slave and this will work for us and for external
users.

Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:20 +03:00
Eugene Batalov
dd7cfba0ae test: new jenkins script for testing of --leave-stopped option
There is no similar jenkins script that tests similar options now.
So make a new script.

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:20 +03:00
Eugene Batalov
40f56d5dc3 test: add test for anon shmem dedup
Main test features:
- Non trivial ps tree with non trivial anon shmem regions
  (no such test exists now).
- Each ps tree process continuously writes parts of anon shmem
  vmas and validates these writes after restore
  (required for dedup testing).
- Checking simultaneous changing of anon shmem contents in different
  processes.

Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:19 +03:00
Andrew Vagin
fafdfb4754 faul-inject: Check a case when parasite can't initialize a command socket
Give a fake address for a server socket.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-11 16:18:43 +03:00
Andrew Vagin
93e922238d criu: check that ghost files are cleaned up in error cases
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:33 +03:00
Andrew Vagin
628b125866 zdtm.py: check restore when criu dump runs over a non-root user
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:33 +03:00
Andrew Vagin
9205fc3dec travis: add more tests to maximise code coverage
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 16:51:05 +03:00
Andrew Vagin
9064905720 jenkins: add a new job to check --join-ns
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-01 14:52:21 +03:00
Pavel Emelyanov
330b0d1656 test: Check action scripts to work as we expect
We expect:

- all 9 scripts are called
- there's always images dir variable
- for 7 of those scripts there's root-pid variable

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
2016-05-06 14:39:25 +03:00