2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-27 20:37:57 +00:00

1777 Commits

Author SHA1 Message Date
Andrey Vagin
d92874697b zdtm: check, that stopped tasks are restored correctly
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-01 11:22:17 +04:00
Pavel Emelyanov
656693503e zdtm: Check that out-of-root file survives
If a task opens a file, then goes chroot, CRIU should still
be able to dump and restore the now-invisible file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-25 14:15:31 +04:00
Pavel Emelyanov
2c6b61f122 zdtm: Test for chroot
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-25 13:59:23 +04:00
Pavel Emelyanov
057adb4cdc zdtm: Check that O_APPEND is preserved properly
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-19 10:45:36 +04:00
Ruslan Kuprieiev
3c0ea1c9ca test: rpc: test.py
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-24 11:36:17 +04:00
Ruslan Kuprieiev
6c718214df test: rpc: test.c
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-24 11:36:15 +04:00
Ruslan Kuprieiev
8a200fd651 test: rpc: run.sh
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-24 11:36:14 +04:00
Ruslan Kuprieiev
4a856a5b0f test: rpc: Makefile
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-24 11:36:13 +04:00
Andrey Vagin
1dd4810af1 zdtm: check that pending signals are handled after resuming processes
This patch detects the race, when a signal hanler could be executed
during restore.
More details are in: 5d18eca restorer: Block signals early

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-23 15:25:17 +04:00
Andrey Vagin
4c52aaf441 zdtm: check that a process has the same set of VMS-s after restore
Some VMA-s can be merged on restore. For example, If a process maps
VMA1, VMA2 and then VMA3 between the previous ones.
|VMA1|VMA3|VMA2|
The VMA3 will be merged only with VMA1, but all three VMA-s will be
merged on restore, because they are mmaped in a correct order VMA1,
VMA3, VMA2.

Due to this issue, we have a small script for merging continuous VMA-s.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-23 15:23:12 +04:00
Kir Kolyshkin
31050001ac test/zdtm.sh: check for extra arguments
After parsing options we expect either 0 or 1 arguments, no more.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:41 +04:00
Kir Kolyshkin
3ef2a28e9e test/zdtm.sh: show help if unknown option is used
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:40 +04:00
Kir Kolyshkin
87368019be test/zdtm.sh: move unrecognized option to inside case
Easier that way

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:39 +04:00
Kir Kolyshkin
11d50423b9 test/zdtm.sh: move -h parsing to inside case
It's cleaner to have all options parsed in the same way (and in the same
manner).

Factor out usage() and call it when -h is found.

Also, print usage text to stdout not stderr.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:37 +04:00
Kir Kolyshkin
6f209a2e7e test/zdtm.sh: move -l parsing to inside case
It's more cleaner to have all options parsed in one place.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:36 +04:00
Kir Kolyshkin
79f09e57a0 test/zdtm.sh: use case to parse cmdline opts
Looks cleaner this way.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:35 +04:00
Kir Kolyshkin
e1e9b50016 test/zdtm.sh: fix an error message
It's got not get.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:34 +04:00
Kir Kolyshkin
711f1b7baa test/zdtm.sh: use if statements
For longer multi-line statements, let's use traditional

	if ... ; then ... fi

Short form is OK (better?) for one-liners only.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:33 +04:00
Kir Kolyshkin
1ed8e5973f test/zdtm.sh: remove space/semicolon at EOL
Just 'cause this is not C.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:32 +04:00
Kir Kolyshkin
950ce7972c test/zdtm.sh: fix an error message
It's either "are different" or "differ".
Let's use the shorter form.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:31 +04:00
Kir Kolyshkin
e60c9e8625 test/zdtm.sh: fix/improve warning text
At first I wanted to just fix spelling in "commited" and
"meainstream", but ended up using better wording for this.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:30 +04:00
Kir Kolyshkin
bbe9a2c1e6 test/zdtm.sh: require bash
There are a lot of bash-only statements in this script, so let's
ask for /bin/bash explicitly to avoid weird errors when running
on e.g. Debian which have dash installed by default.

Alternatively, we can rewrite this to be pure shell, but it's
too much work to do.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:54:29 +04:00
Andrey Vagin
fd81748a00 zdtm: increase the upstream kernel version
The kernel must be 3.11 or greater due to
29000cae ptrace: add ability to get/set signal-blocked mask (v2)

The patches for dumping tun devices are not committed in the upstream
kernel yet, so ns/static/tun is excluded.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-03 14:53:18 +04:00
Andrey Vagin
d005e3f3fe zdtm: transfer the correct test name in case_error
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-02 16:18:46 +04:00
Andrey Vagin
19670d05b1 zdtm: check an exit code of make
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-02 16:18:21 +04:00
Andrey Vagin
6201096cea zdtm: fix a race condition during concurrent execution of tests
When tests are executed concurrently all of them use
the same root, so libraries must be copied atomically.

Without this patch we can get errors like this:
cp: cannot create regular file ‘/tmp/criu-root.m45u5Y/lib64/ld-linux-x86-64.so.2’: File exists

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 15:36:52 +04:00
Andrey Vagin
fe1c16a502 test: generate a random tree of mounts
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 15:02:28 +04:00
Andrey Vagin
5f18aa4ddf zdtm: expand the mountpoints test
* check shared and slave mounts
* check bind-mounts

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 15:02:26 +04:00
Andrey Vagin
c9501e6359 zdtm: check grow-down vma-s in cow01
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 14:25:47 +04:00
Andrey Vagin
d9e7f6d117 zdtm: add grow_down test cases for regular execution
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 14:25:38 +04:00
Andrey Vagin
e6390dac5f zdtm: check that two continuous grow-down VMA-s are restored correctly
It's a special case, because if we've split the stack vma,
only the lowest one has the guard page.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-30 14:25:31 +04:00
Andrew Vagin
20a835a686 zdtm: return back tun test to auto-list
The kernel was compiled without the tun driver.

This reverts commit 889a21292f4de856a0d6d68a4c6a3b2f16aa3627.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-28 17:17:43 +04:00
Andrey Vagin
1806f0f6c5 zdtm: set the dumpable flag after setuid and setgid (v2)
setuid and setgid drops the dumpable flag, so it should be set back.
Otherwise proccesses will not able to read a few files in proc (e.g.
/proc/pid/pagemap).

This patch affects cow01:
11:50:04.429:     4: ERR: cow01.c:99: Unable to read data (errno = 13 (No such file or directory))

v2: typo fix
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-28 17:17:18 +04:00
Andrey Vagin
5b3d657707 Revert "zdtm.sh: dump traffic for *tcpbuf* tests"
This reverts commit 21d94e00866e34e518a3d8501f02f8a0a681a0b5.

This patch was created for investigating
https://bugzilla.openvz.org/show_bug.cgi?id=2676

The bug is fixed and this patch does nothing useful, because tcpdump
starts too late.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-28 17:02:49 +04:00
Ruslan Kuprieiev
f6654dc411 v4 zdtm: test semi-closed unix stream connection for data loss
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-28 16:52:45 +04:00
Pavel Emelyanov
5d66f72c92 zdtm: Check tap's hwaddr doesn't change after c/r
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-24 01:08:03 +04:00
Pavel Emelyanov
889a21292f zdtm: Drop tun test from auto-list
There's some strange setup on Jenkins boxes, so that /dev/net/tun
is inaccessible. Need to check this after holidays :(

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 19:38:12 +04:00
Pavel Emelyanov
ed5f82c7e6 zdtm: Basic checks for tun files/links are c/r-ed properly
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 19:12:00 +04:00
Yicheng Qin
7daefd9751 test/zdtm: add option -r to run test with specified name
The option can run test with specified name directly without check
or match.

It can be used to run experimental test that is not in TEST_LIST.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-21 17:33:10 +04:00
Andrey Vagin
0c5b606b48 zdtm: add a new test, where both sides of a tcp connection is dumped
Reported-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:58:14 +04:00
Andrey Vagin
4329287717 zdtm: clean up test_fork
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:57:13 +04:00
Yicheng Qin
156b1b8195 test: create env.sh for environment setting
Currently, env.sh only contains the location of criu executable.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:52:34 +04:00
Yicheng Qin
f1684be8a4 test/tcp/run.sh: fix permission
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-20 14:51:52 +04:00
Pavel Emelyanov
33c70a244e zdtm: Simplify TEST_LIST formation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:17:13 +04:00
Pavel Emelyanov
a9e10c6056 zdtm: Remove explicit namespaces specification on restore
Yet again -- namespaces are auto-detected now, no need in this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:15:59 +04:00
Pavel Emelyanov
aa7e079d8c zdtm: Remove per-namespace list
We have automatic namespaces detection, no need in this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-16 17:14:15 +04:00
Andrey Vagin
3e6f1ae82d zdtm: exit with the zero code if everything is ok
Cc: Yicheng Qin <yichengq@google.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 14:47:20 +04:00
Yicheng Qin
05745ceed4 test/zdtm: add option -n for batch test
In batch-test mode, the script skips failed individual tests
instead of exiting. This ensures that all zdtm tests can be run
in one pass, which provides better overview of test result.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 13:43:07 +04:00
Yicheng Qin
a7a787a402 test: adjust the output for tests
Adjust the format of information printed.
Print out more necessary debug information.
Display error message in STDERR and make it more readable.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-14 13:43:06 +04:00
Yicheng Qin
073af12d5f test/zdtm: use TEST_PATTERN as argument
Use TEST_PATTERN instead of TEST_NAME as argument.
All previous zdtm commands can be used still.
It is useful to run certain part of tests.

Example of running in-namespace tests only:
	./test/zdtm.sh ^ns/.*

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-13 14:24:57 +04:00