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

1777 Commits

Author SHA1 Message Date
Cyrill Gorcunov
a016bc84ff zdtm: pthread00 -- Use exit_group where appropriate
Reported-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 20:11:10 +04:00
Cyrill Gorcunov
88ec6bc4ce zdtm: pthread01 -- Add human readable signals printouts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:43 +04:00
Cyrill Gorcunov
bcc7bab7e3 zdtm: Use SIGWINCH+SIGALRM instead of SIGTRAP in pthread01
Otherwise test with -d option get fail (this is because
SIGTRAP get cleared by our parasizte engine).

The proper fix most likely will require kernel patching
or redesign of parasite code. Meanwhile to make test
working we switch to the signal which just known to work.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:29 +04:00
Cyrill Gorcunov
b675d8a2ee zdtm: pthread01 -- Fix missed sigprocmask -> pthread_sigmask transition
It has escaped me on previous pass.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:14 +04:00
Cyrill Gorcunov
12e3d7c43e zdtm: pthread00 -- Use task waiters instead of mmap+sleep pair
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:32:57 +04:00
Cyrill Gorcunov
8ee07313f2 zdtm: pthread00 -- Rename thread functions to more sensible names
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:32:16 +04:00
Cyrill Gorcunov
78e9c40a04 zdtm: Drop mutex from pthread00 test
The tls_data is used for read-cycles only thus
there is no need for mutex since this area get
filled earlier than fork() issued.

Same time on restore the tls filled before the
program restarts.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:53 +04:00
Cyrill Gorcunov
593c8d1048 zdtm: Make pthread00 to wait with 0
P_ALL is an argument for waitid, not waitpid.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:31 +04:00
Cyrill Gorcunov
465c59457d zdtm: Make pthread00 to use exit(0)
No need for error code here, we test results
by special bitmap.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:06 +04:00
Andrey Vagin
b7cffae5d4 zdtm: adapt all tcp tests for ipv6
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:37:39 +04:00
Andrey Vagin
a77d00347a test: add a script for executing all app-emu test cases
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:08:29 +04:00
Andrey Vagin
f8d6dad7f8 test/app-emu: wait while tasks are dying before starting restore
Otherwise some PID-s may be busy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:08:14 +04:00
Andrey Vagin
f2adcc41e1 test/app-emu: add options --shell-job
[xemul: s/-j/--shell-job/g]

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:06:18 +04:00
Andrey Vagin
281f0c7d10 test/app-emu: dump/restore of VNC server
* Execute VNC server and glxgears
* Dump/restore
* Check, that VNC server accepts connections

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 18:56:48 +04:00
Andrey Vagin
ed5f540c99 zdtm: add new test case for testing logic about COW memory (v2)
This test tests the following combinations:

1. parent and child have a cow-ed mapping
2. parent and child have just coinciding mappings

the pages state in both should be in all possible combinations of

 a. write mapped
 b. read mapped
 c. not touched
 d. before fork
 e. after fork

v2: * wait until a child are not prepared
    * check a FILE | PRIVATE mappings

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-20 20:48:36 +04:00
Andrey Vagin
380a904947 zdtm: add stream/socket-tcp in the list
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-20 17:24:40 +04:00
Cyrill Gorcunov
124e70097d zdtm: Fix pthread01 test case
- use pthread_sigmask instead of sigprocmask
 - show_sigset should take the size of dereferenced variable
 - zeroify sigsets before use, since libc has own definition
   for sigset which doesn't match one the kernel uses

http://bugzilla.openvz.org/show_bug.cgi?id=2437

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-15 18:13:23 +04:00
Cyrill Gorcunov
54148db18f zdtm: Add new pthread01 test
To test threads blocked signals restoration.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:43:02 +04:00
Cyrill Gorcunov
71a65a96f5 zdtm: Update futex-rl test for thread leader
Don't forget to test thread leader as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 12:33:53 +04:00
Andrey Vagin
dc3a08c80b zdtm: Add static/socket-tcpbuf enabled by default
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:14:01 +04:00
Vladimir Davydov
8a496c860a zdtm: allow possix timers overrun be greater than time passed
During live migration timer overrun can jump forward too.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Stanislav Kinsbursky <skinsbursky@openvz.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 16:57:42 +04:00
Andrey Vagin
c80b08643f zdtm: print string describing error number
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:43:59 +04:00
Andrey Vagin
a943071e44 tty02: open a slave tty with O_NOCTTY
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:43:30 +04:00
Andrey Vagin
e6bd325845 zdtm: fix a error message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:42:48 +04:00
Andrey Vagin
4c60b22d75 zdtm: check unconnected unix sockets
https://bugzilla.openvz.org/show_bug.cgi?id=2408

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:38:35 +04:00
Pavel Emelyanov
ce028b15db zdtm: Test that socket filter migrates well
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-01 19:22:06 +03:00
Kinsbursky Stanislav
f7477bc2a6 zdtm: cleanup launcher output in case of passed test
Print PASS only once.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-01 14:48:05 +04:00
Kinsbursky Stanislav
a08f2030a1 test: add processes tree restoring test
This test makes sure, that processes tree is restored before opened files.
This is guaranteed by holding child's "/proc/<pid>/stat" file opened by parent.

It was inspired by OpenVZ bug:
#2404

IOW, OpenVZ can't restore container with such test inside.

v2:
1) Test renamed + carefull cleanup + minor updates.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-01 14:45:51 +04:00
Cyrill Gorcunov
385e1059cb zdtm: More detailed report on unmounting problem
It seems I've screwed the setup and mount points on
my testing machine thus mountpoint test become failing.

Nevertheless, better to report where exactly we've failed
for easier investigation.

With this patch I get

 | ./mountpoints --pidfile=mountpoints.pid --outfile=mountpoints.out
 | 20:26:07.398:  1745: umount(`/dev') failed: Device or resource busy
 | 20:26:07.398:  1745: umount(`/vz') failed: Device or resource busy
 | 20:26:07.399:  1745: umount(`/vz') failed: Device or resource busy
 | 20:26:07.399:  1745: umount(`/vz') failed: Device or resource busy
 | 20:26:07.399:  1745: umount(`/vz') failed: Device or resource busy
 | 20:26:07.399:  1745: FAIL: mountpoints.c:60: Can't umount all the filesystems (errno = 16)
 | 20:26:07.404:  1744: ERR: test.c:298: Test exited with unexpectedly with code 1
 |  (errno = 4)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-30 21:42:13 +04:00
Andrey Vagin
28eb57eddf zdtm: Check full tcp buffers with custom sizes (v2)
* Increase sizes of tcp rcv and snd bufffers
* Fill buffers
* Dump/Restore
* Check, that all data were restored

This test reproduces a problem from buf #2411

v2: don't use test_waitsig() in external processes, because they
   can be out of this pid name-space.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-30 19:04:01 +04:00
Cyrill Gorcunov
484905d4ef zdtm: Add tty02 test enabled by default
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-30 18:25:33 +04:00
Andrey Vagin
762f493bc3 zdtm: check a non-controlling terminal
Here are two things:
* A test process is a session leader
* It has a terminal, which are not conrolling for anyone.

For bug #2409

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-30 10:28:06 +04:00
Cyrill Gorcunov
4eb37687a1 app-emu: Add job test
For tty migration testing.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-29 13:40:06 +04:00
Cyrill Gorcunov
1b060e1470 app-test: java -- Use --shell-job option
Since we support tty migration, use it here,
otherwise it'll fail.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-29 13:35:34 +04:00
Vladimir Davydov
fd19a1fc3a zdtm: make posix timer migration test use corresponding clocks
For vz containers, monotonic time freezes when a container is
checkpointed. This makes the zdtm posix timer test fail.

To fix this, obtain time passed, which is used to check timer results,
using the clock used by the timer.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-26 21:27:03 +04:00
Pavel Emelyanov
df553964df zdtm: Fix sleep time unwanted overflow
After sleep 0.9 there occurs sleep 0.10 which is not what
we want. Stop incrementing on 0.9

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-26 14:58:34 +04:00
Cyrill Gorcunov
3d3e312b38 zdtm: Don't fail maps02 madvise when some kernel madv is not supported
Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-26 14:57:20 +04:00
Cyrill Gorcunov
9f90f2e5c6 zdtm: Add maps02 test-case
To test new bits we fetch from VmFlags smaps interface.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-26 00:16:07 +04:00
Andrey Vagin
2f5d7098b8 zdtm: don't worry if a storage device ID is changed on NFS
Kinsbursky Stas added a comment - 24/Oct/12 4:24 PM
st_dev won't be the same. It's generated on each NFS superblock creation.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 19:12:44 +04:00
Pavel Emelyanov
48042e65da zdtm: Test for shutdown unix sockets
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 18:39:54 +04:00
Andrew Vagin
cf698a9a48 zdtm: split sched_prio00 on two parts
sched_prio00 tests only priorities and sched_policy00
tests scheduling policy.

scheduling policy can not be changed in OpenVZ containers.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 15:52:53 +04:00
Andrew Vagin
da8799199e zdtm: workaround compiling errors on ubuntu 10.4
getsid is required _XOPEN_SOURCE_EXTENDED,
it's enabled if __GNU_SOURCE is defined.

session00.c:92: error: implicit declaration of function 'getsid'

Signed-off-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 15:52:30 +04:00
Cyrill Gorcunov
cdecc9d012 zdtm: Drop memory barrier from file_fown
It's a rudiment which not parsed well by all
gcc versions.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 15:52:02 +04:00
Pavel Emelyanov
22a1377868 zdtm: Test that sockets bound to device work
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-19 17:37:48 +04:00
Pavel Emelyanov
aa731ee1d7 core: Support task scheduler policies and priorities
No magic here, just fetch info using getpriority and sched_getxxx calls.
Good news is that the mentioned syscalls take pid as argument and do work
with it, i.e. -- no need in parasite help here.

Restore is splitted into prep -- copy sched bits from image on restorer
args -- and the restore itself. It's done to avoid restoring tasks info
with IDLE priority ;) To make restorer not-fail sched bits are validated
for sanity on prep stage.

Minimal sanity test is also there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-17 00:23:25 +04:00
Pavel Emelyanov
293eca3127 sk: Support SO_NO_CHECK option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-15 15:45:57 +04:00
Pavel Emelyanov
ed745fa9cf sk: Support SO_DONTROUTE option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-12 20:32:06 +04:00
Pavel Emelyanov
5e1a9f840c sk: Support SO_PASSSEC and SO_PASSCRED options
There's some bug in show fn for options :( Will be fixed later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-12 14:01:18 +04:00
Pavel Emelyanov
b53d6d90b7 sk: Support SO_MARK socket option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-12 13:48:18 +04:00
Pavel Emelyanov
9929d2efdf sock: Handle rcvlowat and priority options
And write a test for them.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-11 22:02:25 +04:00