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>
This files are used by zdtm.sh. zdtm.py uses *.desc files.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Running test/zdtm.py run -t zdtm/transition/maps008 --snap --pre 30
in a loop I got test failure with "Mem differs"
error each ~20 minutes. The cause of the bug is in lack of
synchronization between processes that still do datagen stage of
test and processes that already do datacheck stage of test.
As a result we can get "Mem differs" error if:
1. Process P1 being on datacheck stage fetches a byte with
offset X from ashmem vma VMA1 into CPU register.
2. Process P2 still being on datagen stage changes byte with offset X
in the same ashmem vma VMA1.
3. Process P1 fetches byte with offset X from another ashmem vma VMA2
mapped to the same physical memory as VMA1.
4. Process P1 compares two fetched bytes and finds out that they
have different values.
5. Process P1 reports "Mem differs" error.
Race is fixed by waiting for all processes to exit datagen stage
before proceeding to datacheck stage.
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Here is a race when someone umounted something and this operation
isn't propagated into our namespace.
CRIU | Another process
-----------------------------------------------------------------
pivot_root(".", put_root) |
mount(put_root, MS_REC|MS_PRIVATE) |
| umount /xxx/yyy
| umount /xxx -> EBUSY
umount(put_root)
We do this to not affect mounts in put_root, but we can mask
these mounts as slave and this will work for us and for external
users.
Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
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>
There is no similar jenkins script that tests similar options now.
So make a new script.
Signed-off-by: Eugene Batalov <eabatalov89@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>
It can hapen in tty tests, where we get SIGHUP.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.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>
as these sysctls can not be set to -1(default) leave them uninitialized
sometimes
https://jira.sw.ru/browse/PSBM-48397
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Main test features:
- Non trivial ps tree with non trivial anon shmem regions
(no such test exists now).
- Each ps tree process continuously writes parts of anon shmem
vmas and validates these writes after restore
(required for dedup testing).
- Checking simultaneous changing of anon shmem contents in different
processes.
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's what we have when ReadOnlyDirectories=/ is set for systemd services.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
...and fix misprints that weren't caught before.
I guess, I never fixed that much (possible) bugs by one commit, heh.
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Currently during criu dump we create link remap in the same dir
where original file was opened. But that dir may not exist during
link remap creation. At the same time it's okay to create link
remap in any dir on the same mount point.
In this patch we do this. We check existance of every dir bottom
up through the original file path. We use the first existing dir.
Similar approach is used on criu restore during ghost file creation.
Signed-off-by: Egor Gorbunov <egor-mailbox@ya.ru>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.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>
v2: drop /bin/ps from test deps
v3: wait for the zombie to make sure it exits
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In the next patch, we'll introduce an option to allow for leaving zombie
processes in the pid ns for the test so that we can test the behavior of
zombies. Let's not reap everything after restore, since we'll reap the
restored zombies as well.
v2: restore the old behavior when in reap mode
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We'll use this variable in the next test to make sure the test suite
doesn't accidentally reap the zombie we want to leave around for the actual
test.
This is kind of ugly and there might be a better way to pass information to
the test's init, I'm open for suggestions :)
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
and move fs.mqueue.xxx from get_shared_memory_info to get_messages_info
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The directory that the tests run in on jenkins is:
/var/lib/jenkins/workspace/CRIU/CRIU-restore-sibling/criu-dev/test/zdtm/static
which makes the whole path too long. This commit makes the whole path:
/var/lib/jenkins/workspace/CRIU/CRIU-restore-sibling/criu-dev/test/zdtm/static/del_standalone_un.test/sock
which is 105 chars, less than 108 of sun_path.
Closes#191
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's quite boring to add your test to .gitignore and one may forget
to do that boilerplate -- put this labour on computer.
For that I make real targets for tests instead of implicit and
add test's binary name to .gitignore on make stage.
Also added *.pidns to .gitignore -- do not wanna do this as separate
trivial patch.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
static/transition tests are built with implicit rules.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
v2: open two sockets, one "on top" of the other
v3: also drop unnecessary unlink(), we can just rely on rename()
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
/proc/locks is racy with adding/removing locks,
so we may lose lock on check.
Use fdinfo's list of locks instead.
v2: Feature 'fdinfo_lock'
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's required because we specify a file instead of a block device.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Hopefully this would/will trigger more of these types of bugs; I took this
list straight from Adrian's report.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Adrian Reber <adrian@lisas.de>
Tested-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
--link-remap opt is obligatory for unlink_regular00 test.
Without it CRIU dump will fail because it won't be able to
create link remaps.
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
this avoids:
===================== Run zdtm/static/socket-tcpbuf6 in h ======================
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
Start test
Makefile:295: target 'mnt_enablefs.pid' given more than once in the same rule
./socket-tcpbuf6 --pidfile=socket-tcpbuf6.pid --outfile=socket-tcpbuf6.out
Run criu dump
Run criu restore
Wait for zdtm/static/socket-tcpbuf6 to die for 0.100000
Wait for zdtm/static/socket-tcpbuf6 to die for 0.200000
Removing dump/zdtm/static/socket-tcpbuf6/27
===================== Test zdtm/static/socket-tcpbuf6 PASS =====================
in every test.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.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>
1) Support autofs kernel-user exchange protocol
2) Test mounts: direct, indirect, offset (?) (migrated and operational).
3) Test cases, when write end of the pipe is closed, and when it's not.
4) Test catatonic mounts.
5) Test nested mounts are migrated (tmpfs suits it good)
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It uses --manage-cgroup full and can dump and restore cgroup of other tests.
Reported-by: Mr Jenkins
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>
1. First save/check all,default,lo together and only after - set them,
as setting some sysctls can affect the others
2. Set "accept_redirects" after "forwarding" both for ipv4 and ipv6
3. Change order to "all", "default", "lo"
*One can not set ipv6.conf.all.stable_secret, so don't even try, see:
commit 622c81d57b39 ("ipv6: generation of stable privacy addresses for
link-local and autoconf")
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
An oddity (bug?) means that we don't preserve empty cgroups in in the criu
cgset, since we don't dump it. So we do need to move things into tasks.
(This probably got commented out due to a bug in the Ubuntu kernel that I
ran across [1] which should be fixed shortly :)
[1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1588056
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Because we're doing this on the same host, the cgroups will already exist.
We need to write the properties in full mode to exercise these cases.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>