Currently it's possible to continue testing despite failures only when
running zdtm.py with --all option. Let's make --keep-going option also
valid when more than one test is requested with --tests or --from.
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
When using the option --keep-going to get a quick overview of the test
results there is now a summary which tests have failed like:
############# 7 TEST(S) FAILED (TOTAL 268/SKIPPED 83) ##############
* zdtm/static/sched_policy00(unknown)
* zdtm/static/pthread00(unknown)
* zdtm/static/pthread01(unknown)
* zdtm/static/maps01(unknown)
* zdtm/static/maps00(unknown)
* zdtm/transition/maps008(unknown)
* zdtm/transition/shmem(unknown)
############################### FAIL ###############################
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
flake8 --config=scripts/flake8.cfg test/zdtm.py
test/zdtm.py:66:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:127:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:971:1: E305 expected 2 blank lines after class or function definition, found 1
test/zdtm.py:1618:1: E305 expected 2 blank lines after class or function definition, found 1
Makefile:377: recipe for target 'lint' failed
travis-ci: success for zdtm: fix flake8 warnings
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
When C/R-ing a net namespace with --empty-ns net option we should also
skip netfilter rules too (as per https://github.com/docker/docker/issues/27597).
However, there's one thing to be handled -- local TCP blocking rules are
expected to be there on restore by restore_iptables() which is no longer
the case, so put them back manually.
Test included, checked on zdtm/static/socket-tcpbuf-local :)
v2: Full scripts for empty netns setup.
https://github.com/xemul/criu/issues/246
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Travis sets up the GCOV variable to collect coverage and
provides an external mount for this. Thus handling this
option in RPC mode is essential.
travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Now the --ext-mount-map is deprecated option, so fix it to
become the --external one.
travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It seems to me most of the clean hooks (used by cgroup*, macvlan* cr_veth*
and mnt_tracefs* were all designed to be run to clean up after the test, no
matter whether it failed or succeeded. Let's always run them, so Andrei
doesn't hate me :D
travis-ci: success for zdtm.py: run --clean hook on test failure
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Inspired by Tycho's macvlan test, here's the same thing for
--external veth option. In master we still have the --veth-pair
one, but the plan is to move this all under the --external opt.
v2:
* Travis doesn't have /usr/bin/sed
* Added .checkskip hook for older environments
v3:
* Delete bridge hanging around after previous flavor
* Wait for host veth end to die after dump
v4:
* Get the pid of task to move veth into from .pid.inprogress file
v5:
* Wait for host veth end to die after test stop too :\
Travised-by: https://travis-ci.org/xemul/criu/builds/170726663
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This hook runs after the test is started, in parallel with the actual test.
This can be used in case the test and the host need to coordinate somehow
in order to set something up (e.g. for a macvlan interface).
travis-ci: success for series starting with [v10,01/11] net: pass the struct nlattrs to dump() functions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This program doesn't parse /etc/fstab or /etc/mtab,
it just calls the umount2 syscall.
It is another attempt to fix the error:
subprocess.CalledProcessError: Command '['mount', '--make-private', '/tmp/criu-root-C7MZS9']' returned non-zero exit status 1
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-C7MZS9'
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Add a new option to zdtm.py to run "criu dedup" after "criu dump"
or "criu pre-dump".
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
An atexit hook is executed for forked processes too,
clean_tests_root() has to be called only once.
v2: fix flak8 warnings
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It gives us more information why a test hasn't completed in time.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
As RPC server the swrk mode is used which, in turn, is easily used
by nice lib/py/criu.py thingie from Ruslan.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Now we have a single place that is really about calling criu
as CLI tool inside this class, so pull one out as a preparation
to having RPC support.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In the criu_cli class there's the whole bunch of useful code which
not CLI-specific, so drop the _cli suffix.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It is very hard to investigate travis fails, when something is segfaulted.
Let's add our own core file handler which will provide all required
information for us. Now test/abrt.sh shows a process tree,
process mappings, registers and backtraces.
v2: change a variable name
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Thanked-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Test does its checking both after dump and after restore.
Checking is done in the following way:
1. Check that every ps tree process is stopped or dead
2a. SIGKILL every ps tree process if checking after dump
2b. SIGCONT every ps tree process if checking after restore
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
If a test crashes, its logs may be in testname.out.inprogress.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
These files have to be removed after successful restore.
v2:
Check link remap files only for tests with "--link-remap" option in
descriptor.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Required for test/zdtm/static/autofs test.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
and fix various warnings. For example, we mix tab and space indentations.
v2: add flake8.cfg
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@virtuozzo.com>
join-ns zdtm test will skip ns and uns flavors, and
some socket related test, too. Because join-ns test will
try to join an existing network namespace.
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Now we don't detect extra mounts, if they have peers with the same root
and target paths.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Jenkins sends this files as a message body if something failed.
Cc: Sergey Bronnikov <sergeyb@openvz.org>
Fixes: 474f2dfc5dd4 ("zdtm.py: add option --keep-going")
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We expect:
- all 9 scripts are called
- there's always images dir variable
- for 7 of those scripts there's root-pid variable
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
- option --keep-going is not mandatory if we run a single testcase
- show warning when we use --keep-going with a custom set of testcases
- ignore --keep-going when we run a custom set of testcase (exit on 1st fail)
Signed-off-by: Sergey Bronnikov <sergeyb@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Sometimes when running tests manually it's tempting to
prepare the list of tests to run in advance and then
run only those. E.g. -- when testing a new feature
that affects only _some_ tests. This option allows it.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It was requested by Andrey.
This patch adds details about failed testcase to a TAP report:
TAP version 13
1..1
not ok 1 - zdtm/static/deleted_unix_sock # flavor h
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
From code coverage report, we found that inotify_irmap doesn't test irmap
cache, because we is always able to resolve path from /proc/PID/fd/X.
Current view: top level - criu - irmap.c (source / functions) Hit Total Coverage
Test: criu.info Lines: 40 223 17.9 %
Date: 2016-03-16 Functions: 4 13 30.8 %
This series introduces a new fault to emulate a situation
when a file can't be opened by handle and we have to find
it in the irmap cache/
It's required to test irmap cache. I don't know how to force it
without this patch. Each time when a file can be opened by handle,
its path can be resolved via /proc/PID/fd/X.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>