This test name was added by commit 1ce1cca, but there is no test.
We do not use these lists since zdtm.py was introduced, therefore
the error went unnoticed. I found it while running "make dep".
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit expands the success with lib/Makefile to the rest of
ztdm/Makefiles. In particular, it moves the common part to Makefile.inc
and let {lib,static,transition}/Makefile use it.
This results in:
- dependencies being handled properly;
- reduction of makefiles length due to unification;
- possibly more proper dependencies and builds.
While at it, let's also:
- make rules for criu-rtc.so silent;
- set default CC=gcc;
- remove duplicate -m32 from CFLAGS.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
In GNU make, 'override' means change a variable even if it was set
from the make command line (as in "make VAR=value"). As we do not
intend to modify CFLAGS/LDFLAGS from the command line, 'override'
can be dropped.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
When optimizing our Travis runs, I noticed that test/zdtm/lib is built 3
times in a row -- first time the binaries, 2nd and 3rd time the deps,
in parallel (sic!).
I took a look at Makefile and found this, and some more problems,
like:
- dependencies are generated but not included
- cleandep does not depend on clean
- groups.c dependencies are not generated (or used)
- "make all" does not make groups binary
- overcomplicated and unused groups.{pid,out,cleanout} targets
- extra -f flag to rm
- etc.
This patch (hopefully) fixes all of the above. In addition, it provides
a few enhancements:
- enables "silent make" rules, so now lib/ is in line with the rest of zdtm
- adds "dep" target (not used, just for convenience)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Before dump:
438 437 0:51 /mtest /zdtm/static/mnt_ext_manual.test rw,relatime - tmpfs zdtm_auto_ext_mnt rw
439 437 0:51 /mtest /zdtm/static/mnt_ext_manual_private_shared_bind.test rw,relatime shared:144 - tmpfs zdtm_auto_ext_mnt rw
440 437 0:51 /mtest /zdtm/static/mnt_ext_manual_bind.test rw,relatime shared:144 - tmpfs zdtm_auto_ext_mnt rw
441 437 0:51 /mtest /zdtm/static/mnt_ext_manual_slave_shared_bind.test rw,relatime shared:145 master:144 - tmpfs zdtm_auto_ext_mnt rw
442 437 0:51 /mtest /zdtm/static/mnt_ext_manual_slave_bind.test rw,relatime master:145 - tmpfs zdtm_auto_ext_mnt rw
>From log: mount mnt_ext_manual_slave_bind is restored as slave of
mnt_ext_manual_slave_shared_bind, which is restored as slave of
mnt_ext_manual_private_shared_bind, which is restored as shared of
mnt_ext_manual_bind, which is restored as private bind of external,
that is exactly the same way mnt_is_external() looks for external.
v2: fix test to cover all cases in mnt_is_external()
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
"make uninstall" is supposed to remove all the files that
"make install" (with the same arguments) have created.
This is a test to check that.
PS ideally, "make uninstall" should also remove any empty directories,
but let's not care about it for now.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
For compatibility with ccache (so it can cache the compilation results),
let's compile and link separately. For this, we have to
- disable the implicit make rules
- write the explicit ones
While at it, do use the "silent make" stuff that is already here
FIXME: figure out if it helps to speed up ccache build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
If using the '--keep-going' option, zdtm prints out an overview how many
tests were run, failed and skipped. This would also be useful to know if
it did not fail. This patch changes the output like this:
################## ALL TEST(S) PASSED (TOTAL 297/SKIPPED 36) ###################
or in the case of a failure it is unchanged:
################### 2 TEST(S) FAILED (TOTAL 297/SKIPPED 34) ####################
* zdtm/static/sched_policy00(ns)
* zdtm/static/cgroup02(h)
##################################### FAIL #####################################
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
decode_flav() was doing 'if i in flavors:' where 'i' was an integer but
the keys from the flavors dict are strings 'h', 'ns' and 'uns'.
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
To check that jump trampolines to rt-vdso works.
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
We support compat mode now (at least partially) so
the test should be allowed.
Acked-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
To run CRIU with ASan we have to use some non-default options:
- detect_leaks=0 - We have to many leaks for know. Let's disable until fixed.
- disable_coredump=0 - without this ASan library changes RLIMIT_CORE which
break rlmimits00 tests.
- log_path=asan.log - For some reason default output to stderr sometimes
doesn't work in CRIU. So error log will be stored
in asan.log.<pid> file instead.
travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy()
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The kernel does touch only relevant union member on x86_32.
travis-ci: success for zdtm/sigpending/32: check only 12 bytes of _si_fields
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
It's library plugin to CRIU - it needs to be 64-bit.
travis-ci: success for zdtm/test/rtc: build 64-bit criu-rtc.so
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
For 32-bit fcntl() Glibc function calls sys_fcntl64(), which
needs struct flock64, otherwise the kernel gets a wrong struct.
For 64-bit, it's all the same.
Also unset errno before fcntl() and check return value of the call.
Cc: Qiang Huang <h.huangqiang@huawei.com>
Cc: Begunkov Pavel <asml.silence@gmail.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for test/zdtm: use flock64 instead of flock
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
In this case it will work for any make commangs. For example:
make COMPAT_TEST=y -C test/zdtm/lib
travis-ci: success for zdtm: handle COMPAT_TEST from Makefile.inc
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
`make test COMPAT_TEST=y` will build all executable tests as i386 ELFs.
For building tests, need the following libraries from multilib:
libaio.i686 libaio-devel.i686 libcap-devel.i686 libcap.i686
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Now it looks prettier. Also deleted unnecessary parameters from
test's functions.
No functional changes.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Now it has 4 new tests:
ok 4 - section table start oob (64-bit ELF)
ok 5 - too many sections in table (64-bit ELF)
ok 6 - strings section's header oob of section table (64-bit ELF)
ok 7 - strings section oob (64-bit ELF)
I.e, if we forget to test string section's header oob with the next diff:
>--- a/compel/handle-elf.c
>+++ b/compel/handle-elf.c
>@@ -122,7 +122,7 @@ static const char *get_strings_section(Ehdr_t *hdr, uintptr_t mem,
> pr_err("String section @%#zx size %#lx is out of [%#zx, %#zx)\n",
> addr, (unsigned long)secstrings_hdr->sh_size,
> mem, mem + size);
>- return NULL;
>+ return (void*)addr;
> }
>
> return (void*)addr;
It will yell with:
ok 1 - zero ELF header (64-bit ELF)
...
not ok 6 - strings section's header oob of section table (64-bit ELF), expected -4 but ret is -1
...
not ok 12 - strings section's header oob of section table (32-bit ELF), expected -4 but ret is -1
Should be more useful when I add relocations tests after all.
(but this seems for me useful too).
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Yet they only test for ELF header, but soon I'll add more of them.
It's build with
$ make test/compel/handle_binary
and test output is in TAP format:
$ ./test/compel/handle_binary
ok 1 - check zero ELF header
ok 2 - check non-supported ELF header
ok 3 - check non-relocatable ELF header
ok 4 - check zero ELF header
ok 5 - check non-supported ELF header
ok 6 - check non-relocatable ELF header
(here two runs for x86_64 and x86_32 ELF binaries)
I'm planning to integrate it with Travis, so we will be
sure that compel is properly working (as this tests doesn't need
any ns and may be run on qemu-static).
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
================= Run zdtm/static/socket-tcp-nfconntrack in h ==================
Start test
Test is SUID
./socket-tcp-nfconntrack --pidfile=socket-tcp-nfconntrack.pid --outfile=socket-tcp-nfconntrack.out
Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
Makefile:331: recipe for target 'socket-tcp-nfconntrack.pid' failed
make: *** [socket-tcp-nfconntrack.pid] Error 1
Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
It works faster and allows to check exit codes.
travis-ci: success for series starting with [1/2] page-server: don't return a server pid from page-server
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for A few fixes to c/r a docker container with a console (rev3)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This is needed in cases when kernel doesn't support OFD locks.
(OFD locks were added in 2014).
travis-ci: success for zdtm: Add checkskip scripts for OFD locks
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Some distros put 'ip' util in /bin directory.
travis-ci: success for tests: add '/bin/ip' to deps in addition to '/sbin/ip'
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Opening /proc/<pid>/pagemap in userns is only available since linux
v4.3 or later, after commit 1c90308e7a77 (pagemap: hide physical
addresses from non-privileged users). So those tests fail on older
kernels:
https://ci.openvz.org/job/CRIU/job/CRIU-virtuozzo/job/criu-dev/1402
travis-ci: success for zdtm: do not run cow0x tests in userns
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The test has to do nothing during c/r.
======================= Run zdtm/static/socket_aio in ns =======================
Start test
./socket_aio --pidfile=socket_aio.pid --outfile=socket_aio.out
Run criu dump
Run criu restore
5: Old maps lost: set(["7f0a5188a000-7f0a5188f000 ['rw-p']"])
5: New maps appeared: set(["7f0a51884000-7f0a5188f000 ['rw-p']", "7f0a51883000-7f0a51884000 ['---p']"])
Send the 9 signal to 97
Wait for zdtm/static/socket_aio(97) to die for 0.100000
Reported-by: Mr Jenkins
travis-ci: success for zdtm/socket_aio: add a synchonization between processes
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
CID 174800 (#1 of 1): Out-of-bounds write (OVERRUN)
5. overrun-local: Overrunning array buf of 1024 bytes at byte offset 1024 using index n (which evaluates to 1024).
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
CID 174774 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return 1;.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
They pass in userns, so we can run them by default.
travis-ci: success for zdtm: run more tests in userns
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
If we have two sockets and send an upd message from one to another,
we can't be sure that it will be delivered immediately,
there is a change to get from recv(..., MSG_DONTWAIT) EGAIN.
This message is handled asynchronously in a kernel space, so
there may be a small timeout before we get it from another socket.
v2: fix socket6_udp too
Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
If desc is empty we should not try to eval it,
otherwise it would lead to exceptio. So test
for its size as well.
travis-ci: success for zdtm.py: Fix eval error if empty desc file provided
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It is an rudiment of zdtm.sh. Now we don't add ps to a test root
and we want to avoid forks in tests where it isn't supposed to be
called.
travis-ci: success for zdtm: don't call ps from tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In some old distros -m state doesn't work correctly and test fails
because test output diverges from expected results. Here we replace
obsoleted -m state with -m conntrack.
travis-ci: success for series starting with [v2,1/2] test: replace cat in Makefiles with awk
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>