I am regularly running zdtm.py after updating the CRIU rpm to test if
the new rpm still works. Until know I usually did:
-criu_bin = "../criu/criu"
-crit_bin = "../crit/crit"
+criu_bin = "/usr/sbin/criu"
+crit_bin = "/usr/bin/crit"
This commit adds two arguments to zdtm.py:
--criu-bin CRIU_BIN Path to criu binary
--crit-bin CRIT_BIN Path to crit binary
It still defaults to the old values from above, but can now easily be
changed to the CRIU binary provided by the packaging system.
This change was more complicated than expected which is probably related
to the fact that zdtm restarts itself in namespaces.
v2:
- rebase
v3:
- fix errors reported by 'make lint'
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
check_tun_netns_cr() should return 0 on CONFIG_TUN=n kernels.
That is, when we fail to open tun device.
Fixes: #496
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
test/dump/zdtm/static/msgque/43/1/ipcns-msg-12.img decode fails: object of type 'NoneType' has no len()
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Running the test suite on aarch64 showed two tests failing (static/fd
and transition/maps0007). Debugging showed that the
atomic_{sub,add}_return() functions did not return the value but the
lower 32bit of the address of that value.
Simply dereferencing the input solves the two mentioned test cases.
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Syscalls do return negative value in case of an error.
But errno contains the error code itself.
Add uint32_t to sys_futex() definition.
sizeof(unsigned int) might be not 4 bytes.
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Send pre-dump notify to 36
Traceback (most recent call last):
File "zdtm.py", line 2161, in <module>
do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
File "zdtm.py", line 1549, in do_run_test
cr(cr_api, t, opts)
File "zdtm.py", line 1264, in cr
test.pre_dump_notify()
File "zdtm.py", line 490, in pre_dump_notify
fdin.write(struct.pack("i", 0))
TypeError: write() argument 1 must be unicode, not str
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Here is an example of ldd output:
/musl # ldd /usr/lib/libxtables.so.12
ldd (0x7fae8e06c000)
libc.musl-x86_64.so.1 => ldd (0x7fae8e06c000)
We need to skip the "ldd (0x7fae8e06c000)" line.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
We don't tune tracers, so we don't expect to get anything.
In docker containers, debugfs isn't mounted and this command failed.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
fprintf in Alpine Linux calls writev, which is prohibited in the
SECCOMP_MODE_STRICT mode.
===================== Run zdtm/static/seccomp_strict in h ======================
Start test
Test is SUID
./seccomp_strict --pidfile=seccomp_strict.pid --outfile=seccomp_strict.out
make: *** [Makefile:385: seccomp_strict.pid] Error 1
Test zdtm/static/seccomp_strict FAIL at start: [Errno 2] No such file or directory: 'zdtm/static/seccomp_strict.pid'
Test output: ================================
22:45:24.661: 38: ERR: seccomp_strict.c:97: read (errno = 2 (No such file or directory))
22:45:24.662: 37: ERR: test.c:315: Test exited unexpectedly with code 1
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Otherwise one library will be imported twice by two different names: py
and pycriu, because pycriu is used in the library.
https://github.com/checkpoint-restore/criu/issues/495
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
In case if dump_namespaces failed we may have
ret shadowed and erroneously report checkpoint
success.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
On fedora rawhide seccomp_metadata for some
reason is not defined (while in kernel it introduced
together with PTRACE_SECCOMP_GET_METADATA). So
lets do a trick for a while -- define own alias.
Once system headers get settled down we might find
more suitable solution. Because it's a part of kernel
API we're on the safe side.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
After CR_STATE_RESTORE_SIGCHLD stage triggered we are
not allowed to exit, just yield the BUG instead.
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
For python2/python3 compatibility install additional (python2-future)
and different (python2-ipaddress) packages during test.
Also switch Fedora tests to explicitly install versioned python packages
(python2-* instead of python-*).
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
As python3 imports are working a bit differently the structure of the
imported files needs to change. Instead of having symlinks to criu.py
and rpc_pb2.py which does not match the import structure just create
symlink to ../lib/py (like crit) to make zdtm usable again with the
python3 compatibility.
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
With this last commit of the crit with python3 series it is possible to
either use python2 or python3 with CRIU.
Now the basic build system functionality (make and make install) are
python2/python3 aware. zdtm.py and criu-coredump are still python2, but
as they are not part of 'make install' those parts have not yet been
ported from python2 to python3.
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This prepares CRIT for python2/python3 compatibility by auto-detecting
the installed python version. python2 is detected first and then the
variable PYTHON is set.
By setting the variable PYTHON to python2/python3 the user can override
the auto-detection.
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Otherwise, tests dependencies are not considered for build.
Add an error in Makefile.inc so this won't happen again.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This reverts commit dcafa78b96084216e32b757be62b7fa8aebbdd87.
I've found that we already include deps in Makefile.inc,
was to fast on the first attempt and overlooked this.
(the include just doesn't work like it should yet..)
The origin patch may be just dropped before preparing master's merge.
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This helper must init every member of a structure,
not some part of it. Beautify code as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Otherwise there is an imbalance in logs with number of
"Reverted working dir" message
| (00.018604) 36: unix: Connected 0x11ceff -> 0x11cf00 (0x11cf00) flags 0
| (00.018644) 36: unix: Reverted working dir
| (00.018652) 36: unix: Connected 0x11cefd -> 0x11cefe (0x11cefe) flags 0
| (00.018665) 36: unix: Reverted working dir
| (00.018688) 36: unix: Reverted working dir
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
To unify style of pointers fetching from memory slab.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
For readability sake. And use standart uint8_t types.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>