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
2020-02-04zdtm: nft tables preservation testAlexander Mikhalitsyn
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-04style: Enforce kernel style -Wstrict-prototypesNicolas Viennot
Include warnings that the kernel uses during compilation: -Wstrict-prototypes: enforces full declaration of functions. Previously, when declaring extern void func(), one can call func(123) and have no compilation error. This is dangerous. The correct declaration is extern void func(void). Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com> [Generated a commit message from the pull request] Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-02-04style: Enforce kernel style -Wdeclaration-after-statementNicolas Viennot
Include warnings that the kernel uses during compilation: -Wdeclaration-after-statement: enforces having variables declared at the top of scopes Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com> [Generated a commit message from the pull request] Signed-off-by: Dmitry Safonov <dima@arista.com>
2020-02-04zdtm: Add test for SO_KEEPALIVERadostin Stoyanov
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2020-02-04zdtm: sysctl net.unix.max_dgram_qlen value preservation testAlexander Mikhalitsyn
Test checks that if the /proc/sys/net/unix/max_dgram_qlen value has been changed in process net namespace, then it is saved after c/r. Signed-off-by: Alexander Mikhalitsyn <alexander@mihalicyn.com> Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
2020-02-04Add File-based Java Functional TestsNidhi Gupta
Signed-off-by: Nidhi Gupta <itsnidhi16@gmail.com>
2020-02-04zdtm/socket-tcp-fin-wait1: Use array index fro TEST_MSGDmitry Safonov
Fixes the following compile-error: > CC socket-tcp-fin-wait1.o > socket-tcp-fin-wait1.c:144:26: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] > if (write(fd, TEST_MSG + 2, sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) { > ~~~~~~~~~^~~ > socket-tcp-fin-wait1.c:144:26: note: use array indexing to silence this warning > if (write(fd, TEST_MSG + 2, sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) { > ^ > & [ ] > 1 error generated. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04build/zdtm: Use pkg-config to find includes/libsDmitry Safonov
Helps to cross-compile zdtm tests in case somebody needs it. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04build/zdtm: Makefile hack for travis aarch64/armv8lDmitry Safonov
The very same hack to build aarch32 zdtm tests on armv8 Travis-CI as in the commit dfa0a1edcbcb ("Makefile hack for travis aarch64/armv8l") Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04build/zdtm: Support cross-buildDmitry Safonov
Maybe not that useful, but only little change needed. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04build: Use SUBARCHDmitry Safonov
Instead of doing additional `uname -m` - use provided $(SUBARCH) to detect what architecture flavour the build should produce the result for. Fixes two things: - zdtm make now correctly supplies $(USERCFLAGS) - subtly fixes cross compilation by providing a way to specify $(SUBARCH) Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04build: Remove SRCARCHDmitry Safonov
SRCARCH is always equal ARCH. There are no rules when to use one or another and architectures may forget to set one of them up. No need for a second variable meaning the same and confusing people. Remove it completely. Self-correction [after some debug]: SRCARCH was different in one place: zdtm Makefile by some unintentional mistake: > ifeq ($(ARCH),arm64) > ARCH ?= aarch64 > SRCARCH ?= aarch64 > endif That meant to be "ARCH := aarch64" because "?=" would never work inside that ifeq. Fix up this part of mess too. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04zdtm: Set --root path to 0700 on restoreAndrei Vagin
Update zdtm tests to verify that CRIU does not require the --root path to be accessible to the unprivileged user being restored when restoring user namespace. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2020-02-04zdtm: Replace if->continue with if->elif->elseRadostin Stoyanov
Replacing the if->continue pattern with if->elif->else reduces the number of lines while preserving the logic. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2020-02-04test/java: Add FileRead TestsNidhi Gupta
Signed-off-by: Nidhi Gupta <itsnidhi16@gmail.com>
2020-02-04test/static:conntracks: Support nftablesVitaly Ostrosablin
Update test to support both iptables and nft to create conntrack rules. Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04Add `criu` to PATH env variable in libcriu testsAshutosh Mehra
PATH is pointing to incorrect location for `criu` executable causing libcriu tests to fail when running in travis. Also added statements to display log file contents on failure to help in debugging. Signed-off-by: Ashutosh Mehra <asmehra1@in.ibm.com>
2020-02-04Couple of fixes to build and run libcriu testsAshutosh Mehra
libcriu tests are currently broken. This patch fixes couple of issues to allow the building and running libcriu tests. 1. lib/c/criu.h got updated to include version.h which is present at "criu/include", but the command to compile libcriu tests is not specifying "criu/include" in the path to be searched for header files. This resulted in compilation error. This can be fixed by adding "-I ../../../../../criu/criu/include" however it causes more problems as "criu/include/fcntl.h" would now hide system defined fcntl.h Solution is to use "-iquote ../../../../../criu/criu/include" which applies only to the quote form of include directive. 2. Secondly, libcriu.so major version got updated to 2 but libcriu/run.sh still assumes verion 1. Instead of just updating the version in libcriu/run.sh to 2, this patch updates the libcriu/Makefile to use "CRIU_SO_VERSION_MAJOR" so that future changes to major version of libcriu won't cause same problem again. Signed-off-by: Ashutosh Mehra <asmehra1@in.ibm.com>
2020-02-04image: avoid name conflicts in image filesAndrei Vagin
Conflict register for file "sk-opts.proto": READ is already defined in file "rpc.proto". Please fix the conflict by adding package name on the proto file, or use different name for the duplication. Note: enum values appear as siblings of the enum type instead of children of it. https://github.com/checkpoint-restore/criu/issues/815 Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04zdtm: handle --pre-dump-mode in the rpc modeAndrei Vagin
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04Adding --pre-dump-mode optionAbhishek Dubey
Two modes of pre-dump algorithm: 1) splicing memory by parasite --pre-dump-mode=splice (default) 2) using process_vm_readv syscall --pre-dump-mode=read Signed-off-by: Abhishek Dubey <dubeyabhishek777@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04zdtm/cgroup_yard: create a test cgroup yard from the post-start hookAndrei Vagin
Right now, it is created from the pre-dump hook, but if the --snap option is set, the test fails: $ python test/zdtm.py run -t zdtm/static/cgroup_yard -f h --snap --iter 3 ... Running zdtm/static/cgroup_yard.hook(--pre-dump) Traceback (most recent call last): File zdtm/static/cgroup_yard.hook, line 14, in <module> os.mkdir(yard) OSError: [Errno 17] File exists: 'external_yard' Cc: Michał Cłapiński <mclapinski@google.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04test/cgroup_yard: always clean up a test cgroup yardAndrei Vagin
Right now it is cleaned up from a post-restore hook, but zdtm.py can be executed with the norst option: $ zdtm.py run -t zdtm/static/cgroup_yard --norst ... OSError: [Errno 17] File exists: 'external_yard' Cc: Michał Cłapiński <mclapinski@google.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-02-04test: implement test for new --cgroup-yard optionMichał Cłapiński
Signed-off-by: Michał Cłapiński <mclapinski@google.com>
2019-09-07test/others: Reuse setup_swrk()Radostin Stoyanov
Reduce code duplication by taking setup_swrk() function into a separate module that can be reused in multiple places. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07test/other: Resolve Py3 compatibility issuesRadostin Stoyanov
When Python 2 is not installed we assume that /usr/bin/python refers to version 3 of Python and the executable /usr/bin/python2 does not exist. This commit also resolves a compatibility issue with Popen where in Py2 file descriptors will be inherited by the child process and in Py3 they will be closed by default. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07py: Reformat everything into pep8 styleAndrei Vagin
As discussed on the mailing list, current .py files formatting does not conform to the world standard, so we should better reformat it. For this the yapf tool is used. The command I used was yapf -i $(find -name *.py) Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2019-09-07zdtm: make inotify04 require restorePavel Tikhomirov
After adding the test for fake inotify events cleanup on restore, we've detected that we also have the same problem on dump/predump, criu touches files that are watched and generates fake events: [root@snorch criu]# test/zdtm.py run -t zdtm/static/inotify04 --norst -k always === Run 1/1 ================ zdtm/static/inotify04 ======================== Run zdtm/static/inotify04 in h ======================== Start test ./inotify04 --pidfile=inotify04.pid --outfile=inotify04.out --dirname=inotify04.test Run criu dump =[log]=> dump/zdtm/static/inotify04/36/1/dump.log ------------------------ grep Error ------------------------ (00.004050) fsnotify: openable (inode match) as home/snorch/devel/criu/test/zdtm/static/inotify04.test/inotify-testfile (00.004052) fsnotify: Dumping /home/snorch/devel/criu/test/zdtm/static/inotify04.test/inotify-testfile as path for handle (00.004055) fsnotify: id 0x000007 flags 0x000800 (00.004071) 36 fdinfo 5: pos: 0 flags: 4000/0 (00.004080) Warn (criu/fsnotify.c:336): fsnotify: The 0x000008 inotify events will be dropped ------------------------ ERROR OVER ------------------------ Send the 15 signal to 36 Wait for zdtm/static/inotify04(36) to die for 0.100000 ############### Test zdtm/static/inotify04 FAIL at result check ################ Test output: ================================ 18:20:10.558: 36: Event 0x20 18:20:10.558: 36: Event 0x10 18:20:10.558: 36: Event 0x20 18:20:10.558: 36: Event 0x10 18:20:10.558: 36: Event 0x20 18:20:10.558: 36: Event 0x10 18:20:10.558: 36: Event 0x20 18:20:10.558: 36: Event 0x10 18:20:10.558: 36: Read 8 events 18:20:10.558: 36: FAIL: inotify04.c:105: Found 8 unexpected inotify events (errno = 11 (Resource temporarily unavailable)) <<< ================================ ##################################### FAIL ##################################### To suppress fails in jenkins make the inotify04 test 'reqrst'. Still need to cleanup (or do not create) these events on dump/predump.
2019-09-07test: bring the lo interface up in each network namespaceAndrei Vagin
This is needed to workaround the problem with "ip route save": (00.113153) Running ip route save Error: ipv4: FIB table does not exist. Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm/inotify: add a test that no unexpected events appear after c/rPavel Tikhomirov
Just create two inotify watches on a testfile, and do nothing except c/r, it is expected that there is no events in queue after these. before "inotify: cleanup auxiliary events from queue": [root@snorch criu]# ./test/zdtm.py run -t zdtm/static/inotify04 === Run 1/1 ================ zdtm/static/inotify04 ======================== Run zdtm/static/inotify04 in h ======================== DEP inotify04.d CC inotify04.o LINK inotify04 Start test ./inotify04 --pidfile=inotify04.pid --outfile=inotify04.out --dirname=inotify04.test Run criu dump Run criu restore Send the 15 signal to 60 Wait for zdtm/static/inotify04(60) to die for 0.100000 =============== Test zdtm/static/inotify04 FAIL at result check ================ Test output: ================================ 18:37:14.279: 60: Event 0x10 18:37:14.280: 60: Event 0x20 18:37:14.280: 60: Event 0x10 18:37:14.280: 60: Read 3 events 18:37:14.280: 60: FAIL: inotify04.c:105: Found 3 unexpected inotify events (errno = 11 (Resource temporarily unavailable)) <<< ================================ v2: make two inotifies on the same file Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> zdtm: inotify04 add another inotify on the same file
2019-09-07Add ZDTM tests for child subreaper propertyMichał Cłapiński
1. Basic check if property is migrated 2. Check that property is restored for existing children 3. Check that child subreaper does not affect reparenting Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by: Michał Cłapiński <mclapinski@google.com> Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2019-09-07zdtm: use a proper page size for the hostAndrei Vagin
In zdtm.py, the page size is hardcoded as 4096, but on ppc64le, is is equal to 64K and all test fail with errors like this: ERROR: bad page counts, stats = 13 real = 208(0) Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07test/packet_sock_mmap: parse inode as unsigned long longAndrei Vagin
7f95a16df000-7f95a16e1000 rw-p 00000000 00:09 2183152397 socket:[2183152397] Reported-by: Mr Jenkins Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm: make grep_errors also grep warningsPavel Tikhomirov
It is inspired by the discussion about inotify fix: https://github.com/checkpoint-restore/criu/pull/728#issuecomment-506929427 From one point of view, warnings might be important to understand why we detect some visible change in the environment after c/r-ing the process, and if this change is expected or not. So we should add "Warn" messages to the output. From over point, these warnings if they are expected, can spoil our final logs with a lot of unnecessary details, so add changes in previous patches to silence the most noisy of these warnings. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2019-09-07zdtm: Add --tls optionRadostin Stoyanov
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07zdtm: Fix memory and resource leaksRadostin Stoyanov
These errors were found by Cppcheck 1.84 Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07util-vdso: Check chain for STN_UNDEFDmitry Safonov
Rather than chain[chain] != STN_UNDEF. Seems like, on !ARM32 vdso there are more symbols and less chance to hit this "feature". Fixes parsing of __vdso_clock_gettime symbol on v5.1 arm kernel. Signed-off-by: Dmitry Safonov <dima@arista.com>
2019-09-07zdtm: Check stats file presence before readingPavel Emelianov
In some cases the stats-dump file can be missing, so do not crash the whole zdtm.py in this case. https://ci.openvz.org/job/CRIU/job/criu-live-migration/job/criu-dev/2362/console Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2019-09-07test/s390: add a new patch to xtables librariesAndrei Vagin
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm: Check pages stats after dumpPavel Emelianov
After dump command -- verify that the amount of bytes counted in stats-dump matches the real sizes of pages-*.img files. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm: Add UDP broadcast testRadostin Stoyanov
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07zdtm: Simplify string to boolean conversionRadostin Stoyanov
The built-in bool() function returns a boolean value by converting the input using standard truth testing procedure. https://docs.python.org/3/library/functions.html#bool Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-09-07test/exhaustive: Replace map by list comprehensionHarshavardhan Unnibhavi
Fixes #331. https://github.com/checkpoint-restore/criu/issues/331 Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm/thread-bomb: Limit stack size in thread-bombDmitry Safonov
ia32 thread-bomb test failed when compel refused to seize the test, trying to mmap() in remote process and getting ENOMEM. It turns to be true - remote process thread-bomb was filled with 8Mb mappings created by pthread_create() (the default stack size). So, that 1024 * 8Mb is a bit too much to place in 4Gb. Fix the test on 32-bit platforms by using much smaller stack. Also check the return value of pthread_create(). Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm/vdso/ia32: Ignore vsyscall page appearDmitry Safonov
Not a major bummer. On the other side, it's also becomes less important as it seems that distribution switches from LEGACY_VSYSCALL_EMULATE to LEGACY_VSYSCALL_NONE (by security reasons). Might be not worth fixing at all in the end. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07zdtm/vdso/ia32: Use uint64_t for /proc/self/mapsDmitry Safonov
Add some comments to state things those might be not obvious. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07test/bers: Fix sizeof to memsetRikard Falkeborn
sizeof(fd) is the size of the pointer. Make sure the entire array is set by using the number of elements times the size of the elements. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07test: add missing va_endRikard Falkeborn
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07test: remove unused variablesRikard Falkeborn
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-09-07test/zdtm: Move assignment after return value checkRikard Falkeborn
If read() fails we can not use the return value as index. Move the use of it to after the error check to avoid this. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>