v2: * add a zdtm.py .desc file
* only look to make sure inet addresses match (in particular, don't
match the state)
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We want to execute tests in an isolated environment
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Currently numbers for /dev/net/tun and /dev/rtc are hardcoded and
they changed after the last kernel update.
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Now we save report in test/dump/report. It doesn't work when
we mount tmpfs into test/dump, because Jenkins runs in another
mount namespace.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks like this is new as of the 4.2 timeframe. It does bring up a
question: should we do a ls /proc/sys/net/conf/lo on the host to figure out
what sysctls to try and dump instead of use this hardcoded list? I guess we
need to check file modes too, because of mc_forwarding, but something like
that.
v2: add ignore_routes_with_linkdown to the end of the hardcoded devconfs
list, so as not to break migration across criu versions.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It seems with the new zdtm.py that pids collide a lot more (perhaps because
everything is in its own pid namespace? not sure). In any case, this is
annoying as it prevents a second run of the tests from actually getting to
the test part.
So, let's try to move the old directory out of the way.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Most python uses spaces, so that's probably what people have their editors
configured to do. Since this file uses tabs, let's be explicit about it.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This avoids problems like:
$ sudo ./zdtm.py run -a
Skipping test zdtm/live/static/mem-touch (manual run only)
./sock_opts00 --pidfile=sock_opts00.pid --outfile=sock_opts00.out
./sock_opts00 --pidfile=sock_opts00.pid --outfile=sock_opts00.out
==================== Run zdtm/live/static/sock_opts00 in h =====================
Start test
Test is SUID
Run CRIU: [dump -o dump.log -D dump/zdtm/live/static/sock_opts00/74/1 -v4 -t 74 --pidfile /home/ubuntu/criu/test/zdtm/live/static/sock_opts00.pid]
Run CRIU: [restore -o restore.log -D dump/zdtm/live/static/sock_opts00/74/1 -v4 --pidfile /home/ubuntu/criu/test/zdtm/live/static/sock_opts00.pid --restore-detached]
Wait for zdtm/live/static/sock_opts00 to die for 0.100000
Remvoing dump/zdtm/live/static/sock_opts00/74
==================== Test zdtm/live/static/sock_opts00 PASS ====================
==================== Run zdtm/live/static/sock_opts00 in ns ====================
Construct root for zdtm/live/static/sock_opts00
Start test
Test is SUID
Traceback (most recent call last):
File "zdtm.py", line 850, in <module>
do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
File "zdtm.py", line 641, in do_run_test
cr(cr_api, t, opts)
File "zdtm.py", line 562, in cr
cr_api.set_test(test)
File "zdtm.py", line 469, in set_test
os.makedirs(self.__dump_path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: 'dump/zdtm/live/static/sock_opts00/153'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "zdtm.py", line 46, in clean_tests_root
os.rmdir(tests_root)
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-MmGEQD'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "zdtm.py", line 46, in clean_tests_root
os.rmdir(tests_root)
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-MmGEQD'
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
On debian/ubuntu systems, we don't have a /bin/env by default; on rhel
systems (my limited testing seems to indcate that) /usr/bin/env is a
symlink to /bin/env, so let's just use that so it works everywhere.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's very inconvenient to read the zdtm.py output with long
lines of options.
Reported-by: Andrey Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise make's output appears in logs before zdtm.py's one
Reported-by: Andrey Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
First -- set cannot be made out of lists (and maps lists contain lists of pairs)
Second -- it is much better to read map diffs in hex, rather than ints (as they
would be if repr-ed by default)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Now zdtm.py can construct an report which contains all required
inforamtion for investigating a problem. This patch adds support
of this functionality to jenkins scripts.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It allows to execute zdtm.py not only from the test directory.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This script prepares the cgroups hierarchies that are used by
tests to avoid creation of those in parallel with tests, that
do not expect them to appear.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We clean up test files from Makefile.
The name format for them is testname.XXX.test.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Includes C/R images dir and the zdtm.py logs for one test only.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@odin.com>
After this patch it stops working in zdtm.sh launcher duo to incomplete
root constructed. Do we want to fix it?
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Things added are:
1. /usr directories (links to respective / ones)
2. /sbin dir
3. per-test dependencies that are listed in .desc file as 'deps': [<list>]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fail() saves all files in an archive for further investigations.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Current implementation of print_sep has off-by-one-like issue -- it
can print one character more :) Fix this and make the code shorter.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
There is no permissions to set sysctl-s
v2: add the suid flag
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We don't have enough permissions to set sysctl-s from userns, while
system calls are ns_capable()-protected in the kernel and thus work
in user-namespaces.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Sometimes pr_perror() is used in places that don't have errno set.
In such places, pr_perror() should not be used as it will print
some nonsense.
Introduce and use pr_err() for such cases.
Now, I see sometimes fail() is used in such cases but I think
it is reserved for places where test fails (rather than there is
something that prevents the test from working).
Also, sometimes test_msg() is used but it doesn't print source
file name and line number.
If there will be a need, we can unify pr_err() with say fail(),
it will be easier to do after this patch.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In this place, errno is not being set and can be 0 or some random value,
so we should not use it. In case errno happens to be 0, we end up returning
a success status from a function while we should have returned a failure.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Log function pr_perror() automatically adds
- numeric errno value
- string errno value (aka strerror(errno), aka %m)
- a newline
So, its callers don't have to do all these things.
While at it, also
- fix or improve some message texts
- replace fnprintf() with pr_perror()
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In (highly unlikely) case localtime() failed, test_msg() calls
pr_perror() which is a wrapper around test_msg() so we're
calling ourselves, which can lead to infinite recursion if
localtime() keeps failing. Use fprintf() here to avoid this.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>