Commit graph

21 commits

Author SHA1 Message Date
Adrian Reber c70657a6d1
Add tests for --ignore-rootfs checkpoint/restore option
This adds three tests for the --ignore-rootfs option to verify that it
works in all combination.

1. Not used at all
2. Only used during restore
3. Only used during checkpoint

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-07-11 15:27:38 +02:00
Adrian Reber d0f540e24d
Use random IP addresses during checkpoint/restore tests
This tries to reduce CI errors which might happen due to parallel CI
runs which all are using the same IP addresses. Using random addresses
should reduce the possibility of parallel tests using the same IP address.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-07-09 08:04:19 +02:00
Adrian Reber 95719b6d6b
Add exec after checkpoint/restore test
A container restored from a checkpoint archive used to have the root
file-system mounted with a wrong (new) SELinux label. This made it, for
example, impossible to use 'podman exec' on a restored container.

This test tests exactly this. 'podman exec' after 'podman container restore'.

Unfortunately this test does not fail, even without the patch that fixes
it as the test seems to run in an environment where the SELinux label of
the container root file-system is not relevant. Somehow.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-25 19:42:04 +02:00
Adrian Reber bef83c42ea
migration: add possibility to restore a container with a new name
The option to restore a container from an external checkpoint archive
(podman container restore -i /tmp/checkpoint.tar.gz) restores a
container with the same name and same ID as id had before checkpointing.

This commit adds the option '--name,-n' to 'podman container restore'.
With this option the restored container gets the name specified after
'--name,-n' and a new ID. This way it is possible to restore one
container multiple times.

If a container is restored with a new name Podman will not try to
request the same IP address for the container as it had during
checkpointing. This implicitly assumes that if a container is restored
from a checkpoint archive with a different name, that it will be
restored multiple times and restoring a container multiple times with
the same IP address will fail as each IP address can only be used once.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-04 14:02:51 +02:00
Adrian Reber 2aa3261744
Add test case for container migration
The difference between container checkpoint/restore and container
migration is that for migration the container which was checkpointed
must not exist during restore. To simulate migration the container
is remove ('podman rm -fa') before being restored. The migration test
does following steps:

 * podman run
 * podman container checkpoint -l -e /tmp/checkpoint.tar.gz
 * podman rm -fa
 * podman container restore -i /tmp/checkpoint.tar.gz

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-03 22:05:12 +02:00
baude f610a485c1 use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image
stores as read-only image caches.  this cuts down on test time
significantly because each test does not need to restore the images from
a tarball anymore.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-29 15:12:05 -05:00
Adrian Reber 76df31830c
Only run checkpoint/restore tests on Fedora >= 29
Only Fedora 29 and newer has an updated container-selinux and
selinux-policy new enough to support CRIU in restoring threaded
processes in a container with SELinux enabled.

Also skip checkpoint/restore tests if rootless. CRIU requires root.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-05-06 13:02:52 +02:00
baude d5546008ab ginkgo status improvements
a series of improvements to our ginkgo test framework so we can
get better ideas of whats going on when run in CI

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 13:28:33 -06:00
OpenShift Merge Robot 2747c20867
Merge pull request #2485 from adrianreber/oci-check
Verify that used OCI runtime supports checkpoint
2019-03-01 12:04:29 -08:00
Adrian Reber 43fe2bf064
Verify that used OCI runtime supports checkpoint
To be able to use OCI runtimes which do not implement checkpoint/restore
this adds a check to the checkpoint code path and the checkpoint/restore
tests to see if it knows about the checkpoint subcommand. If the used
OCI runtime does not implement checkpoint/restore the tests are skipped
and the actual 'podman container checkpoint' returns an error.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-03-01 08:08:55 +01:00
Adrian Reber 6412b05211
Skip checkpoint/restore tests on Fedora for now
There is currently still one SELinux related checkpoint/restore problem:
https://github.com/containers/libpod/issues/2334

To avoid unnecessary CI failures the checkpoint/restore tests are
temporarily disabled on Fedora.

It is not necessary to disable the tests on Ubuntu as it is running
without SELinux and it is also not necessary to disable the RHEL 7 tests
as RHEL's CRIU is too old to run the checkpoint/restore tests at all.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-02-27 16:32:59 +01:00
baude b30a56c156 Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using
the remote client.

Only the images_test.go file is run right now; all the rest are
isolated with a // +build !remotelinux.  As more content is
developed for the remote client, we can unblock the files and
just block single tests as needed.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-14 14:51:32 -06:00
Adrian Reber ab8e03b3e7
Added checkpoint/restore test for same IP
Restoring a container from a checkpoint should give the container the
same IP as before checkpointing. This adds a test to make sure the IP
stays the same.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-01-09 07:34:57 +01:00
Adrian Reber e11cbd7129
Enable checkpoint test with established TCP connections
Signed-off-by: Adrian Reber <areber@redhat.com>
2019-01-09 07:34:57 +01:00
Adrian Reber 2b41cd5fd3
Re-enable checkpoint/restore CI tests on Fedora
Now that the correct distribution CRIU packages are installed the
checkpoint/restore tests should no longer fail. This re-enables the
disabled tests on Fedora.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-12-28 14:05:27 +01:00
Chris Evich cb89409a71
Skip checkpoint tests on Fedora <30
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 11:16:00 -05:00
baude dd81a8fe7d disable checkpoint tests on f29
temporarily disabling checkpoint tests on f29 as they don't currently pass.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 14:39:47 -06:00
Adrian Reber d3cde7cefe
Added more checkpoint/restore test cases
This adds checkpoint/restore test cases for the newly added options
 * --leave-running
 * --tcp-established
 * --all
 * --latest

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Yiqiao Pu 74bcfc2f96 Separate common used test functions and structs to test/utils
Put common used test functions and structs to a separated package.
So we can use them for more testsuites.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-16 10:49:00 +08:00
Adrian Reber a14155917b
tests: use existing CRIU version check
Do not re-implement the CRIU version check in the test suite, use it
from libpod/pkg/criu.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-23 12:52:03 +02:00
Adrian Reber 5246238e7e
tests: add checkpoint/restore test
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00