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
Yicheng Qin
8891bb759d test/zdtm: add -g option to generate binary only
Add -g option in zdtm.sh.

Using -g option can just generate binaries of all
tests to run in zdtm. Moreover, appending test name after
-g option can just generate the binary for the test.

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:55 +04:00
Yicheng Qin
62ca87d58b test/zdtm: clear unused variable "FILE_LOCK_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-13 14:22:42 +04:00
Andrey Vagin
eef4853cc4 zdtm: add a new test case for checking vma-s with the MAP_GROWSDOWN flags
Here are two case:
* check that a vma grows after restoring
* check that a vma can be restored if its guard page was overlapped by
  another vma.

Currently criu isn't able to dump/restore this test case. Who wants to
fix this issue?

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-09 15:40:17 +04:00
Yicheng Qin
e2c6abcb6a test/zdtm/cwd00: add error checking to cleanup code
The checking helps debug unexpected failures.

The patch is useful to debug test failure. Chdir() may meet failure
if the process does not have enough permissioin. Then, it cannot
rename in-progress output file to output file. Finally, test script
cannot catch 'PASS' flag from the output file and record it as
failure. As the result, the test fails without any error message.

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-07 12:45:06 +04:00
Yicheng Qin
fdfaf0a769 test/zdtm/cwd00: remove redundant chdir()
Label 'out' and chdir() below it are just redundant. Remove them
to make test simple.

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-07 12:43:41 +04:00
Yicheng Qin
73a6dcbc9f test/zdtm/sockets_dgram: Use shorter pathname to support
struct sockaddr_un

Struct sockaddr_un is used in program for bind() to listen on a local file.

Path is one of its attributes and only has 108-byte size. It may happen
that the path is too small to contain the whole real path, which contains
current working directory now. This may lead to two sockets listening on
the same file.

So, we change the path to be "/tmp". It ensures that filename cannot
exceed the limit.

Additionally, to run it well with namespace, make new directory named
'tmp' under constructed root.

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-07 12:27:11 +04:00
Yicheng Qin
de0c3b9519 test/zdtm/sockets_dgram: check the length of path used
Path generated in the test is copied into sun_path attribute in
struct sockaddr_un. Additional check on whether sun_path can
contain the whole path is added. It is useful because if sun_path
can only contain the first part of the path, all sockadd_un
will point to the same location, which leads to error.

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-07 12:15:36 +04:00
Andrey Vagin
b95407e264 test: check, that parasite can rollback itself (v2)
This test uses systemtap to replace random parasite command on
invalide command. The parasite code received this command and should
rollback itself. CRIU didn't recived ack, should understand that
something wrong and exits. The systemtap inverts exit code of criu.

"zdtm.sh -d" is used for executing tests and testing that the state of
processes don't corrupted.

criu should be compiled without optimizations (make DEBUG=1)

v2: randomize a command, which will be replaced
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-06 15:11:12 +04:00
Yicheng Qin
b20ee87785 test/zdtm/mountpoints: clear the umask when creating
/dev/null

Clear the umask when creating /dev/null and restore the umask
after the creation.
Mountpoints test unlinks and makes new /dev/null inside by mknod.
But in some linux, there is default umask, e.g., as 022. It means that
/dev/null created directly cannot be wrote by group and other users.
It is not reasonable because /dev/null should be accessable to all
users.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-06 14:19:52 +04:00
Cyrill Gorcunov
fe01c987a6 test: fanotify00 -- Add missing space in output
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-06 14:17:40 +04:00
Andrey Vagin
a3f7a16fe7 zdtm: check that overmounted parts of tmpfs are restored
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-05 18:06:42 +04:00
Andrey Vagin
2508d051ac zdtm: the post-dump scripts returns zero, if action is not post-dump
All scripts are executed for all actions, so if one of them failed for
any actions, crtools returns with non-zero code.
E.g: ./zdtm.sh -d ns/static/env00

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-24 19:10:49 +04:00
Andrey Vagin
29ade09411 zdtm.sh: wait page-server by a proper way
page-server is forked and the child is running in background, so a bash
variable $! contains PID of the last command, which is executed in
background.

Currently it's tcpdump and zdtm.sh is waiting it and never returns back.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-24 19:10:23 +04:00
Cyrill Gorcunov
ff0e96dcf9 zdtm: Use "post-dump" script for "-d" and "-s" option
v2:
 - Use special opcode 32 to distinguish error cases
 - Use --scripts for snapshot testings
v3:
 - test for both 32 and 0 for error code
v4: (by avagin@)
 - restore from the last snapshot
v5:
 - update comment

https://bugzilla.openvz.org/show_bug.cgi?id=2583

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-22 19:36:47 +04:00
Andrey Vagin
21d94e0086 zdtm.sh: dump traffic for *tcpbuf* tests
Sometimes these tests don't pass successfully and we need more
information to investigate the problem.

https://bugzilla.openvz.org/show_bug.cgi?id=2676
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-22 16:37:12 +04:00
Andrey Vagin
b18a4d9555 socket-tcpbuf: fix the message
The number of bytes, which were sent and received, should be
exchanged in the message

Thanked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-12 18:16:27 +04:00
Andrey Vagin
f38fe4480c zdtm: use tkill instead of kill in sigaltstack
Each signals should be sent to a proper thread..

Probably it was a reason of a error, which was caught yesterday
+ cat zdtm/live/static/sigaltstack.out
20:57:10.933:  4380:        thread in sas: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:10.934:  4380: Waiting in thread SAS
20:57:11.219:  4380: Thread may leave SAS
20:57:11.219:  4380: Leaving thread SAS
20:57:11.219:  4380:        leader in sas: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.219:  4380:             main old: at 0x6063e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             main new: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             thrd old: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380:             thrd new: at 0x6083e0 (size   0x2000 flags 0x1)
20:57:11.220:  4380: FAIL: sigaltstack.c:163: sas not restored (errno = 11 (Resource temporarily unavailable))

https://bugzilla.openvz.org/show_bug.cgi?id=2668

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-12 18:10:32 +04:00
Andrey Vagin
ae44dd36a1 zdtm: exclude vdso before modifing output of ldd
ldd pipe00:
linux-vdso.so.1 =>  (0x00007fffbb0cb000)

Currently the first part of line is dropts, if the line contains "=>",
so we need to exclude vdso, before modifing lines.

This patch fixes bug:
$ zdtm.sh ns/static/pipe00
Failed at  (0x00007fffa49fe000)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 22:32:27 +04:00
Andrey Vagin
1795ddca0e zdtm: fix path to libriries on RPi
Remove the first part from linues like this:
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d83000)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 19:05:31 +04:00
Andrey Vagin
ab9296cf61 zdtm: hide output of commands, which checks existence of something
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:35:59 +04:00
Andrey Vagin
ccb2b04f7c zdtm: don't print useless messages from Makefile
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:35:51 +04:00
Andrey Vagin
9a0eedb6d2 zdtm: remove many useless messages from make
make: Entering directory `/root/crtools/test/zdtm/live/static'
make -C ../../lib
make[1]: Entering directory `/root/crtools/test/zdtm/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/crtools/test/zdtm/lib'
rm -f -f -r env00.pid env00.out* *env00.test* env00.*.test env00.state
make: Leaving directory `/root/crtools/test/zdtm/live/static'
pid00 caps00 maps01 groups sched_prio00 sched_policy00 sock_opts00 sock_opts01 cmdlinenv00 packet_sock fanotify00 sk-netlink
make: Entering directory `/root/crtools/test/zdtm/live/static'
make -C ../../lib
make[1]: Entering directory `/root/crtools/test/zdtm/lib'

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:35:40 +04:00
Andrey Vagin
0c2df44daf zdtm: remove error messages, that this directory is exist
Like this:
mkdir: cannot create directory ‘/tmp/criu-root.wt2oW0/lib64’: File exists

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:35:23 +04:00
Andrew Vagin
231f88a684 zdtm: define PAGE_SIZE in zdtmtst.h
This patches fixes compilation on Raspberry Pi and
removes a few defines from tests.

msg.c: In function ‘test_msg’:
msg.c:41:11: error: ‘PAGE_SIZE’ undeclared (first use in this function)

CC: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:31:56 +04:00
Andrey Vagin
a66a06c7f0 zdtm: wait a test process instead of output file
zdtm.sh reports error immediatly, if a test process exited or crashed.

We should be fear, that pid can be reused. There are many place, which
will fail in this case. And a chance to get this situation is really small.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 15:31:22 +04:00
Cyrill Gorcunov
535115eecd test: zdtm -- Add test for alternative signal stack
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-11 14:05:12 +04:00
Andrey Vagin
55fe093908 zdtm: don't destruct an external mount-namespace
Before doing something with mounts they should be marked as private,
otherwise our actions can affects someone else.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 13:39:22 +04:00
Pavel Emelyanov
c8f3e09f17 zdtm: Add test for semi-closed unix connection
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 02:30:14 +04:00
Cyrill Gorcunov
b62df5c986 test: app-emu -- Fix typo in command line
$pid variable get chopped by editor

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 19:39:45 +04:00
Cyrill Gorcunov
47faeca62c test: app-emu -- Use new -v syntax
We've slightly updated -v option argument parsing,
thus update cmdline used in a few app-emu tests.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 19:31:09 +04:00
Andrey Vagin
1b2c3e699b zdtm: don't take into account cpt/rst time in posix_timer
Add cpt/rst timeout to inaccuracy.

All timers are stopped during cpt/rst. We don't know in which moment
they are stopped and run, so this timeout is added to acceptable
inaccuracy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 18:41:02 +04:00
Cyrill Gorcunov
781cf5d31b zdtm: maps00 -- Add more detailed output
For easier detection where exactly test fails.

| 665: map: ptr 0x7fa96bbe4000 flag        2 prot        0
| 665: map: ptr 0x7fa96bbe2000 flag        1 prot        0
| 665: map: ptr 0x7fa96bbe0000 flag       22 prot        0
| 665: map: ptr 0x7fa96bbdb000 flag       21 prot        0
...
| 665: Read: 0, Expected: 553e7b06
| 665: Read: 0, Expected: 553e7b06
| 665: Read: 0, Expected: 553e7b06
| 665: FAIL: maps00.c:145: CRC mismatch: ptr 0x7fa96bbcb000 flag 21 prot        3

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:38:29 +04:00
Pavel Emelyanov
55b51d8f74 zdtm: Wire posix-timers test in
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:26:48 +04:00
Pavel Tikhomirov
162866feee posix-timer: Add macros to exclude periodic
Explanation of exclude periodic test is that we can't set overrun for
timer, so all checks will fail in case of big overrun before dump.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:37 +04:00
Pavel Tikhomirov
f8bb9c3653 posix-timer: Add test non consequent timer ids
Add fake timers to inshure that then timer ids don't go one after
another c/r go well.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:36 +04:00
Andrey Vagin
538e87ca92 zdtm: add a new test case, which create processes in a loop
and this processes live a short period of time. This test case is needed
for testing snapshots.

https://bugzilla.openvz.org/show_bug.cgi?id=2636
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-27 23:46:54 +04:00
Andrey Vagin
ce988e44fb zdtm.sh: check snapshot functionality
Only last iteration stops processes, all other iterations make
snapshots. Processes are restored from the last snapshot.

bash -x test/zdtm.sh -s -i 3

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:22:57 +04:00
Andrey Vagin
13a809a9fa zdtm.sh: fix indentations
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:22:36 +04:00
Pavel Emelyanov
1480708900 crtools: Fix -v option to conform to common sense
The -v option is declared as "optional argument" and thus
only -v=N or -vN are valid. Currently used -v N syntax no
longer works as expected, this will be treated as LOG_ERR
level (single -v) with dangling (unparsed) argument.

Sorry for that :( but it's better to this earlier.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-11 20:12:03 +04:00
Cyrill Gorcunov
afd4b007b4 zdtm.sh: Rename crtools to criu
The jenkins framework might need some lifting up
(crtools.$commit changed to criu.$commit).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:59:45 +04:00
Cyrill Gorcunov
af474de609 Drop crtools word from zdmt C code
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:58:43 +04:00
Cyrill Gorcunov
3c6180ac0b Use criu instead of crtools in test scripts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:58:05 +04:00
Alexander Kartashov
f7b9f0a2d7 zdtm: added a test validating ARM NEON checkpoint/restore
This patch adds the test static/arm-neon00 modelled
after the test static/fpu00: it initializes ARM NEON
registers before a checkpoint, carries out a simple
computation on ARM NEON after a restore and compares
the result against the result of the same computation
carried out before a checkpoint.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-01 22:45:51 +04:00
Vladimir Davydov
5dbab1a711 zdtm: check one-shot posix timers
With the patch zdtm will check not only periodic timers, but also
one-shot ones.

 Set one-shot timer to expire in a very long interval (INT_MAX in the
 test), and check its remaining value after checkpoint/restore. The
 following relationship must hold:

 initial_value - remaining_value = time_passed

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-24 13:04:52 +04:00
Andrey Vagin
fc07b9ae0e zdtm.sh: save archive with dump files
An archive is saved in unsuccessful case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-23 20:30:10 +04:00
Andrey Vagin
97ee174a99 zdtm.sh: use tmpfs for dump files
It's optional. It's going to be used in jenkins.

time bash -x test//zdtm.sh  static/maps04
real	0m40.220s
user	0m0.096s
sys	0m12.822s

time bash -x test//zdtm.sh -t static/maps04
real	0m9.904s
user	0m0.074s
sys	0m1.630s

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-23 20:29:49 +04:00
Andrey Vagin
c9c9fe479e zdtm: fix sigpending to check blocked signal masks
Here are a few bugs which hide each other.
* memcmp(&newset, &oldset, sizeof(newset) returns 0 is masks are equal.
* sigprocmask return sigset_t and it contains extra bits for the future,
so we need to initialize all this bits otherwise they will contain
random data.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-23 20:27:58 +04:00
Andrey Vagin
084a630dfd zdtm: use a current stack for preccesses created by clone()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-21 19:05:38 +04:00
Cyrill Gorcunov
11b525f30e zdtm: Update proc-self test
The link must be read after restore on original
file descriptor since namespace id do change between
c/r sessions.

https://bugzilla.openvz.org/show_bug.cgi?id=2599

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-21 13:09:37 +04:00
Andrey Vagin
b2846be8c3 page-server: introduce the --daemon long option
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-20 19:11:19 +04:00