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>
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>
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>
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>
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>
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>
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>
/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>