Commit graph

591 commits

Author SHA1 Message Date
Andrey Vagin
485766bc38 zdtm: check posix_timer with sival_ptr = NULL
Here is a regresion test cae for

commit 1934e1a963
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Feb 18 16:53:00 2014 +0400

    posix-timer: take into account that sival_ptr can be NULL (v3)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-11 22:17:17 +04:00
Andrey Vagin
223a998265 zdtm/tempfs: check that overmounted parts are restored (v2)
v2: check that plain file opened on tempfs
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 20:32:51 +04:00
Tikhomirov Pavel
f65714de1b v2 test: auto-dedup on restore
Use maps04, on tmpfs, check if size of pages image is zero in the end

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 14:12:18 +04:00
Tikhomirov Pavel
0766cf39c0 v2 test: auto-deduplication on restore
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 14:12:00 +04:00
Andrey Vagin
8dd4134189 test: add scripts, which are used by jenkins (v2)
v2: split one job on a few parts
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:30:22 +04:00
Andrey Vagin
5fab7f3239 maps007: save core files in a error case
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:29:31 +04:00
Andrey Vagin
e16f0976fc zdtm/maps007: remove spinlocks from the test
Use futex for synchronization instead of spinning on atomic variables.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:18:44 +04:00
Andrey Vagin
8ce7ef75ec zdtm/lock: add futex_add_and_wake and futex_wait_while_lt
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:18:43 +04:00
Andrey Vagin
1b16fa048c zdtm/maps007: limit delta betwen parent and child from both sides
Currenty a parent can go far away from child and we will need to wait
too long for checking results.

This pach limits delta to [MIN_DELTA, 2 * MIN_DELTA].

Thi patch should fix current errors for the CRIU-iter job in Jenkins.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:09:32 +04:00
Andrey Vagin
1a89dbb5da zdtm/lock: make futex_inc and futex_dec atomical
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-28 13:09:19 +04:00
Andrey Vagin
db3371bea1 zdtm: add maps007 in the test list
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-18 19:37:11 +04:00
Christopher Covington
d6005ed12e Use SRCARCH internally
ARCH is a user-facing variable and setting it on the command line
clobbers any manipulation attempted in the makefile. Following
the example of the Linux kernel makefiles, use a SRCARCH variable
instead for the internal, potentially fixed-up, architecture name.
This fixes the following error.

make ARCH=x86_64
Makefile:69: *** "The architecture x86_64 isn't supported".  Stop.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:33:47 +04:00
Pavel Emelyanov
1c265edd37 zdtm: A bunch of test for various flavors of unlinked/opened/maped files
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-05 16:18:37 +04:00
Andrey Vagin
084a1f7dea zdtm: setup sigchld handler after starting the test
When a process is started in a new pid namespace, the init process must
colleck zombies.

But before this the init process must waits the root test process, which
returns a status of preparation stage.

Currently these two operation can race, because the both ones call waitpid().

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-04 20:58:23 +04:00
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