CRIU processes save *.gcda and *.gcno files near source files,
so when we restore tests into another mount namespace,
we need to have access to sources from this namespace.
Cc: Sergey Bronnikov <sergeyb@openvz.org>
Reported-by: Sergey Bronnikov <sergeyb@openvz.org>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
v2: print test name + flavor info for each test too.
v3: pass dry_run via CR_CT_TEST_INFO
Output looks like this now:
=== Run 1/242 ----------------
Skipping zdtm/transition/thread-bomb (manual run only)
Skipping zdtm/transition/file_aio (manual run only)
======================= Run zdtm/transition/maps007 in h =======================
====================== Run zdtm/transition/maps007 in ns =======================
====================== Run zdtm/transition/maps007 in uns ======================
=== Run 4/242 ----------------
Skipping zdtm/transition/epoll (manual run only)
==================== Run zdtm/transition/pipe_shared00 in h ====================
=================== Run zdtm/transition/pipe_shared00 in ns ====================
=================== Run zdtm/transition/pipe_shared00 in uns ===================
=== Run 6/242 ----------------
======================== Run zdtm/transition/fork in h =========================
======================== Run zdtm/transition/fork in ns ========================
======================= Run zdtm/transition/fork in uns ========================
=== Run 7/242 ----------------
Skipping zdtm/transition/ptrace (manual run only)
Skipping zdtm/transition/socket_loop00 (manual run only)
======================== Run zdtm/transition/ipc in ns =========================
=== Run 10/242 ----------------
Skipping zdtm/transition/netlink00 (manual run only)
===================== Run zdtm/transition/socket-tcp6 in h =====================
=== Run 12/242 ----------------
...
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
For the caller there should be only one pidfile -- the one
that should be fired with TERM signal on stop. All the other
stuff is test's internal business.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I suggest to inject a fault and than try to execute the same command
again without a fault to check that it will complete successfully.
v2: skip a parasite blob when we are checking vma-s
v3: remove a loop for two iterations
v4: clean up
v5: call fault hooks from one place
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In Ubuntu flock opens a file with O_RDWR and then it can't be executed
flock: ./zdtm_mount_cgroups: Text file busy
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Tests are often run in VMs and 5 seconds on loaded environments might
be not enough to catch transition zdtm tests.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Move static and transition into zdtm top. We can't move all the micro
tests themselves, as we need to distinguish static from non static (zdtm.py
makes additional checks on static ones).
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Fix checkskip logic, also emit a clearer reason when checkskip fails as to
why the test was skipped.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Depending on the distribution, binaries or shared libraries a test is
dependent of may not be stored at the same place.
This patch introduces the ability to define option in the dependency
list, by separating the optional target names by a '|' character.
For instance the dependency of test may be described this way:
{'flavor': 'ns', 'deps': [ '/bin/foo|/usr/bin/foo' ], 'flags': 'suid'}
Note, there shouldn't be any spaces around the '|'.
If none of the optional dependency is satisfied, an error is raised.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Some tests require criu to be root, e.g. tcp tests of unlink-mmaps ones,
so mark those in desc files as such.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
There are several restrictions:
1. Onlu dump is checked (--norst) for now
2. Only host flavor as tests has to start themselves in non-root mode
3. Only non-suid tests
4. TCP doesn't work too, should be manually excluded :\
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
Now we save files, maps and mounts for each test process
and we need to compare them separately for each process.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In this case it has an external master_id and we want to test that
criu can handle it correctly.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It works for tests which are executed in a separate pidns
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When running test in ns/uns flavor zdtm.py builds a temp root in test/ directory.
The new action allows to remove all this stuff automatically.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When debugging it's useful to stop zdtm.py at certain points and
check what's going on out there. For this the --sbs (step-by-step)
option is introduced. It will make zdtm.py stop and wait for user
keypress before dump, before restore and after restore.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Generated files are often analyzed after test, so it's handy to have
their full names on the screen at once.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Right now zdtm spawns test into a pseudo-container and redirects its
output in a temp file. This is done not to mix outputs of tests, running
in parallel, with each other.
But if we run tests one by one or there's only one test in the list
we can safely print the output right on the screen.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
If someone wants to run all tests in any, but the most
difficult for criu, flavor, the 'best' one is introduced.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Currently launcher doesn't know that some tests are skipped
and draws incorrect progress bar :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
So here's the new test class that handles the test from
groups set. The class is inherited from zdtm_test one as
what it does is -- starts the pseudo-init in ns/uns flavors
and asks one to spawn() the sub-tests from the list.
All groups tests can only be run inside ns flavor, so if
the host flavor is asked, just the pseudo-init is spawned.
This is because using ns flavor is the easiest way to spawn
all the sub tests under this init (however, h flavor can be
supported by marking the pseudo-init as sub-reaper).
On stop this pseudo-init is signalled to stop, it in turn
stops all the sub-tests and then exits. When the pid
namespace destruction is complete, the sub-tests .out-s are
checked.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Introduce yet another tests set called 'groups'. Each test
in this set is a list of existing zdtm tests that can be
started side-by-side in an ns flavor.
To 'create' such a test the zdtm.py group action is used,
which lists tests and semi-randomly groups them together.
The grouping possibility is checked by comparing the .desc
files of those -- desc-s should coincide. One exception is
test dependencies, these are just merged together.
After running the group action there appears groups/ dir
with tests each containing just the list of zdtm tests
that are in a group. The respective .desc file is also
generated and this one matches the .desc for tests inside.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is -- add ability to pull more than one binary into
mntns root and ability to start zdtm test with more stuff
in the environment than generated in start method itself.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When using non-run command the 'sat' option is not in opts dict,
so it should be checked with softer method.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Instead of doing some dirs/files/links in launcher and some in
libzdtm, make everything in the launcher. The library is then
just to set up the namespaces.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If we get EBUSY here, it means that we didn't umount in the test (i.e. we
didn't call fini() on some path). We should just do that instead.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We get the stack trace if a test failed:
Test output: ================================
09:11:34.584: 4: PASS
<<< ================================
Traceback (most recent call last):
File "zdtm.py", line 922, in <module>
do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
File "zdtm.py", line 696, in do_run_test
t.kill()
File "zdtm.py", line 302, in kill
self.__flavor.fini()
File "zdtm.py", line 168, in fini
subprocess.check_call(["mount", "--make-private", self.root])
File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['mount', '--make-private', '/tmp/criu-root-YN1t3X']' returned non-zero exit status 32
umount: /tmp/criu-root-YN1t3X: not mounted
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In current implementation of thread bomb effectively only one
thread runs, the rest sit in the read from pipe.
Fix this by making threads constantly creating new ones and
just exiting.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
There's a sat.py script in criu-scripts repo that analyzes the strace
outputs. It's useful to check the amount of system calls criu takes to
do dump or restore of certain apps.
So add the --sat key to zdtm.py that would generate sat-able logs for
individual tests.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>