2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-27 20:37:57 +00:00

1777 Commits

Author SHA1 Message Date
Tycho Andersen
fd972a739c tests: fix cgroupns test to not use nested namespaces
Before we were unshare(CLONE_NEWCGROUP)ing in a child task, which meant
that we couldn't c/r this test once we forbid nested cgroup namespaces.

Instead, use a new strategy for testing cgroup namespaces: set up the
namespace before forking the test task so there is no nesting, and then do
a setns back to init's ns to check the cgroup namespace of the test. This
doesn't work in the 'ns' flavor because init in the test's pid ns is the
test itself. There is a bit of a chicken and egg problem here, though,
because if we set it up after test_init(), we can't unshare because that
would be a nested cgroup ns.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-03-03 14:00:13 +03:00
Tycho Andersen
93707b24cb test: add a test for dumping non-root-subset cg sets
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:39:25 +03:00
Andrey Ryabinin
c30e3ab23a test/vfork00: mark vfork test as expected to fail
We don't have a way to dump proccess blocked in vfork(), hence
mark this test as expected to fail.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:38:53 +03:00
Andrey Ryabinin
403a74c7ba test/vfork00: directly _exit() instead of exec() in vforked proccess
execlp() fails when we run vfork00 test inside namespace because we don't have
'/bin/true' there. Instead of execlp() in vfork-child we can just _exit().

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:38:37 +03:00
Pavel Emelyanov
f91d3f01a5 zdtm: Move crit test into others
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:36:05 +03:00
Andrew Vagin
17018b3c18 tests/others: a few fixes of paths
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:35:32 +03:00
Andrew Vagin
ee3bea7b88 tests: remove "live" from zdtm paths
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:35:30 +03:00
Andrew Vagin
6b4fb4d4de test: remove test/post-dump.sh
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:35:28 +03:00
Andrew Vagin
f6d9d8d41a tests: move app-emu in test/others/
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:35:26 +03:00
Cyrill Gorcunov
1e8c1069cd zdtm: Use predefined macro from nmk
We better should switch to nmk usage.
But lets c/p for now.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-29 11:34:29 +03:00
Cyrill Gorcunov
ed9d85c3e7 test: seccomp -- Make sure __NR_seccomp is present to not fail building on old kernels
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-26 15:00:07 +03:00
Tycho Andersen
4f0ee9c3b0 gitignore: add zdtm_mount_cgroups.lock
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-26 14:58:08 +03:00
Pavel Emelyanov
3bf5c88126 jenkins: Fix crit-recode's pycriu new module name
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-25 15:39:57 +03:00
Kir Kolyshkin
2edc082e07 Makefiles: don't use the FORCE, Luke!
With GNU make, using .PHONY leads to the same result as using
the "FORCE" hack, but unlike FORCE is not a hack. Since we do not
plan to use any other make than GNU make, let's just mark phony
targets as such.

For more details about why PHONY is better than FORCE, see
http://www.gnu.org/software/make/manual/make.html#index-FORCE

[v2: rebased and splitted]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 23:48:11 +03:00
Andrey Vagin
79e93ca79c zdtm: use a separate file for flock
In Ubuntu flock opens a file with O_RDWR and then it can't be executed
flock: ./zdtm_mount_cgroups: Text file busy

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 23:47:01 +03:00
Laurent Dufour
1ec3a107fd build: Use ppc64 for PowerPC 64 bits architecture
The nmk framework now references PowerPC 64 bits architectures as
ppc64. This applies for both little endian, and the future supported
big endian one.

Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 23:15:49 +03:00
Andrew Vagin
4a0dcbbf86 test: add a target to build zdtm_ct
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:16:44 +03:00
Andrew Vagin
2cb4532e26 tests: remove zdtm.sh (v2)
It was replaced by zdtm.py.

v2: remove zdtm.sh from other scripts
    remove fault-injection, because nobody uses it

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:09:57 +03:00
Andrew Vagin
88aaae3ace tests: move non-zdtm tests to tests/others/
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:09:17 +03:00
Tycho Andersen
b7375b1265 tests: add a cgroupns test
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:07:09 +03:00
Pavel Emelyanov
166a8e8e93 zdtm: Increate dump timeout
Tests are often run in VMs and 5 seconds on loaded environments might
be not enough to catch transition zdtm tests.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 17:56:02 +03:00
Pavel Emelyanov
c07ef80481 jenkins: The "live" subdir is no longer there
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 15:51:07 +03:00
Ivan Shapovalov
7f0643f9c3 treewide: specify 'python2' instead of 'python' in shebangs of python scripts
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 14:11:49 +03:00
Pavel Emelyanov
733c926abb test: Update .gitignore
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:40:55 +03:00
Pavel Emelyanov
2e13f1f029 test: Get rid of live directory
Move static and transition into zdtm top. We can't move all the micro
tests themselves, as we need to distinguish static from non static (zdtm.py
makes additional checks on static ones).

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:40:52 +03:00
Pavel Emelyanov
02b22eba8b test: Merge zdtm/live streaming and transition tests
These two sets are the same -- they test something and ask to be
C/R-ed at the time they do it. No other differences.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:40:50 +03:00
Pavel Emelyanov
d545a2d8fd test: Clean nsroot using zdtm.py script
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:40:48 +03:00
Andrew Vagin
3e0e65dd50 test: check restoring external fifo-s
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-17 13:50:46 +03:00
Tycho Andersen
b13a132eab gitignore: ignore more test dirs
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-17 13:29:28 +03:00
Tycho Andersen
7ae89758ac tests: remember to clean everything on make clean
If we forget to clean some of this stuff, we can get into strange states
where zdtm.py thinks it has constructed the root, but really hasn't, and
can't construct the root because it partially exists.

v2: kill all the extra debugging crap from v1

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-17 13:29:03 +03:00
Kirill Tkhai
076c73b21a zdtm: Add mntns_root_bind02 test
It's an extension of mntns_root_bind, which is differ by one more bind mount.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-16 10:50:52 +03:00
Cyrill Gorcunov
3a234722df test: jenkins -- Fix path for pycriu
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-16 10:48:15 +03:00
Pavel Tikhomirov
254a36d9b3 zdtm/ipc: migrate the array of more than one semaphore
We missed restore problems with multiple semaphores in one array
with vzt-cpt, enhance the test to catch it.

The problem was the change of 'struct sem' size which lead to wrong
memcpy of sem_array->sem_base in our kernel checkpointing.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-16 10:44:34 +03:00
Cyrill Gorcunov
f96718b3e3 test: zdtm.py -- Fix criu reference
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 19:22:44 +03:00
Laurent Dufour
0ff731a6d0 build: test -- Fix criu-rtc.so build error
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:48 +03:00
Dmitry Safonov
6effc59e2d zdtm.py: specify python version
Otherwise it may suck on some distros (Arch i.e):
make zdtm
make[2]: Entering directory '/home/japdoll/tools/criu/test'
./zdtm.py run -a --parallel 2
  File "./zdtm.py", line 33
    print "        ..."
                      ^
SyntaxError: Missing parentheses in call to 'print'
Makefile:25: recipe for target 'zdtm' failed
make[2]: *** [zdtm] Error 1
make[2]: Leaving directory '/home/japdoll/tools/criu/test'
Makefile:9: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/japdoll/tools/criu/test'
Makefile:258: recipe for target 'test' failed
make: *** [test] Error 2

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-12 16:54:05 +03:00
Tycho Andersen
518b444012 tests: get rid of HAVE_SECCOMP nonsense
Because of the #undef (probably left over from some debugging I did that
accidentally got committed), this test never ran. Anyway, this is all
unnecessary because we can just use the seccomp_filter feature flag in the
tests.

Also reenable the seccomp_filter_tsync test.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-12 16:42:53 +03:00
Tycho Andersen
726d87d9b9 tests: get rid of seccomp_filter_tsync.checkskip
This is superceded by criu check seccomp_filter and doesn't work on some
systems anyway.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-12 16:42:50 +03:00
Pavel Emelyanov
5b82e5c448 zdtm: Temporarily disable seccomp_filter_tsync test
It always exits with "no support" message and checkskip works strangely. Need
to resolve those two first."

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-11 13:40:13 +03:00
Tycho Andersen
36aedc3b11 zdtm.py: fix checkskip logic
Fix checkskip logic, also emit a clearer reason when checkskip fails as to
why the test was skipped.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-08 21:26:41 +03:00
Pavel Emelyanov
3606e755ce crit: Do not recode new netns-ct/-exp images
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-08 13:07:05 +03:00
Andrew Vagin
42165243eb test: check that contracks are dumped and restored
This tests sets filters which drops all packets which don't
belongs to current tcp connections and creates one tcp connection.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-08 11:42:43 +03:00
Andrew Vagin
b09356f4d7 test/tempfs_subns: wait all child processes
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-06 20:52:28 +03:00
Andrei Vagin
a28c4a9979 test: add --force-irmap for static/inotify_irmap
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-06 20:44:53 +03:00
Tycho Andersen
7fc8ecc5e1 tests: remember to clean up in some failure cases of cgroup01
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-05 12:38:50 +03:00
Andrew Vagin
e68008a80a zdtm_ct: don't create a new session
All processes should exit if an user presses ctrl-c.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-05 12:38:14 +03:00
Kirill Tkhai
fe078a0f52 zdtm: Disable unlink_regular00 by default
Skip it till remap-links are supported.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-05 12:37:25 +03:00
Kirill Tkhai
afe361f053 zdtm: Add unlink_regular00 test
Test checks that a deleted file content in a deleted parent directory
restores right. Initially directory is created in a separate mount,
to check the ghost file is created in right mount and link() in
rfi_remap() is working.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-03 16:27:49 +03:00
Laurent Dufour
685953e484 test/arm: Fix building on armv7l architecture
The issue here is that ARCH is not overwritten if the caller Makefile
already define it, and the upper Makefile is not overwriting the ARCH
define to "arm", when it is "armv7l" for instance, so the SRCARCH is
set to "armv7l" which is wrong.

With this patch, SRCARCH is using the inherinted define if called from
the top level Makefile.

This is required to build test on armv7l architecture (qemu).

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-03 16:26:05 +03:00
Tycho Andersen
ca7841601e tests: prevent zdtm_mount_cgroups from failing w/ EBUSY
Sometimes I get:

sudo ./zdtm.py run -t zdtm/live/static/cgroup03
umount: /home/tycho/packages/criu/test/zdtm.qPwsoO: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
Traceback (most recent call last):
  File "./zdtm.py", line 1401, in <module>
    tst.available()
  File "./zdtm.py", line 435, in available
    subprocess.check_call(["flock", "zdtm_mount_cgroups", "./zdtm_mount_cgroups"])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['flock', 'zdtm_mount_cgroups', './zdtm_mount_cgroups']' returned non-zero exit status 1

let's use a lazy unmount so we avoid this.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-03 16:25:28 +03:00