Commit graph

538 commits

Author SHA1 Message Date
Andrey Vagin
254342be4e test/rpc: fix test execution
* fix compilation from the test/rpc directory

$ make
make: *** No rule to make target `/rpc.proto', needed by `rpc.pb-c.c'. Stop.

* use absolute path for pidfile

$ bash run.sh
**************************************************
		Shutdown service server
**************************************************

cat: pidfile: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ...
or kill -l [sigspec]

Cc: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:46:05 +04:00
Andrey Vagin
caacf3f0b8 zdtm: suppress the message "Nothing to be done for 'all'"
Execute zdtm/live/static/env00
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST
Dump 18232
Restore
Check results 18232
14:53:59.615: 18232: PASS
Test: zdtm/live/static/env00, Result: PASS
ZDTM tests PASS.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:32 +04:00
Andrey Vagin
e493d3863d zdtm: improve printing of separator lines
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:25 +04:00
Andrey Vagin
a4118a6e82 zdtm: show logs only in verbose mode
It's may be useful for Jenkins or other auto executors, but human would
prefer to open log file in text editor rather than scroll a terminal
history.

The error message in non-verbose mode contains only critical information
such as error messages and paths to log files.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:19 +04:00
Andrey Vagin
b24d488dc9 zdtm: use full paths in commands and log messages
I like copy past. Currently zdtm.sh uses paths relative to the
directory test, but I work ralative to the root of the source tree.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-08 16:45:13 +04:00
Ruslan Kuprieiev
1f8768dff1 test: rpc: fix log_level in test.c and add log_level to test.py
Hi!

Added "has_log_level = true" to test.c, so "log_level = 4" would have effect.
Also added log_level to test.py, for symmetry with test.c.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-14 13:21:22 +04:00
Pavel Emelyanov
d516257151 zdtm: Write netns test in
It was written but wasn't included into standard run because
ip tool with needed functionality wasn't available "upstream".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-04 02:54:56 +04:00
Pavel Emelyanov
eb3fc256f3 zdtm: Basic checks for iptables save and restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-04 02:54:28 +04:00
Ruslan Kuprieiev
f5cd8bfdc3 test: rpc: restore
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-02 20:17:08 +04:00
Ruslan Kuprieiev
398705d4cb rpc: rename criu_dump_req to criu_opts
Lets rename CriuDumpReq to CriuOpts, for the sake of readability and to
avoid coping code for restore mechanism, as CriuDumpReq and
CriuRestoreResp would have almost the same fields. Also, it would be
easier to introduce other types of requests.

Signed-off-by: Ruslan Kuprieiev <kurpuser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-02 16:04:11 +04:00
Andrey Vagin
bd8876d2d1 zdtm: fix syntax error in zdtm.sh
./zdtm.sh: line 231: local: `lname,': not a valid identifier
./zdtm.sh: line 251: local: `ldir,': not a valid identifier

https://bugzilla.openvz.org/show_bug.cgi?id=2763
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-01 23:44:04 +04:00
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 889a21292f.

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 21d94e0086.

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