Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-11-02zdtm: Check threads are restored into correct threaded controllersBui Quang Minh
This test creates a process with 2 threads in different threaded controllers and check if CRIU restores these threads' cgroup controllers properly. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2022-11-02zdtm: Add test to check global properties of cgroup-v2 are preservedBui Quang Minh
Check that CRIU can checkpoint/restore global properties in cgroup-v2 properly. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2022-11-02zdtm: Add write_value/read_value helpers into zdtm libraryBui Quang Minh
Add write_value/read_value helpers to write/read buffer to/from files into zdmt library. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2022-10-25non-root: extend zdtm.py to be able to run tests as non-rootAdrian Reber
These are the minimal changes to make zdtm.py successfully run the env00 and pthread test case as non-root using the '--rootless' zdtm option. Co-authored-by: Younes Manton <ymanton@ca.ibm.com> Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
2022-10-02compel: Add test to check parasite stack setupYounes Manton
Some ABIs allow functions to store data in caller frame, which means that we have to allocate an initial stack frame before executing code on the parasite stack. This test saves the contents of writable memory that follows the stack after the victim has been infected but before we start using the parasite stack. It later checks that the saved data matches the current contents of the two memory areas. This is done while the victim is halted so we expect a match unless executing parasite code caused memory corruption. The test doesn't detect cases where we corrupted memory by writing the same value. Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
2022-08-31test/others/crit/test.sh: use bash arrayKir Kolyshkin
In fact an array (aptly named array) is already used in run_test2, so let's just make it an array right from the start. While at it, remove ls invocation. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-08-31Fix, not ignore, shellcheck SC1091 warningsKir Kolyshkin
This is easy to fix (but we have to specify -x). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-08-23test/unix: check C/R of unix listen queuesAndrei Vagin
Check that CRIU handles non-empty listen queues properly. Signed-off-by: Andrei Vagin <avagin@gmail.com> [mclapinski@google.com: update test_doc and test_author] Signed-off-by: Michal Clapinski <mclapinski@google.com>
2022-08-23zdtm: return 1 from pr_err, pr_perror, failAndrei Vagin
This allows to make test code more compact: if (ret == -1) { pr_perror("XXX"); return 1; } vs if (ret == -1) return pr_perror("XXX"); Signed-off-by: Andrei Vagin <avagin@gmail.com>
2022-08-04zdtm: add two tests for large ghost sparse fileLiang-Chun Chen
ghost_holes_large00 is a test which creates a large ghost sparse file with 1GiB hole(pwrite can only handle 2GiB maximum on 32-bit system) and 8KiB data, criu should be able to handle this kind of situation. ghost_holes_large01 is a test which creates a large ghost sparse file with 1GiB hole and 2MiB data, since 2MiB is larger than the default ghost_limit(1MiB), criu should fail on this test. v2: fix overflow on 32-bit arch. Signed-off-by: Liang-Chun Chen <featherclc@gmail.com>
2022-08-04unlink_largefile.desc: remove crfail, since criu now can supportLiang-Chun Chen
unlink_largefile test In the past, the unlink_largefile test should be fail on large ghost file. However, it used sparse file, it will pass in current criu, since the large ghost sparse file issue was fixed. So the crfail flag of this test should be removed. Signed-off-by: Liang-Chun Chen <featherclc@gmail.com>
2022-08-04zdtm/mnt_root_ext: don't allow propagation from test mntns to criu mntnsPavel Tikhomirov
This test specifically wants to create external bind-mount of "/" from criu mntns to test mntns, and it wants "/" in criu mntns to be a shared mount so that "external" mount in the test mntns is it's slave. This is to triger specific dirname() resolution which happens only when sharing restore is involved for external mounts, and only if rootfs is involved. But initially I missed that when we create external mount in test's temporary mntns it creates a propagation in criu mntns on top of root mount. This mount may influence other tests restore as child mount in root mount converts to locked child mount in criu service mntns (for uns flavour) and when criu would restore root container mount it would fail with EINVAL on non recursive bind with locked children. To fix this mess we just need to prohibit propagating from tests temporary mntns to criu mntns by making mounts slave. Fixes: #1941 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-08-04zdtm: make root mount private in criu mntnsPavel Tikhomirov
If root mount in criu mntns is slave, it would be slave of host mount where criu is stored, so if someone mounts something in subdir of {criu-dir}/test/ on host while tests are running this mount can influence the test as it appears on top of root mount in criu mntns. 1) With mount-compat this mount can get into restored test mntns, which means wrong restore, as this mount was not there on dump. 2) With mount-v2 this mount would just fail container restore, as root container mount is mounted non-recursively to protect from unexpected mounts appear after restore. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-07-23zdtm: Remove permission part check for skipping vsyscall vmaBui Quang Minh
Normally, vsyscall vma has VM_READ, VM_EXEC permission. However, when CONFIG_LEGACY_VSYSCALL_XONLY=y, that vma only has VM_EXEC. This commit removes the permission part when checking to skip vsyscall vma in x32 tests. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2022-07-13Add --skip-file-rwx-check opt testYounes Manton
Add a simple test using tail to check that processes can't be restored by default when the r/w/x mode of an open file changes, unless --skip-file-rwx-check is used. Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
2022-07-02zdtm: add tests for SIGTSTPYuriy Vasiliev
stopped03 check that stopped by SIGTSTP tasks are restored correctly. stopped04 check that stopped by SIGSTOP tasks which have blocked SIGTSTP and have SIGTSTP pending are restored correctly. Signed-off-by: Yuriy Vasiliev <yuriy.vasiliev@openvz.org>
2022-06-22ci: Fix code indentRadostin Stoyanov
This patch contains auto-generated changes from `make indent` Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2022-06-20zdtm: add mnt_root_ext testPavel Tikhomirov
This test has one external mount [criumntns] /zdtm_root_ext.tmp -> [testmntns] /mnt_root_ext.test, and it specifically gives '--external mnt[MNT]:.zdtm_root_ext.tmp' option on restore without '/' to make dirname on it return static '.' path (see glibc dirname() code) and reproduce a segfault in resolve_mountpoint(). Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-06-13zdtm: test multiple ext bindmounts with no common root and same masterPavel Tikhomirov
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-06-13zdtm/scm: add scm09 test with closed sender fdPavel Tikhomirov
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-05-13zdtm: skip zdtm/static/shm-hugetlb when hugetlb is not supportedAlexander Mikhalitsyn
Reported-by: Mr. Jenkins (ppc64le) Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-05-13Revert "ci: skip new hugetlb maps09/maps10 tests for pre-dump"Bui Quang Minh
This reverts commit 37ea8c5fcfef2108800b6d53054f3a7c4f710752. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
2022-05-05ci: skip new hugetlb maps09/maps10 tests for pre-dumpAlexander Mikhalitsyn
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-05zdtm: handle the case when hugetlb isn't supportedAlexander Mikhalitsyn
Fixes: e2e02bc83e ("zdtm: Add MAP_HUGETLB memory mapping test") Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29bpf: update deprecated APIRadostin Stoyanov
bpf_create_map_xattr() has been replaced with bpf_map_create() https://github.com/libbpf/libbpf/commit/6cfb97c DECLARE_LIBBPF_OPTS has been renamed to LIBBPF_OPTS https://github.com/libbpf/libbpf/commit/ea6c242 Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2022-04-29ci: criu-fault: skip inotify_irmap fault-injection on btrfsAlexander Mikhalitsyn
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-29zdtm: temporary disable rseq02 testAlexander Mikhalitsyn
That's strange but rseq02 test fails with: 09:06:16.222: 51: exit 555f52082120 555f52082120 09:06:16.282: 51: exit 555f52082120 555f52082120 09:06:16.340: 51: exit 555f52082120 555f52082120 09:06:16.397: 51: exit 555f52082120 555f52082120 09:06:16.503: 51: exit 0 555f52082120 09:06:16.503: 51: FAIL: rseq02.c:235: Failed to increment per-cpu counter (errno = 2 (No such file or directory)) 09:06:16.503: 51: FAIL: rseq02.c:246: (errno = 16 (Device or resource busy)) It means that rseq_cs pointer was cleaned up by the kernel despite of NO_RESTART* flags. That's a hardly reproducible and I will investigate that. Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29zdtm: add rseq02 transition test with NO_RESTART CS flagAlexander Mikhalitsyn
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29zdtm: add transition/rseq01 test for amd64Alexander Mikhalitsyn
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29zdtm/static/rseq00: fix rseq test when linking with a fresh GlibcAlexander Mikhalitsyn
Fresh Glibc does rseq() register by default. We need to unregister rseq before registering our own. Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29zdtm: add basic static/rseq00 test for rseq C/RAlexander Mikhalitsyn
Here we just want to check that if rseq was registered before C/R it remains registered after it. Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2022-04-29cgroup: test for --manage-cgroups=ignoreAdrian Reber
Test to ensure that --manage-cgroups=ignore works correctly. Signed-off-by: Adrian Reber <areber@redhat.com>
2022-04-29Fix remaining codespell warningsKir Kolyshkin
Those that codespell have a few variants for: ./soccr/soccr.c:219: thise ==> these, this ./soccr/soccr.c:444: sence ==> sense, since ./criu/net.c:665: ot ==> to, of, or ./criu/net.c:775: ot ==> to, of, or ./criu/files.c:1244: wan't ==> want, wasn't ./criu/kerndat.c:1141: happend ==> happened, happens, happen ./criu/mount-v2.c:781: carefull ==> careful, carefully ./test/zdtm/static/socket_aio.c:54: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen6.c:73: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen.c:73: Chiled ==> Child, chilled ./test/zdtm/static/socket_listen4v6.c:73: Chiled ==> Child, chilled ./test/zdtm/static/sk-unix-dgram-ghost.c:201: childs ==> children, child's ./test/zdtm/static/sk-unix-dgram-ghost.c:205: childs ==> children, child's ./compel/arch/x86/src/lib/infect.c:297: automatical ==> automatically, automatic, automated While at it, do some other minor fixes in the same lines. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29Fix some codespell warningsKir Kolyshkin
Brought to you by codespell -w (using codespell v2.1.0). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/zdtm.py: rename a varKir Kolyshkin
Codespell thinks that pres is a misspelled pres. Rename to pre. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/exhaustive/unix.py: rename a varKir Kolyshkin
Codespell thinks that froms is misspelled forms. Indeed it looks ugly. Rename to from_set. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/javaTests: rename ser to sKir Kolyshkin
Codespell thinks it is a misspelled "set", and it looks that way. Use s. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29Typo: mmaped -> mmappedKir Kolyshkin
It is mapped, not maped. Same applies for mmap I guess. Found by codespell, except it wants to change it to mapped, which will make it less specific. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/zdtm/static: s/NODEL/NO_DEL/Kir Kolyshkin
Codespell thinks that NODEL is a misspelled MODEL. Indeed it looks that way. Add an underscore. Do the same for the file names. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/zdtm/static/inotify_system.c: s/inot/infd/Kir Kolyshkin
Codespell thinks that "inot" is a misspelled "into". Rename to infd ("inotify fd") to make it happy. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29test/zdtm/static: use param not parmKir Kolyshkin
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-29zdtm: use unique holder for cgroupsAndrei Vagin
The idea that each zdtm.py should have own helder, so that two zdtm.py that are running on the same host don't effect each other. Fixes: #1774 Signed-off-by: Andrei Vagin <avagin@google.com>
2022-04-29zdtm/mount-v2: disable pty-console testPavel Tikhomirov
[root@fedora criu]# ./test/zdtm.py run -t zdtm/static/pty-console --iters 2 --keep-going --ignore-taint [WARNING] Option --keep-going is more useful when running multiple tests userns is supported === Run 1/1 ================ zdtm/static/pty-console ====================== Run zdtm/static/pty-console in uns ====================== Start test Test is SUID ./pty-console --pidfile=pty-console.pid --outfile=pty-console.out Run criu dump Run criu restore Run criu dump =[log]=> dump/zdtm/static/pty-console/62/2/dump.log ------------------------ grep Error ------------------------ b'(00.009325) 101 fdinfo 3: pos: 0 flags: 100000/0' b'(00.009332) Dumping path for 3 fd via self 19 [/zdtm/static]' b'(00.009345) 101 fdinfo 4: pos: 0 flags: 100002/0' b'(00.009352) tty: Dumping tty 20 with id 0xc' b"(00.009358) Error (criu/files-reg.c:1710): Can't lookup mount=1647 for fd=4 path=/ptmx" b'(00.009361) ----------------------------------------' b'(00.009369) Error (criu/cr-dump.c:1368): Dump files (pid: 101) failed with -1' b'(00.009696) Running network-unlock scripts' b'(00.012401) Unfreezing tasks into 1' b'(00.012410) \tUnseizing 86 into 1' b'(00.012415) \tUnseizing 101 into 1' b'(00.012428) Error (criu/cr-dump.c:1788): Dumping FAILED.' ------------------------ ERROR OVER ------------------------ ################ Test zdtm/static/pty-console FAIL at CRIU dump ################ Test output: ================================ <<< ================================ Send the 9 signal to 86 Wait for zdtm/static/pty-console(86) to die for 0.100000 ##################################### FAIL ##################################### Restore on second iteration with mount-v2 fails, that is because devpts_restore which is called from do_new_mount_v2 via fstype->restore opens ptmx file in service mntns and saves it to fdstore for later use. So after first c/r open ptmx fd changes mnt_id in fdinfo to a detached mount. Let's just disable mount-v2 for this test for now. FIXME: We should create separate fstype hook to do_mount_in_right_mntns, so that we can open files from this hook in actual restored mntns. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29test/jenkins: test for old mount enginePavel Tikhomirov
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-29ci: make others/mnt_ext_dev also run for old mount enginePavel Tikhomirov
Now when we switched to mount-v2 by default to check old mount engine we need to explicitly run with --mntns-compat-mode option. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29zdtm/mount-v2: disable mnt_tracefs testPavel Tikhomirov
We can have tracefs separate mount from debugfs and that's why the /sys/kernel/debug external mount now has children and this thing is not supported to be bind in container with children, because we don't wan't external mounts to introduce some unexpected extra external mounts so we bind them without MS_REC in mount-v2 unlike in old mount engine. We can either bind without MS_REC when constructing test or provide all children mount as separate external mounts to criu, let's just disable for now. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/87875c023 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29zdtm: add propagation group with mount flags to mount_complex_sharingPavel Tikhomirov
Before mounts-v2 we have seen mounts loosing their mount readonly flags when they were in a propagation group, because CRIU "forgot" to set them, with new mount engine it should work now as all propagations are now created on the same path there all other normal mounts are created, and all mount flags are restored. This test actually mounts only one mount, other three are propagations, lets set mount ro flag for half of them. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/22584993d FIXME: need to check options restored right as we don't have --check-mounts to do this job for us. Reviewed-by: Alexander Mikhalitsyn (Virtuozzo) <alexander@mihalicyn.com> Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29zdtm: add mount_complex_sharing testPavel Tikhomirov
Mounts-v2 engine should fix multiple problems of old engine relative to sharing options, lets add a test for such problems. Add all four types of shared groups: 1) private, 2) shared, 3) slave and 4) slave+shared for mounts. Propagate them into sharing and after propagation change sharing with four ways: 1) don't change, 2) make private, 3) make slave and 4) make private + make shared. This brings 16 cases of different sharing options for mount propagation, lets check that they all are restored fine. Lets create mounts from description to make it easier to improve this test in future. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/8bcd0034d FIXME: need to check options restored right as we don't have --check-mounts to do this job for us. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29zdtm: add new mnt_ext_sharing test for mount-v2Pavel Tikhomirov
These test simply checks that sharing between two mounts in container: 1) external mount and 2) it's bind persists (case when bind has the same mountpoint). Note: on old mount engine mounts inside container become also shared with mount in criu mount namespace (outside container) after c/r which is not right. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/76a09e850 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-29zdtm: enable mounts compat mode on restore with --mntns-compat-mode optionPavel Tikhomirov
Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/e4a430e1f Changes: prepend --mntns-compat-mode to r_opts in zdtm.py so that we can disable this option with --no-mntns-compat-mode from test desc files. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>