Commit graph

198 commits

Author SHA1 Message Date
Pavel Emelyanov
decf115f7e zdtm: Wait for test finish with increasing intervals
This makes tests that finish some time run smoother -- no tons of Waiting... messages
on the screen

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 07:57:23 +04:00
Cyrill Gorcunov
7ff9efda4a zdtm: fifo-rowo-pair test update
Address Andrew's comments

 - use TEST_VALUE macro instead of open coded value
 - use WIFx macros for child status testing
 - kill child/parent on error

Note that it was not clear from an initiall patch
change log -- the difference between fifo_wronly
test case and this one is that we use fork() call
here which allow us to make sure that fifo restoration
code logic will be tested more widely.

Basically the flowchart of the test case:

parent				child
------				-----
open RW fifo (slave)
open RO fifo (master)
				open WO fifo (master)
				dup parent slave to slave1

				... waiting c/r to happen ...
				... waking up from c/r ...

				send bytes to master
				send bytes to slave1

				finish
... initiating c/r ...
... waking up from c/r ...

read bytes from master
read bytes from slave

PASS :D

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:56:01 +04:00
Andrey Vagin
63dcf183f2 zdtm: add a test case for checking sid and pgid
A process tree is described in the array. New cases are easy for adding.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:52 +04:00
Andrey Vagin
23501ffe32 zdtm: add ability to set id of a test proccess
It's just easy for debugging

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:51 +04:00
Andrey Vagin
faf12f405b zdtm: copy futex engine from crtools (v2)
We can't reuse it from crtools, because zdtm is used separately.

v2 syscall() returns an error code in errno.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-02 16:53:50 +04:00
Cyrill Gorcunov
18d8950355 zdtm: Enable fifo and fifo_wronly tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:45:35 +04:00
Cyrill Gorcunov
c8bf5e3fd0 zdtm: Add fifo ghost file test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:45:18 +04:00
Cyrill Gorcunov
e0939577ea zdtm: Add fifo-rowo-pair test case
I need a special test case where fake
fifo will be created by us to restore
the former.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 21:44:59 +04:00
Andrey Vagin
16c410b19f zdtm: check content of an unlinked file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 15:34:24 +04:00
Cyrill Gorcunov
29cb7de198 zdtm: Turn on unbound_sock test case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 14:43:24 +04:00
Andrey Vagin
877f8c8276 zdtm: simplify sys_gettid
It fix compilation on x32

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-28 20:54:12 +04:00
Evgeny Antyshev
dc2a99c627 zdtm: allow for 0 timer growth in uptime_grow
It may occur that the loop spins faster than clock ticks.

Signed-off-by: Evgeny Antyshev <eantyshev@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:08:42 +04:00
Andrey Vagin
18cd74069c zdtm: don't print useless numbers
expr prints a substing length. This patch redirects output of expr to /dev/null

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:05:08 +04:00
Andrey Vagin
8abf475d59 zdtm: make zdtm.sh faster in two times
It requered 1m19s for executing all tests.
Now it requires 38s.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:04:37 +04:00
Cyrill Gorcunov
486da8827e zdtm: Convert caps00 test to use task_waiters
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:03:45 +04:00
Cyrill Gorcunov
8d7a55ed74 zdtm: Add task_waiter_ helpers v3
Sometime we need sync points in testee program flow,
for this reason task_waiter_ introduced.

The call semantics is the following

        Parent                  Child
        ------                  -----
        task_waiter_init
                                task_waiter_wait4
        task_waiter_complete
                                task_waiter_wait4
        task_waiter_complete

                ...

Thus initially task_waiter_init should be called
to initialize all internals guts needed.

Then one become waitee and calls for task_waiter_wait4,
where lockid should be provided as an argument. Since
it should be unique values the best option might be
gettid().

The same applies to a waiter side -- it should call
for task_waiter_complete and provide a lockid.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 21:03:31 +04:00
Pavel Emelyanov
a03323e162 zdtm: Basic test for mount points in mount namespace
Test with sysfs and proc as no other fs-s are currently supported.
Will be fixed later.

Note, that the original /proc mount is kept as the dumping code requires
it for reading pagemap file with RSS info. Worth fixing it some day?

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:41 +04:00
Andrey Vagin
16c7adecdd zdtm: add two test cases for tty-s
* check, that pseudoterminals are restored
* check, that a control terminal is restred

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:17:54 +04:00
Andrey Vagin
24074a9dbb zdtm: add new test case for checking that SID is restored
2     2 session00
    4     4  \_ session00		# {NEWSID, },
    2     5  \_ session00		# {0, },
    8     8  \_ session00
    2     9  |   \_ session00           # {CHANGESID, }
   10    10  \_ session00
   11    11      \_ session00
    2    12          \_ session00	# {DOUBLE_CHANGESID | CHANGESID, }
    2     3 session00			# {DETACH, },
    6     7 session00			# {DETACH|NEWSID, },

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:15:30 +04:00
Andrey Vagin
9b3b059bdc crtools: add "pid" to the --namespaces cmdline option arguments (v3)
to require dumping pid namespace. Dump and restore will be failed if
a tress doesn't contain a process init.

pid namespace will be created implicitly if a process init in the tree.

v2: fix comments from Pavel
v3: Restore of pidns should be approved by user

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:08:57 +04:00
Andrey Vagin
b11785212b zdtm: remove unused code from sockets_dgram
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Victor konyashkin <vkonyashkin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:17:25 +04:00
Andrey Vagin
ebb8066599 zdtm: fix adding test cases to the list
bash returned the error : No such file or directory
and doesn't add three test cases to the list.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:05:29 +04:00
Evgeny Antyshev
d25f5348ae zdtm: uptime_grow test
new testcase important for rebootless update testing:
we query system timer CLOCK_MONOTONIC continuously
and fail in case it stepped backwards

Signed-off-by: Evgeny Antyshev <eantyshev@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-20 15:02:53 +04:00
Andrey Vagin
606ad446ec zdtm.sh: execute all test in NEW_PIDNS in addition (v2)
Now the most part of test cases may be executed in pidns.
By default all test cases are executed in current pidns, then
they are executed in new pidns again.

v2: remove the hard coded path to  test_init

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 22:19:34 +04:00
Andrey Vagin
d4a5938d8f zdtm: add a test init for executing tests in PIDNS
Add a small program, which clones a process in new PIDNS and executes
a test.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 22:18:23 +04:00
Cyrill Gorcunov
3eade0b6d5 zdtm: ipc_namespace -- Make sure queues_max is not out of range value
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 13:24:46 +04:00
Victor Konyashkin
e2ba4892ca zdtm: If address already in use then need increase port.
If address already in use then need increase port.
The problem occured because the socket_listen.c и socket_aio.c
can try to use the same address.

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 12:44:53 +04:00
Andrey Vagin
ad41b1e9c9 zdtm:fifo: check that read only fifo descriptor is restored
* Create fifo and two descriptors rw and ro
* Write data and close rw descriptor
* Suspend/resume
* Read data from ro descriptor

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 12:40:51 +04:00
Andrey Vagin
542abe80a2 zdtm:fifo: write a few data in the fifo descriptor and check them
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 12:39:58 +04:00
Cyrill Gorcunov
b6b9e8dc6d zdtm: Cleanup file_fown test case (v2)
- add test for flags recovery
 - drop sockets, not needed
 - simplify test for owners and signumber

v2: remove polling (by avagin@)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-04 12:38:32 +04:00
Cyrill Gorcunov
9589932561 zdtm: Add sockets_dgram test case
Code to test unix dgarm sockets (extracted from
previous sockets00 test case).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-31 15:12:15 +04:00
Cyrill Gorcunov
96c3c7bea4 zdtm: Add sockets_spair test case
Code to test socketpair (extracted from
previous sockets00 test case).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-31 15:11:56 +04:00
Cyrill Gorcunov
7dad6fcfdf zdtm: Cleanup sockets00
Don't mix various types of sockets in a single
test case, in case of problems it become harder
to fins which kind of socket failed.

The removed test cases will be addressed in
further patches.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-31 15:11:54 +04:00
Victor Konyashkin
a72fd71e7f zdtm: Need increase buffer in msgque.c to avoid overflow
Need increase buffer in msgque.c to avoid overflow via memcpy,
because now mtext[20] less than ANOTHER_TEST_STRING "Yet another test sysv5 msg".

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:47:12 +04:00
Victor Konyashkin
fc8c66c629 zdtm: Need add -Wno-unused-result option lib and static Makefile
It's need to add -Wno-unused-result option to lib and
static Makefile to avoid errors like:
msg.c:58:8: error: ignoring return value of 'write', declared with
attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:46:23 +04:00
Viktor Konyashkin
66a7f1a3df zdtm: open with O_CREAT in second argument needs 3 arguments
The mode argument must be supplied when O_CREAT is specified in flags.
Otherwise it will cause compile error due to -Werror is specified.

Signed-off-by: Viktor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:45:19 +04:00
Andrey Vagin
168b7ca7a2 zdtm: remove extra code from file_fown
The testcase is buggy -- the signal is delivered _before_ we checkpoint
and restore it, thus it checks nothing. But after the fix test fails,
due to bug in fowners restore. Will fix it later.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:43:38 +04:00
Andrey Vagin
b026e59c43 zdtm: initialize shared memory before fork
Otherwise this memory are initialized from parent and child,
but parent may initialize, when a child has written a useful data.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:41:16 +04:00
Andrey Vagin
ba61f94646 zdtm: set SA_RESTART for SIGIO in file_fown
Otherwise waitpid returns -EINTR and the test case fails.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:40:55 +04:00
Andrey Vagin
6fd82bf702 zdtm.sh: check that a pid is valid
A test process should be alive.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 16:25:39 +04:00
Andrey Vagin
ef1c6035f1 zdtm: don't show a wrong path to log files
It showed old pathes.

Dump log   : /root/crtools/test/dump/inotify00/15673/dump.log
Restore log: /root/crtools/test/dump/inotify00/15673/restore.log
Output file: /root/crtools/test/zdtm/live/static/utsname.out
make: *** [test] Error 1

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 16:25:18 +04:00
Andrey Vagin
a67d0cb25a zdtm: add gitignore
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 16:21:47 +04:00
Andrey Vagin
9fc24621d5 zdtm: delete an unused file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 16:17:12 +04:00
Andrey Vagin
f53888480e zdtm: open log files with O_APPEND
I'm a paranoiac.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-11 17:39:02 +04:00
Cyrill Gorcunov
112b2fe524 zdtm: Extend eventfs00 for deferred eventpoll test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 16:47:59 +04:00
Andrey Vagin
fc7bedc50a crtools: make to be able to split messages by pid
If the option --log-pid is set, each process will have an own log file.
Otherwise PID is added to each log message.

A message can't be bigger than one page minus some bytes for pid.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 16:22:04 +04:00
Cyrill Gorcunov
6cebc48420 zdtm: Add inotify00 test case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 14:01:05 +04:00
Cyrill Gorcunov
5028f71c66 zdtm: Extend eventfs test for epolls
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 14:00:13 +04:00
Cyrill Gorcunov
580d3b0261 zdtm: Add eventfs00 test-case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 13:59:58 +04:00
Cyrill Gorcunov
4f31e13c92 test, app-emu: Add HelloWorld java test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-03 13:06:56 +04:00