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

1777 Commits

Author SHA1 Message Date
Andrey Vagin
8a6c150223 zdtm: don't write more than buffer size
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-04 18:28:00 +04:00
Andrey Vagin
3d8f7b07b3 zdtm: add a bit more messages in error cases
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-04 00:20:09 +04:00
Andrew Vagin
066609769a zdtm: add more logging messages
Tests fail sometimes, but logs don't contain enough information:
Execute zdtm/live/static/umask00
./umask00 --pidfile=umask00.pid --outfile=umask00.out --mask=0345
make[3]: *** [umask00.pid] Error 1
ERROR: fail to start zdtm/live/static/umask00

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-30 15:12:56 +04:00
Andrey Vagin
10bfe8fae8 maps007: check "stop" with "delta"
We don't need to wait if a stop signal has been received.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-30 15:12:19 +04:00
Pavel Emelyanov
a0053823a5 test: Add test for tempfs mount with open file
This test fails when run in ns:

(00.300947)      1: Error (util.c:568): exited, status=1
(00.300964)      1: Error (cr-restore.c:1067): 5 exited, status=1
(00.300989)      1: Error (mount.c:637): Can't restore tmpfs content
(00.301005) Error (cr-restore.c:1602): Restoring FAILED.

Reason for failure -- tar is spawned in new mount namespace where
it can not be found (bug #2870).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:27:28 +04:00
Andrey Vagin
b99fa5749c zdtm: add transition test for memory
This test does a few operation in a loop
* create a mapping with random flags
* touch a few pages in a new mapping, if it's writable

This test has two processes. The second process goes a predefined value
of steps behind the first one. When we need to check the result, we stop
the first process, wait until the second process come to the same point
and compare these processes. The processes are dumped in different
states, but at the end both processes must be in the same state.

bash -x test/zdtm.sh -s -i 5 -r transition/maps007
...
(00.743662) Error (page-read.c:107): Missing 139773474525184 in parent pagemap, current iov: base=7f1f8c4cf000,len=4096
(00.743696) Error (page-xfer.c:523): Hole 0x7f1f8c4c5000/4096 not found in parent
(00.744196) Error (mem.c:331): Can't dump page with parasite
(00.758201) Error (cr-dump.c:1828): Dumping FAILED.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:13:53 +04:00
Tikhomirov Pavel
04b6403532 test: recoursive autodedup
verify decline in size of second parent-level image file

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:11:38 +04:00
Tikhomirov Pavel
a23765435b test: recursive deduplication
check if size of second parent-level image become smaller

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:11:37 +04:00
Andrey Vagin
d86d0f14e9 zdtm.sh: don't annotate printing separator line
It's useful, if you like execute bash -x zdtm.sh.
zdtm_sep isn't interesting for debugging needs.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-23 13:26:15 +04:00
Cyrill Gorcunov
d01025edd9 zdtm: Force lib to be built before live targets
It's ugly but should work for now. Strictly speaking
I need to rework the complete make engine used in
zdtm.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-20 14:14:27 +04:00
Andrey Vagin
fb068a50ad zdtm.sh: add ability to test pre-dump (v2)
./test/zdtm.sh -i 2 -P ns/static/env00

v2: make the help message a bit more detailed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-16 22:08:52 +04:00
Pavel Emelyanov
04fde2e178 mem: Don't track memory changes if --track-mem is not specified
We have a big mistake in how we track for ptes to be SOFT_DIRTY -- no
need in these checks if the --track-mem is not given.

While fixing this, remember proper checks for the kernel memory tracker.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reported-by: Tim Schürmann <info@tim-schuermann.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-16 22:07:44 +04:00
Andrey Vagin
21b5bcc075 zdtm/make: return .PHONY for default
I don't why it is required here, but make doesn't work w/o it

make[2]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/live/static'>
make[1]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/live'>
set -e; for d in lib live; do make -C $d default; done
make[1]: Entering directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/lib'>
make[1]: *** No rule to make target `default'.  Stop.
make[1]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/lib'>
make: *** [default] Error 2

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-15 14:08:40 +04:00
Andrew Vagin
c0a8672912 zdtm: remove .PHONY from proxy make files
These files doesn't have own rules

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-14 23:10:12 +04:00
Kir Kolyshkin
75fef9a6fb test/*/Makefile: fix PHONY targets
Broken by my commit 1fa0c0c05. I swear I was not drunk.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 20:24:48 +04:00
Kir Kolyshkin
fe0a9670f3 simplify dummy rules
Use true instead of echo >/dev/null -- same effect, less bytes.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:14:18 +04:00
Kir Kolyshkin
55fca14c80 make clean: fix
When running 'make clean' from the top dir, the following error happens:

 make[3]: Leaving directory `/vz/kir/git/criu/test/zdtm/live/static'
 make[2]: Leaving directory `/vz/kir/git/criu/test/zdtm/live'
 set -e; for d in lib live; do make -C $d cleanout; done
 make[2]: Entering directory `/vz/kir/git/criu/test/zdtm/lib'
 make[2]: *** No rule to make target `cleanout'.  Stop.
 make[2]: Leaving directory `/vz/kir/git/criu/test/zdtm/lib'
 make[1]: *** [cleanout] Error 2
 make[1]: Leaving directory `/vz/kir/git/criu/test/zdtm'
 make: *** [clean] Error 2

Fix by adding dummy cleanout target to test/zdtm/lib/Makefile

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:13:47 +04:00
Kir Kolyshkin
40492dc33d test/zdtm/lib/Makefile: more PHONY targets
Forgot these ones

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:13:23 +04:00
Kir Kolyshkin
1fa0c0c058 test/*Makefile: add/append PHONY targets
...where they are missing.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:12:35 +04:00
Kir Kolyshkin
55c8be1c16 test/zdtm/lib/Makefile: rm unused targets from PHONY
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:12:28 +04:00
Andrey Vagin
10da1303d6 mounts/ext: fix path to the test file
[root@avagin-fc19-cr ext]# bash run.sh
+ make
make: Nothing to be done for `all'.
+ criu=../../../criu
+ finf=finish
+ outf=run_output
+ pidfile=pid_wait
+ tempd=temp_dir
+ sfile=source_file
+ tdir=test_dir
+ dfile=dest_file
+ mesg=msg-35
+ export finf
+ export outf
+ export pidfile
+ export sfile
+ export dfile
+ export tempd
+ export mesg
+ export tdir
+ mkdir dump/
mkdir: cannot create directory ‘dump/’: File exists
+ mkdir test_dir
mkdir: cannot create directory ‘test_dir’: File exists
+ mount --bind / test_dir
+ mount --make-rprivate test_dir
+ unshare --mount ./run_ns.sh
+ set -e
+ odir=mexold
++ pwd
+ cur=/root/crtools/test/mounts/ext
+ mount --make-rprivate /
+ rm -rf temp_dir finish run_output /mexold
+ mkdir temp_dir
+ touch test_dir/dest_file
+ mount -t tmpfs none temp_dir
+ echo msg-35
+ mount --bind temp_dir/source_file
test_dir//root/crtools/test/mounts/ext/test_dir/dest_file
mount: mount point
test_dir//root/crtools/test/mounts/ext/test_dir/dest_file does not exist
+ fail 'Can'\''t unshare ns'
+ echo 'Can'\''t' unshare ns
Can't unshare ns
+ exit 1

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-31 13:54:53 +04:00
Andrey Vagin
f3cec004d9 test: show logs in case an error (v2)
Makefile is locked, because tests can be executed concurrently.

v2: return non-zero code
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-30 12:32:00 +04:00
Andrey Vagin
2379c67017 test/make: transfer arguments for zdtm.sh
make ZDTM_ARGS="-C -i 2" -C test/ zdtm_ns -j 8

make is able to execute tests concurrently.
Now we can customize execution of tests

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-30 12:31:45 +04:00
Pavel Emelyanov
f0e99650a9 zdtm: Some updates to treat NFS fds properly
First of all, silly-rename files' names may change, so
kludge the fds comparison properly.

Other than this, allow for linked-remaps on write_read10
test as it effectively generates such on NFS.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-27 21:20:33 +04:00
Pavel Emelyanov
0758b4c216 test: Test and example how to dump namespace with macvlan
One note -- the macvlan's index _does_ change. We should
either patch iproute2 or use raw kernel API to preserve it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-26 22:40:30 +04:00
Pavel Emelyanov
094affbdbb test: Test and example of external bind mounts plugin
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-26 11:07:42 +04:00
Andrey Vagin
4202acbc8f zdtm: increase the amount of allowable inaccuracy
The timeout can be exceeded during dumping and restoring.
When we are testing snapshots, the test is dumped three times.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-23 13:55:19 +04:00
Kir Kolyshkin
8692291d42 tab-at-eol cleanup
Remove whitespace at EOL (found by git grep '	$')
(the character before $ is real tab, typed in shell using Ctrl+V Tab)

To people using vim, I'd suggest adding the following code to ~/.vimrc:

let c_space_errors = 1
highlight FormatError ctermbg=darkred guibg=darkred
match FormatError /\s\+$\|\ \+\t\|\%80v.\|\ \{8\}/

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-20 16:09:08 +04:00
Andrey Vagin
0dfb077621 zdtm: test dumping character devices with help of custom callbacks
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-20 16:07:39 +04:00
Andrey Vagin
1e4b8c8c23 tests: check callback-s for dumping and restoring sockets (v2)
Here are client, server programs and two libraries for dumping client
sockets and syslog socket.

The client can ask server to save a value and then request it later.
We suppose that after dumping and restoring the client will get
the same value.

So the dump callback requests the value and save it in a file.
The restore callback creates a new socket and ask server to save the
value from the file.

v2: open a syslog socket

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-20 15:28:53 +04:00
Andrey Vagin
ca44f6f071 zdtm: add a new test, which creates and destroys threads
A thread can create another threads, if the number of threads is less
than the limit.

This test case is very useful to check criu freezer.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-19 22:53:42 +04:00
Ruslan Kuprieiev
f4f806186c test: libcriu -- check for -EBADE instead of -1
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 21:09:03 +04:00
Tikhomirov Pavel
de5fc0d1e9 v3 test/dedup: auto-dedup test
add auto-dedup when dumping the last time, and check if size become smaller

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:52:05 +04:00
Tikhomirov Pavel
96b26f6392 v3 test/dedup: dedup on "parent" before restoring
if size become smaller and restored ok, then test passed
use mem-snap.sh

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:51:45 +04:00
Ruslan Kuprieiev
ca1f60d267 test: libcriu
This test is similiar to test/rpc, and can also be used as an
example of using libcriu.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:26:12 +04:00
Pavel Emelyanov
87317c26fa zdtm: Allow to specify more than one exclude pattern
We sometimes want to exclude several tests from run. Writing
expression with \-s is annoying. Let's make it possible to
do several -x's instead.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-12 16:40:49 +04:00
Kir Kolyshkin
26fda7a319 space-before-tab whitespace cleanup
Remove space before tab characters.

Found by git grep ' 	' (Space, Ctrl-V, Tab in shell).

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-12 10:00:53 +04:00
Kir Kolyshkin
d64d68d66c whitespace-at-eol cleanup
Remove whitespace at EOL (found by git grep ' $')

To people using vim, I'd suggest adding the following code to ~/.vimrc:

let c_space_errors = 1
highlight FormatError ctermbg=darkred guibg=darkred
match FormatError /\s\+$\|\ \+\t\|\%80v.\|\ \{8\}/

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-12 10:00:45 +04:00
Andrey Vagin
ec91abf0a8 zdtm/selfexe00: append a null byte to paths
readlink() does not append a null byte to buf.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:32:00 +04:00
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