351 Commits

Author SHA1 Message Date
690c52a113 Allow users to expose ports from the pod to the host
we need to allow users to expose ports to the host for the purposes
of networking, like a webserver.  the port exposure must be done at
the time the pod is created.

strictly speaking, the port exposure occurs on the infra container.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-20 09:49:34 -06:00
aaa31bbb1a Fix no-new-privileges test
Update the test to compare the output from different containers.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-16 10:49:24 +08:00
a7122d68de The system test write with ginkgo
The tests can be filter by --focus and --skip to fit different test
target. Also be able to set global options and cmd options by export
it to ENV to fit different test matrix.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-16 10:49:12 +08:00
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
2dd9cae37c rm -f now removes a paused container
We now can remove a paused container by sending it a kill signal while it
is paused.  We then unpause the container and it is immediately killed.

Also, reworked how the parallelWorker results are handled to provide a
more consistent approach to how each subcommand implements it. It also
fixes a bug where if one container errors, the error message is duplicated
when printed out.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-08 15:18:11 -06:00
b598d6829b Fix run --hostname test that started failing post-merge
Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-11-07 16:26:42 -05:00
90662c2fa3 Merge pull request #1751 from QiWang19/issue1745
Add hostname to /etc/hosts
2018-11-07 08:58:19 -08:00
879f9116de Add hostname to /etc/hosts
Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-11-07 09:55:59 -05:00
b89a7c7406 Fix cleanup for "Pause a bunch of running containers"
When running integration tests in our CI, we observe a problem where paused containers
are not able to be stopped; and therefore cannot be cleaned up.  This leaves dangling mounts
and sometimes zombied conmon processes.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-06 19:35:22 -06:00
b559c19c2f Make kill, pause, and unpause parallel.
Operations like kill, pause, and unpause -- which can operation on one or
more containers -- can greatly benefit from parallizing its main job (eq kill).

In the case of pauseand unpause, an --all option as was added. pause --all will
pause all **running** containers.  And unpause --all will unpause all **paused**
containers.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-01 14:23:55 -05:00
732a4c814e Merge pull request #1738 from baude/pararestart
Make restart parallel and add --all
2018-11-01 12:19:14 -07:00
2011782d9d Make restart parallel and add --all
When attempting to restart many containers, we can benefit from making
the restarts parallel.  For convenience, two new options are added:

--all attempts to restart all containers
--run-only when used with --all will attempt to restart only running containers

Signed-off-by: baude <bbaude@redhat.com>
2018-11-01 13:14:12 -05:00
a610f0f869 replace quay.io/baude to quay.io/libpod
images used for our integration suite have moved from my work account
to a group organization called libpod.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-01 10:31:44 -05:00
0360ec725a allow ppc64le to pass libpod integration tests
this pr allows the libpod integration suite to pass on the
ppc64le architecture.  in some cases, I had to skip tests.
eventually, these tests need to be fixed so that they properly pass. of
note for this PR is:

* changed the ppc64le default container os to be overlay (over vfs) as vfs seems non-performant on ppc64le
* still run vfs for rootless operations
* some images names for ppc64le had to change because they don't exist.
* this should help getting our CI to run on the platform

Signed-off-by: baude <bbaude@redhat.com>
2018-10-31 18:40:09 -05:00
aa853b2091 Merge pull request #1585 from rhatdan/labels
Add tests for selinux labels
2018-10-26 07:30:39 -07:00
f9fb62c737 Add tests for selinux labels
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-25 09:33:08 -04:00
606a5cec8f runlabel: run any command
As discussed [1], the runlabel command should execute any command
specified in a label.  The reasoning behind is that we cannot restrict
which options are passed to Podman which thereby has full access to the
host (runlabels must be used with care).

With the updated semantics, runlabel will substitute the commands with a
basepath equal to "docker" or "podman" with "/proc/self/exe", and
otherwise leave the command unchanged to execute any other command on
the host.

[1] https://github.com/containers/libpod/pull/1607#issuecomment-428321382

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
2018-10-24 14:02:43 +02:00
41a4827f84 Merge pull request #1638 from baude/fastps
Make podman ps fast
2018-10-23 09:05:20 -07:00
2e6bc3c7af Merge pull request #1627 from adrianreber/criu
Add CRIU version check for checkpoint and restore
2018-10-23 07:53:11 -07:00
ab2b3d64ce Merge pull request #1697 from baude/statserr
correct stats err with non-running containers
2018-10-23 07:27:19 -07:00
ee8f19e7be Make podman ps fast
Like Ricky Bobby, we want to go fast.

Signed-off-by: baude <bbaude@redhat.com>
2018-10-23 08:26:21 -05:00
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
6362158615 correct stats err with non-running containers
when doing stats -a|--all, if you have non-running containers, we should
not error on not being able to get information like PID, etc on them.

Signed-off-by: baude <bbaude@redhat.com>
2018-10-22 17:07:42 -05:00
949d292567 Use restoreArtifacts to save time in integration tests
Signed-off-by: baude <bbaude@redhat.com>
2018-10-22 17:07:04 -05:00
4662d06efd fix NOTIFY_SOCKET in e2e testfix NOTIFY_SOCKET in e2e tests
Signed-off-by: baude <bbaude@redhat.com>
2018-10-18 10:38:16 -05:00
bfc473f982 Vendor in new new buildah/ci
libpod requires new buildah and container image versions to resolve
bug #1640298

Signed-off-by: baude <bbaude@redhat.com>
2018-10-17 17:04:19 -05:00
e1521c6323 tests: do not make assumptions on the mount output
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-10-14 16:52:30 +02:00
04a537756d Generate a passwd file for users not in container
If someone runs podman as a user (uid) that is not defined in the container
we want generate a passwd file so that getpwuid() will work inside of container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-12 07:08:13 -04:00
a54709129f Add tests for --ip flag
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-11 11:24:08 -04:00
5246238e7e tests: add checkpoint/restore test
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:40 +02:00
14473270d7 Add ability for ubuntu to be tested
unfortunately the papr CI system cannot test ubuntu as a VM; therefore,
this PR still keeps travis.  but it does include fixes that will be required
for running on modern versions of ubuntu.

Signed-off-by: baude <bbaude@redhat.com>
2018-10-03 12:45:37 -05:00
d5687946f6 Merge pull request #1528 from baude/runlabel
Add container runlabel command
2018-10-02 17:16:43 -07:00
86d435f32f Disable SELinux labeling if --privileged
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-02 03:44:46 -04:00
f60fe5fb2f Vendor in the latest containers/storage, image and buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-29 08:01:25 +02:00
4f825f2e07 Add container runlabel command
Execute the command as described by a container image.  The value of the label is processed
into a command by:

1. Ensuring the first argument of the command is podman.
2. Substituting any variables with those defined by the environment or otherwise.

If no label exists in the container image, nothing is done.

podman container runlabel LABEL IMAGE extra_args
Signed-off-by: baude <bbaude@redhat.com>
2018-09-28 14:14:13 -05:00
a931c44104 run complex image names with short names
In cases where the image name is more complex like:

quay/baude/alpine_nginx:latest  and is not from the docker
registry, we need to be able to run the image by its shortname
such as baude/alpine_nginx.  The same goes when the image is
not from a registry but instead has the localhost repository.

This resolves buildah issue #1034

Signed-off-by: baude <bbaude@redhat.com>
2018-09-28 12:48:54 -05:00
502e387483 podman runs disabled containers and privileged containers as spc_t
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-27 17:23:58 +02:00
4073541981 rework CI tests to test on VMs
This PR makes several key changes to our CI testing.  Firstly, we now test
podman on fedora 28, fedora 29, and centos VMS (rather than containers). Any
of these that having failing tests are not marked as required yet. We
still preserve the podman in podman and podman in docker tests as well and
they are marked as required.

The lint and validate work is now done on a openshift container.  We also
removed the rpm verification on papr and perform this test under the "images"
test on the openshift ci.

This PR exposes integration test fails on some of our OSs.  My expectation is we
will fix those in additional PRs and as they are fixed, we should be flipping
the boolean bit to required.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1492
Approved by: mheon
2018-09-26 15:47:29 +00:00
f4e2810fcb Put openshift dockerfiles in test/install
Move the location of the openshift dockerfiles and delete the old one.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1542
Approved by: mheon
2018-09-25 21:44:51 +00:00
52c1365f32 Add --mount option for create & run command
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1524
Approved by: mheon
2018-09-21 21:33:41 +00:00
1a59c4d5fe test, rootless: enforce cgroupfs manager
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1515
Approved by: baude
2018-09-20 13:31:59 +00:00
28a2bf827a Add new tests for ipc namespace sharing
We seem to be having a few flakes on namespace sharing.
Adding this test to make sure sharing with the host is working correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1485
Approved by: mheon
2018-09-17 16:55:11 +00:00
0c0de6dcc5 change search test to look for fedora and not fedora-minimal
Signed-off-by: baude <bbaude@redhat.com>
2018-09-14 13:49:58 -05:00
70b160ae03 Search registries with an empty query
Adds functionality to search registries implementing the v2
endpoint with an empty query, that is the results will be
all the available images on the registries.
If this is tried with a v1 registry an error will occur.
To search a whole registry, there needs to be a trailing slash
at the end, i.e `podman search registry.fedoraproject.org/`.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>

Closes: #1444
Approved by: rhatdan
2018-09-13 16:20:40 +00:00
60e8e4fb2d run different cgroup tests depending on conditions
when running podman's integration tests, we need to be able to understand
our environment because the podman command will differ as will the results.

there is no 100% way to know if we are in a container, but using a combination
of container= and checking /proc seemed reasonable for our test suite.  non of this
code is run in podman proper.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1441
Approved by: mheon
2018-09-12 20:20:50 +00:00
d9580ec62b Pass on securityOpts from podInfraContainer to container added to pod.
This is an incomplete fix, as it would be best for the libpod library to be in charge of coordinating the container's dependencies on the infra container. A TODO was left as such. UTS is a special case, because the docker library that namespace handling is based off of doesn't recognize a UTS based on another container as valid, despite the library being able to handle it correctly. Thus, it is left in the old way.

Signed-off-by: haircommander <pehunt@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1347
Approved by: mheon
2018-09-11 13:31:55 +00:00
87f90ce14a Fix pod sharing for utsmode
We should be sharing cgroups namespace by default in pods
uts namespace sharing was broken in pods.

Create a new libpod/pkg/namespaces for handling of namespace fields
in containers

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1418
Approved by: mheon
2018-09-07 18:18:54 +00:00
782caea801 Add first pass for baseline pod tests
This bash script is meant to compliment the podman baseline
test script.  It primarily focuses on exercising the common
actions of pods.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1421
Approved by: rhatdan
2018-09-07 12:32:16 +00:00
43bcf99e6d Change shm test to be less flaky.
This tests fails a lot, I think because of a race condition. Changing to
just make sure the inode of the /dev/shm on the host is the same as inside
the container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1420
Approved by: mheon
2018-09-07 12:05:54 +00:00
8b2b88ebff Update WaitForTimeOut to output OutputString to help with debugging.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1416
Approved by: baude
2018-09-06 21:26:15 +00:00