Commit graph

55 commits

Author SHA1 Message Date
Andrey Vagin
c05517b131 zdtm: fix test "fork"
* handle EINTR
* add more details in an error message

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 19:47:58 +04:00
Pavel Emelyanov
dcd64e9d10 zdtm: Test for UTS namespace
Plus a small infrastructure change to fork a test task
in a desired namespace.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 19:04:09 +04:00
Stanislav Kinsbursky
993f07ba71 zdtm: print full dump or restore path on error
Usefull for debugging.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-01-26 14:55:27 +04:00
Stanislav Kinsbursky
01d13d9643 zdtm: patch for socket_listen test
Cleanup and simplifyng (as requested).

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-01-26 14:55:27 +04:00
Cyrill Gorcunov
d2f664b877 make: Eliminate deps build on no-deps targets in zdtm
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
a3d2b8d2d0 make: Include Makefile.inc into legacy tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
a88cd36e7b make: Move legacy tests to test/legacy and use "make test" to run zdtm tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 19:59:53 +04:00
Pavel Emelyanov
71fca5d2da zdtm: Include itimers test in suite
And increase the timeout value, since the timers test checks for counters
for more than 5 seconds...

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:42:32 +04:00
Cyrill Gorcunov
ed3405cf09 zdtm: Add cmdlinenv00 test case
To test restore of commandline, envirion
and auxv vector.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Pavel Emelyanov
2e070f114c zdtm: Test for zombie tasks
Test that 2 different exit()-ed zombies and 2 killed with different
signals are handled properly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:44:09 +04:00
Pavel Emelyanov
cf74b78bdc zdtm: Add simple forking test (it fails now)
I haven't found anything similar in there.

It currently just fails most of the launches because seize doesn't work
with zombies, but I'm working on it...

However, when it manages to miss the zombie it triggers the problem with
freezer (fixed by previous patch).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-19 22:42:10 +04:00
Andrey Vagin
f00efadd2c This patches improves execution of zdtm tests.
It's really like in VZ.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-18 23:31:22 +04:00
Andrey Vagin
b601765782 devide commands and options
./crtools CMD [options]
CMD may be show, restore, dump

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-18 23:31:12 +04:00
Cyrill Gorcunov
5c083e128a Revert "zdtm: clean up socket_listen"
This reverts commit 46dc368f31.

There will be another one. Instead of hard rebase I decide to
do a revert instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-18 16:19:31 +04:00
Andrey Vagin
46dc368f31 zdtm: clean up socket_listen
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-18 15:58:09 +04:00
Stanislav Kinsbursky
3b33e12dad tests: added listening socket migration test
This test is based on socket_aio. It's actually the same, except that socket
binding and listening is done before checkpointing and connection to socket is
done after migration.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-18 12:39:15 +04:00
Cyrill Gorcunov
5eda66dd6d zdtm: Add vDSO test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-17 02:45:53 +04:00
Pavel Emelyanov
368c4a508b restore: Close ns_last_pid file fd
Otherwise it pops up after restore in target task's fdtable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-16 13:43:49 +04:00
Cyrill Gorcunov
4baff50c90 zdtm: Add pthread00 test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-16 13:43:13 +04:00
Pavel Emelyanov
b2cfd095fb zdtm: Make cmdline a little bit more user-friendly
Add the -l option to show the list of tests
Make the default zdtm/live/ prefix when running individual test

Now you can do it like

# sh ./zdtm.sh           for running all tests
# sh ./zdtm.sh -l        to list available tests
# sh ./zdtm.sh <test>    to run test <test>, e.g. "static/pipe00"

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-15 22:54:37 +04:00
Andrey Vagin
3b7c1a1c79 zdtm: correct e-mail
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-13 14:09:25 +04:00
Andrey Vagin
d6a1d20690 zdtm: add test cases for shared sturct file-s
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-10 18:37:13 +04:00
Cyrill Gorcunov
37782e6e00 test: Update unix sockets
To include dgram bound && connected sockets, for example

CR_FD_UNIXSK: /home/cyrill/crtools/unixsk-2813.img
----------------------------------------
fd    3 type  1 state  1 namelen    0 backlog    0 id  19505 peer  19506
fd    4 type  1 state  1 namelen    0 backlog    0 id  19506 peer  19505
fd    5 type  2 state  7 namelen    0 backlog    0 id  19507 peer      0
fd    6 type  2 state  7 namelen   18 backlog   18 id  19508 peer      0 --> test-socket-bound
fd    7 type  2 state  7 namelen    0 backlog    0 id  19509 peer  19510
fd    8 type  2 state  7 namelen   17 backlog   17 id  19510 peer      0 --> test-socket-conn
fd    9 type  2 state  7 namelen   23 backlog   23 id  19511 peer  19511 --> test-socket-bound-conn
----------------------------------------

The last one is bound and connected.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-10 17:38:59 +04:00
Cyrill Gorcunov
cc15c01832 test: Rewrite sockets test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-10 17:26:50 +04:00
Cyrill Gorcunov
25d048c02a test: Add usnix-socket test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-27 20:01:47 +04:00
Cyrill Gorcunov
4f797015e6 test: Enhance pthreads test to include fork calls
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-26 02:24:56 +04:00
Andrey Vagin
c84d194343 zdtm: update list of passed tests (v2)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-16 15:24:38 +04:00
Andrey Vagin
afe52e4254 zdtm: add script to execute test cases
If you execute this script without arguments, it will execute
all test cases, which should pass.

Or the first argument may be a path to the test case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-09 11:38:38 +04:00
Andrey Vagin
a5439d5fed zdtm: add new test case for "pipe inversion"
Probably all of you know about "lock inversion". We have a similar
problem on restoring pipes.

This test case creates two process and two pipes.
process 1:
	11: pipe1 (w)
	12: pipe2 (r)
process 2:
	11: pipe2 (r)
	12: pipe1 (w)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-06 23:41:36 +04:00
Cyrill Gorcunov
8557e39bef test: Add sigaction test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-03 01:48:57 +04:00
Andrey Vagin
5a49b9e216 zdtm: Zero Downtime Migration Test Suite
This test suite contains many small test cases for different subsystems.

Example of execution:
 # make busyloop00.pid
 # ../../../../crtools -d -t `cat busyloop00.pid`
 # kill -9 `cat busyloop00.pid`
 # ../../../../crtools -r -t `cat busyloop00.pid`
 # cat busyloop00.out
PASS

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-02 17:49:08 +04:00
Cyrill Gorcunov
f6ae59cdde test: Add trivial vDSO test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-29 16:37:43 +04:00
Cyrill Gorcunov
ea423aa56f test: Update makefile clean target
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 13:29:27 +04:00
Cyrill Gorcunov
477adf0cf2 test: pipes -- Drop unused vars
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 13:21:48 +04:00
Cyrill Gorcunov
8ea8d4eee5 test: pipes -- Add a second pipe
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 13:20:05 +04:00
Cyrill Gorcunov
4368d57c48 test: Add test-pthreads test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 01:50:45 +04:00
Cyrill Gorcunov
5e5cb3b321 test: Add test-pipe-async test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 23:55:37 +04:00
Cyrill Gorcunov
22f8986902 teste: Add test-shmem-three-async test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 23:45:35 +04:00
Cyrill Gorcunov
1355c7d29a test: Update shmem more frequently
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 22:58:02 +04:00
Cyrill Gorcunov
e66efb11a1 test: Add printing header
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 22:56:12 +04:00
Cyrill Gorcunov
8650847b83 test: Add test-shmem-async test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 22:53:18 +04:00
Cyrill Gorcunov
d2f382e729 test: Add test-rnd-from-file test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 22:42:59 +04:00
Cyrill Gorcunov
37e73d6a1d test: Add test-counter test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 21:25:43 +04:00
Cyrill Gorcunov
af4eb76bb0 test: Drop old tests
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-21 20:27:58 +04:00
Cyrill Gorcunov
321793cd37 test: Add pipes output into testee
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:20:21 +04:00
Cyrill Gorcunov
c9c2bddcb8 test: Update shared mem test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:19:41 +04:00
Cyrill Gorcunov
1e7bbd35de restore: Add threads restoration
Now threads restortion (and TLS as well) works.
Threads test reports the following

    2775 (main): Counter value:    3 tls_data =    1
    2775 (main): ( 0) fsgs_base 7f9597aa46f0
    2775 (main): ( 0) fsgs_base        0
    2775 (thr3): Counter value:    4 tls_data =    4
    2775 (thr3): ( 0) fsgs_base 42c57940
    2775 (thr3): ( 0) fsgs_base        0
    2775 (thr2): Counter value:    3 tls_data =    2
    2775 (thr2): ( 0) fsgs_base 42456940
    2775 (thr2): ( 0) fsgs_base        0
    2775 (thr1): Counter value:    4 tls_data =    3
    2775 (thr1): ( 0) fsgs_base 40c62940
    2775 (thr1): ( 0) fsgs_base        0
    2775 (main): Counter value:    4 tls_data =    1
    2775 (main): ( 0) fsgs_base 7f9597aa46f0
    2775 (main): ( 0) fsgs_base        0
    2775 (thr1): Counter value:    5 tls_data =    3
    2775 (thr1): ( 0) fsgs_base 40c62940
    2775 (thr1): ( 0) fsgs_base        0

as expected.

This commits merges all preliminary commits into
the final one (sigreturn branch was always experimental
and forced update).

Still some problems remain:

1) While creating threads with clone() the
   flags are to be revisited. We use some predefined
   set here but it's not really correct.

2) No setup of pids in PCB thread zone.

3) No restore of FPU.

But at least on some basic tasks restore works well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-12 19:26:40 +04:00
Cyrill Gorcunov
345834ecee test: Add prints out in static test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 15:24:08 +04:00
Cyrill Gorcunov
48371f729a test: Add static sleep test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-31 20:37:50 +04:00
Cyrill Gorcunov
9fcecfe1a2 test: Make testee-threads to create thread inside thread
And open a file as well

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-23 12:43:15 +04:00