Commit graph

35 commits

Author SHA1 Message Date
Daniel J Walsh a5e37ad280
Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
Daniel J Walsh a10d5b42ab
Change buildtag for remoteclient to remote for testing
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-06 15:22:24 -04:00
Valentin Rothberg 8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
Valentin Rothberg a5facca78f e2e: disable checkpoint test on Ubuntu
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-08 16:51:32 +02:00
Brent Baude efd1422143 Enable Ubuntu tests in CI
Add updates required for ubuntu and run integration tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-08 12:21:16 +02:00
Adrian Reber 7660330ae2
checkpoint: change runtime checkpoint support test
Podman was checking if the runtime support checkpointing by running
'runtime checkpoint -h'. That works for runc.

crun, however, does not use '-h, --help' for help output but, '-?,
--help'.

This commit switches both checkpoint support detection from
 'runtime checkpoint -h'
to
 'runtime checkpoint --help'.

Podman can now correctly detect if 'crun' also support checkpointing.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-04-03 18:00:57 +02:00
Adrian Reber 225c7ae6c9
Correctly export the root file-system changes
When doing a checkpoint with --export the root file-system diff was not
working as expected. Instead of getting the changes from the running
container to the highest storage layer it got the changes from the
highest layer to that parent's layer. For a one layer container this
could mean that the complete root file-system is part of the checkpoint.

With this commit this changes to use the same functionality as 'podman
diff'. This actually enables to correctly diff the root file-system
including tracking deleted files.

This also removes the non-working helper functions from libpod/diff.go.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-12-09 13:29:36 +01:00
Adrian Reber 5e43c7cde1
Disable checkpointing of containers started with --rm
Trying to checkpoint a container started with --rm works, but it makes
no sense as the container, including the checkpoint, will be deleted
after writing the checkpoint. This commit inhibits checkpointing
containers started with '--rm' unless '--export' is used. If the
checkpoint is exported it can easily be restored from the exported
checkpoint, even if '--rm' is used. To restore a container from a
checkpoint it is even necessary to manually run 'podman rm' if the
container is not started with '--rm'.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-11-28 20:25:45 +01:00
Jakub Filak 2497b6c77b
podman: add support for specifying MAC
I basically copied and adapted the statements for setting IP.

Closes #1136

Signed-off-by: Jakub Filak <jakub.filak@sap.com>
2019-11-06 16:22:19 +01:00
Jhon Honce 60d0be17fc Refactor tests when checking for error exit codes
Rather than checking for non-zero, we need to check for >0 to
distinguish between timeouts and error exit codes.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-10-16 08:10:07 -07:00
Adrian Reber 0c9a941d01
Test that restored container does not depend on the original container
In the restore from external checkpoint archive test, the second restore
using a new name and ID is now done first to ensure that nothing in the
restored container depends on the original container.

Test has been adapted to catch errors like the one fixed with the
previous commit to adapt ConmonPidFile for restored containers.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-08-09 19:26:57 +02:00
Adrian Reber c23b92b409
restore: added --ignore-static-ip option
If a container is restored multiple times from an exported checkpoint
with the help of '--import --name', the restore will fail if during
'podman run' a static container IP was set with '--ip'. The user can
tell the restore process to ignore the static IP with
'--ignore-static-ip'.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-08-02 10:10:54 +02:00
Daniel J Walsh 5370d9cb76
Add new exit codes to rm & rmi for running containers & dependencies
This enables programs and scripts wrapping the podman command to handle
'podman rm' and 'podman rmi' failures caused by paused or running
containers or due to images having other child images or dependent
containers. These errors are common enough that it makes sense to have
a more machine readable way of detecting them than parsing the standard
error output.

Signed-off-by: Ondrej Zoder <ozoder@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-08-01 03:40:29 -04:00
Adrian Reber 90ffba92e9
Move random IP code for tests from checkpoint to common
The function to generate random IP addresses during ginkgo tests in
the checkpoint test code is moved to common and all tests using
hardcoded IP addresses have been changed to use random IP addresses to
reduce test errors when running the tests in parallel.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-07-29 14:24:08 +02:00
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