Commit graph

390 commits

Author SHA1 Message Date
Yiqiao Pu d9adcd198f Add some tests for --ip flag with run and create command
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-27 15:09:47 +08:00
baude 9d883d2032 add podman container|image exists
Add an exists subcommand to podman container and podman image that allows
users to verify the existence of a container or image by ID or name.  The return
code can be 0 (success), 1 (failed to find), or 125 (failed to work with runtime).

Issue #1845

Signed-off-by: baude <bbaude@redhat.com>
2018-11-26 09:19:39 -06:00
Valentin Rothberg 0e2042ebd7 set root propagation based on volume properties
Set the root propagation based on the properties of volumes and default
mounts.  To remain compatibility, follow the semantics of Docker.  If a
volume is shared, keep the root propagation shared which works for slave
and private volumes too.  For slave volumes, it can either be shared or
rshared.  Do not change the root propagation for private volumes and
stick with the default.

Fixes: #1834
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
2018-11-26 13:55:02 +01:00
baude 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
Yiqiao Pu 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
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
baude 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
Matthew Heon 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
OpenShift Merge Robot 90662c2fa3
Merge pull request #1751 from QiWang19/issue1745
Add hostname to /etc/hosts
2018-11-07 08:58:19 -08:00
Qi Wang 879f9116de Add hostname to /etc/hosts
Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-11-07 09:55:59 -05:00
baude 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
baude 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
OpenShift Merge Robot 732a4c814e
Merge pull request #1738 from baude/pararestart
Make restart parallel and add --all
2018-11-01 12:19:14 -07:00
baude 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
baude 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
baude 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
OpenShift Merge Robot aa853b2091
Merge pull request #1585 from rhatdan/labels
Add tests for selinux labels
2018-10-26 07:30:39 -07:00
Daniel J Walsh f9fb62c737
Add tests for selinux labels
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-25 09:33:08 -04:00
Valentin Rothberg 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
OpenShift Merge Robot 41a4827f84
Merge pull request #1638 from baude/fastps
Make podman ps fast
2018-10-23 09:05:20 -07:00
OpenShift Merge Robot 2e6bc3c7af
Merge pull request #1627 from adrianreber/criu
Add CRIU version check for checkpoint and restore
2018-10-23 07:53:11 -07:00
OpenShift Merge Robot ab2b3d64ce
Merge pull request #1697 from baude/statserr
correct stats err with non-running containers
2018-10-23 07:27:19 -07:00
baude 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
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
baude 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
baude 949d292567 Use restoreArtifacts to save time in integration tests
Signed-off-by: baude <bbaude@redhat.com>
2018-10-22 17:07:04 -05:00
baude 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
Giuseppe Scrivano 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
Daniel J Walsh 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
Matthew Heon a54709129f Add tests for --ip flag
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-10-11 11:24:08 -04: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
baude 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
OpenShift Merge Robot d5687946f6
Merge pull request #1528 from baude/runlabel
Add container runlabel command
2018-10-02 17:16:43 -07:00
Daniel J Walsh 86d435f32f
Disable SELinux labeling if --privileged
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-10-02 03:44:46 -04:00
Daniel J Walsh 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
baude 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
baude 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
Daniel J Walsh 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
baude 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
Daniel J Walsh 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
Giuseppe Scrivano 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
Daniel J Walsh 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
baude 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
Urvashi Mohnani 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
baude 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
Daniel J Walsh 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
Daniel J Walsh 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
Daniel J Walsh 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
Daniel J Walsh 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
baude 4ddcbd7941 rmi remove all not error when no images are present
When running podman rm -a on a storage where no images exist,
the exit code should NOT be non-zero.

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

Closes: #1402
Approved by: rhatdan
2018-09-05 11:06:59 +00:00
Giuseppe Scrivano 807f6f8d8f rootless: check uid with Geteuid() instead of Getuid()
change the tests to use chroot to set a numeric UID/GID.

Go syscall.Credential doesn't change the effective UID/GID of the
process.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1372
Approved by: mheon
2018-09-04 14:36:57 +00:00
Giuseppe Scrivano bdee681409 rootless, tests: add tests for the pod command
also refactor the rootless_test.go to facilitate running a test in a
rootless context.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1372
Approved by: mheon
2018-09-04 14:36:57 +00:00
Giuseppe Scrivano 2ed79f6315 rootless: fix top
join the user namespace used to create the container so that psgo can
work in the same way as with root containers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1371
Approved by: rhatdan
2018-08-29 16:25:20 +00:00
Daniel J Walsh 1a90b2fd36 allow specification of entrypoint in the form of a slice
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1352
Approved by: mheon
2018-08-28 14:29:12 +00:00
Giuseppe Scrivano c33b359ed1 rootless, search: do not create a new userns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1360
Approved by: vrothberg
2018-08-28 11:25:01 +00:00
Giuseppe Scrivano 660bb0196c rootless, kill: do not create a new userns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1360
Approved by: vrothberg
2018-08-28 11:25:01 +00:00
Giuseppe Scrivano ff4c7a068a rootless, stop: do not create a new userns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1360
Approved by: vrothberg
2018-08-28 11:25:01 +00:00
Matthew Heon 2bc6427302 Fix handling of multiple filters in podman ps
Docker expects multiple filters to be passed with multiple uses
of the --filter flag (e.g. --filter=label=a=b --filter=label=c=d)
and not a single comma-separated list of filters as we expected.
Convert to the Docker format, and make some small cleanups to our
handling of filters along the way.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1345
Approved by: umohnani8
2018-08-27 14:47:41 +00:00
Giuseppe Scrivano 663ee91eec Fix Mount Propagation
Default mount propagation inside of containes should be private

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

Closes: #1305
Approved by: mheon
2018-08-27 13:26:28 +00:00
Giuseppe Scrivano bee654296b rootless: fix --ipc=host
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1349
Approved by: rhatdan
2018-08-27 12:49:32 +00:00
Giuseppe Scrivano fe00977fa5 rootless, tests: add test for --uts=host
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1349
Approved by: rhatdan
2018-08-27 12:49:32 +00:00
Giuseppe Scrivano 8b5823a62d rootless: don't use kill --all
The OCI runtime might use the cgroups to see what PIDs
are inside the container, but that doesn't work with rootless
containers.

Closes: https://github.com/containers/libpod/issues/1337

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1331
Approved by: rhatdan
2018-08-26 07:22:42 +00:00
Giuseppe Scrivano c5753f57c1 rootless: exec handle processes that create an user namespace
Manage the case where the main process of the container creates and
joins a new user namespace.

In this case we want to join only the first child in the new
hierarchy, which is the user namespace that was used to create the
container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1331
Approved by: rhatdan
2018-08-26 07:22:42 +00:00
Giuseppe Scrivano 720eb85ba5 rootless: fix exec
We cannot re-exec into a new user namespace to gain privileges and
access an existing as the new namespace is not the owner of the
existing container.

"unshare" is used to join the user namespace of the target container.

The current implementation assumes that the main process of the
container didn't create a new user namespace.

Since in the setup phase we are not running with euid=0, we must skip
the setup for containers/storage.

Closes: https://github.com/containers/libpod/issues/1329

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1331
Approved by: rhatdan
2018-08-26 07:22:42 +00:00
Kunal Kushwaha af9f83f11c exposes tcp port only if no proto specified.
Also it fix the issue of exposing both tc/udp port even if
only one proto specified.

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>

Closes: #1325
Approved by: mheon
2018-08-24 14:31:38 +00:00
haircommander 0e6266858a Fixing network ns segfault
As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1187
Approved by: mheon
2018-08-23 18:16:28 +00:00
haircommander 2a7449362f Change pause container to infra container
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1187
Approved by: mheon
2018-08-23 18:16:28 +00:00
haircommander d5e690914d Added option to share kernel namespaces in libpod and podman
A pause container is added to the pod if the user opts in. The default pause image and command can be overridden. Pause containers are ignored in ps unless the -a option is present. Pod inspect and pod ps show shared namespaces and pause container. A pause container can't be removed with podman rm, and a pod can be removed if it only has a pause container.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1187
Approved by: mheon
2018-08-23 18:16:28 +00:00
haircommander 88df4ea0f9 Add podman pod top
Using the vendored changes from psgo, incorporate JoinNamespaceAndProcessInfoByPids to get process information for each pid namespace of running containers in the pod. Also added a man page, and tests.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1298
Approved by: mheon
2018-08-23 15:01:17 +00:00
Matthew Heon e0c2fcadd2 Swap test image in exec test to fedora for useradd
We need a useradd binary in the container for this test, so swap
from Alpine to fedora-minimal.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1315
Approved by: vrothberg
2018-08-23 12:07:59 +00:00
Matthew Heon c3ec44b5a7 Add tests for exec --user
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1315
Approved by: vrothberg
2018-08-23 12:07:59 +00:00
Giuseppe Scrivano 4a95ef4a4e test: ad more tests for rootless containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1323
Approved by: umohnani8
2018-08-22 20:32:27 +00:00
haircommander 149481a571 Fixed segfault in stats where container had netNS none or from container
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1306
Approved by: rhatdan
2018-08-21 15:37:39 +00:00
haircommander 021027a24b Enable pod stats with short ID and name
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1307
Approved by: rhatdan
2018-08-21 14:34:08 +00:00
Daniel J Walsh 462c503a47 Fix handling of devices
Devices are supposed to be able to be passed in via the form of

--device /dev/foo
--device /dev/foo:/dev/bar
--device /dev/foo:rwm
--device /dev/foo:/dev/bar:rwm

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

Closes: #1299
Approved by: umohnani8
2018-08-20 13:42:07 +00:00
Giuseppe Scrivano 50afe5b031 podman: fix --uts=host
Do not set any hostname value in the OCI configuration when --uts=host
is used and the user didn't specify any value.  This prevents an error
from the OCI runtime as it cannot set the hostname without a new UTS
namespace.

Differently, the HOSTNAME environment variable is always set.  When
--uts=host is used, HOSTNAME gets the value from the host.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1280
Approved by: baude
2018-08-17 08:17:43 +00:00
baude bf741b3ea3 podman pod stats
add the ability to monitor container statistics in a pod.

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

Closes: #1265
Approved by: rhatdan
2018-08-17 07:55:36 +00:00
Daniel J Walsh d20f3a5146 switch projectatomic to containers
Need to get some small changes into libpod to pull back into buildah
to complete buildah transition.

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

Closes: #1270
Approved by: mheon
2018-08-16 17:12:36 +00:00
Daniel J Walsh cd7102a70e Fix handling of hostname in --net=host
Hostname should be set to the hosts hostname when network is none.

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

Closes: #1274
Approved by: giuseppe
2018-08-15 11:38:18 +00:00
Giuseppe Scrivano a04ce6893b rootless: not require userns for help/version
these commands do not require to be root in an userns

Closes: https://github.com/containers/libpod/issues/1263

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1268
Approved by: vrothberg
2018-08-14 14:33:31 +00:00
Matthew Heon a9b73abf8f Further fix tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-11 09:46:48 -04:00
Matthew Heon f77906932b Fix typo breaking tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-10 15:35:09 -04:00
Matthew Heon 4b4fba0b44 Only use cgroupfs for containerized tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-10 13:57:54 -04:00
Matthew Heon 8dad23857c Temporarily force all tests to use cgroupfs driver
TODO: Change this to only force cgroupfs if if we are in a
container.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-08-10 13:52:47 -04:00
baude 06fafe4cd0 add podman pod inspect
first pass of podman pod inspect

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

Closes: #1236
Approved by: rhatdan
2018-08-09 11:06:32 +00:00
haircommander 879453eaf1 Fix ambiguity in adding localhost to podman save
...and some naming decisions.

This change ensures podman save doesn't incorrectly prepend localhost when saving an image.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1140
Approved by: rhatdan
2018-08-08 21:04:11 +00:00
haircommander 26b9b17d27 Added ps --pod option
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1205
Approved by: rhatdan
2018-08-02 20:39:06 +00:00
baude a6de23278a Use REGISTRIES_CONFIG_PATH for all tests
We should not be using the test systems registries.conf file for integration
tests. We should always use a constructed file created specifically for the
integration tests or we stand to have unpredictable results.  The beforeTest
function now sets an environment variable pointing to a registries.conf file
in the test's tempdir.  That file will container docker.io as a default.

The afterTest function then clears the environment variable.

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

Closes: #1197
Approved by: rhatdan
2018-08-02 12:40:14 +00:00
baude a8ae7eae9c Integration Test Improvements #3
Third round of speed improvements to the integration tests.

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

Closes: #1193
Approved by: rhatdan
2018-08-01 13:01:44 +00:00
baude 5a4e5902a0 Integration Test Improvements #2
This is the second round of performance improvements for out
integration tests.

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

Closes: #1190
Approved by: rhatdan
2018-07-30 23:53:08 +00:00
baude 8694e5414c avoid spewing fds do to restore of cached images
due to how cstorage is designed, we were spewing thousands of fds when
we restored cached images causing unwieldy rlimits.  we now use podman
load to restore the images thereby not tripping the issue.

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

Closes: #1188
Approved by: baude
2018-07-30 20:28:30 +00:00
umohnani8 49bdd8421b Add load test for xz compressed images
The auto decompression functionality was already vendored in
with containers/image. Adding a test for it.

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

Closes: #1137
Approved by: rhatdan
2018-07-30 16:56:11 +00:00
baude 49b3647410 Speed up test results
Stop all containers with a zero timeout prior to trying to rm -fa.  This results
in quicker teardown times by not waiting for timeouts.

Also, with wait tests, no need to wait the full 10 second sleep.  1 will do.

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

Closes: #1181
Approved by: rhatdan
2018-07-30 12:26:39 +00:00
baude 433cbd5254 Show duration for each ginkgo test and test speed improvements
Because our tests are getting so long, we want to be able to audit which tests are taking
the longest to complete.  This may indicate a bad test, bad CI, bad code, etc and therefore
should be auditable.

Also, make speed improvements to tests by making sure we only unpack caches images that
actually get used.

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

Closes: #1178
Approved by: mheon
2018-07-28 22:51:08 +00:00
umohnani8 87d8edb4c1 podman rmi shouldn't delete named referenced images
If an image is created from another and it is deleted,
only delete the actual image and not the parent images
if the parent images have names/references.

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

Closes: #1174
Approved by: mheon
2018-07-28 01:40:28 +00:00
haircommander f258e43c7c Add pod pause/unpause
Added Pause() and Unpause() to libpod/pod.go

Added man pages, tests and completions

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1126
Approved by: rhatdan
2018-07-27 14:20:08 +00:00
haircommander 73e3945282 Add pod kill
With tests, man page, and completions.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1125
Approved by: rhatdan
2018-07-25 18:22:35 +00:00
haircommander 8ce0e0b246 Added pod restart
With tests, man page and completions.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1152
Approved by: rhatdan
2018-07-25 17:54:27 +00:00
umohnani8 e56717833e Clear variables used to store options after parsing for every volume
If more than one volume was mounted using the --volume flag in
podman run, the second and onwards volumes were picking up options
of the previous volume mounts defined. Found out that the options were
not be cleared out after every volume was parsed.

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

Closes: #1142
Approved by: mheon
2018-07-25 14:44:57 +00:00
Matthew Heon a05a97432c Add an E2E test to verify basic namespace functionality
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-24 16:12:31 -04:00
Matthew Heon 72c82fb79e
Merge pull request #1117 from haircommander/pod-start-stop1
Add pod start and stop
2018-07-20 13:50:54 -04:00
haircommander 0fecfeee63 Podman load/tag/save prepend localhost when no repository is present
Instead of having docker.io/library as its repository. Test included.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 11:46:11 -04:00
haircommander 17f257140e Added pod start and stop
As well as added tests, man pages, and completions.
Also reformatted and refactored a couple of other small things in the other pod commands.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 08:44:44 -04:00
Valentin Rothberg ba1871dac0 podman-top: use containers/psgo
Use github.com/containers/psgo instead of execing `ps (1)`.  The psgo
library enables a much more flexible interface with respect to which
data to be printed (e.g., capabilities, seccomp mode, PID, PCPU, etc.)
while the output can be parsed reliably.  The library does not use
ps (1) but parses /proc and /dev instead.  To list the processes of a
given container, psgo will join the mount namespace of the given
container and extract all data from there.

Notice that this commit breaks compatibility with docker-top.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1113
Approved by: rhatdan
2018-07-19 20:47:52 +00:00
Giuseppe Scrivano 9ae7b1a5b1 oci: keep exposed ports busy and leak the fd into conmon
Bind all the specified TCP and UDP ports so that another process
cannot reuse them.  The fd of the listener is then leaked into conmon
so that the socket is kept busy until the container exits.

Closes: https://github.com/projectatomic/libpod/issues/210

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1100
Approved by: mheon
2018-07-19 13:21:50 +00:00
Giuseppe Scrivano 6372c977ea rootless: require subids to be present
Most images won't work without multiple ids/gids.  Error out
immediately if there are no multiple ids available.

The error code when the user is not present in /etc/sub{g,u}id looks
like:

$ bin/podman run --rm -ti alpine echo hello
ERRO[0000] No subuid ranges found for user "gscrivano"

Closes: https://github.com/projectatomic/libpod/issues/1087

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1097
Approved by: rhatdan
2018-07-16 13:40:40 +00:00
Matthew Heon 2bdefc6c1e Fix ps --sort=size test
I don't know how the previous test was succeeding, as we never
actually fetched the sizes to sort with. The test now does.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 15:14:51 -04:00
Daniel J Walsh 827359c8e6
Merge pull request #1065 from haircommander/pod-start-create-rm
Podman pod create/rm/ps commands with man pages and tests
2018-07-13 13:57:04 -04:00
baude 6f1dd44b29 fix pull image that includes a sha
when pulling an image that includes a sha such as:

centos/nginx-112-centos7@sha256:42330f7f29ba1ad67819f4ff3ae2472f62de13a827a74736a5098728462212e7

the final image name in libpod should not contain portions of the sha itself nor the sha
identifier.  and like docker, we provide a 'none' tag as well.

this should fix #877

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

Closes: #1085
Approved by: mheon
2018-07-13 13:37:49 +00:00
haircommander a04a8d1dd4 Added full podman pod ps, with tests and man page
Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-13 09:17:33 -04:00
haircommander 1aad3fd96b Podman pod create/rm commands with man page and tests.
Includes a very stripped down version of podman pod ps, just for testing

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-13 09:05:03 -04:00
umohnani8 4f188aa191 podman rmi should only untag image if parent of another
podman rmi was deleting an image even if it was a parent of
another image. This fix just untags the image instead.
This also fixes podman rmi to remove intermediate images of
an image when the image is removed.

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

Closes: #1055
Approved by: mheon
2018-07-12 18:56:33 +00:00
Valentin Rothberg a62b3436db urfave/cli: fix regression in short-opts parsing
Add the actual argument, not the one we're looking for when searching
the to-be-translated short-opt string.  Otherwise, we're likely to hit
an infinite loop.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1066
Approved by: rhatdan
2018-07-09 20:02:29 +00:00
umohnani8 4855998f1c Add --volumes-from flag to podman run and create
podman now supports --volumes-from flag, which allows users
to add all the volumes an existing container has to a new one.

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

Closes: #931
Approved by: mheon
2018-07-09 19:30:03 +00:00
umohnani8 33870ea2c3 Fix timeout issue with built-in volume test
Building our own image to test built-in volume and user
instead of using the mariadb one.
Solves timeout issue in travis tests.

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

Closes: #1044
Approved by: mheon
2018-07-05 14:20:12 +00:00
Valentin Rothberg 49fe03c626 urfave/cli: fix parsing of short opts
Vendor an updated version of urfave/cli to fix the parsing of short
options.  Until the fix is merged upstream, vendor the code from
github.com/vrothberg/cli containing both, the latest urfave/cli and
the bug fix.

Fixes: #714
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1046
Approved by: rhatdan
2018-07-05 10:43:17 +00:00
TomSweeneyRedHat 6d8fac87ed Allow multiple mounts
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1030
Approved by: rhatdan
2018-07-03 18:02:45 +00:00
Matthew Heon 40e4481bd8 Skip a test in Travis that has timeout issues
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1041
Approved by: rhatdan
2018-07-03 10:09:12 +00:00
umohnani8 4c8c000f3a Fix built-in volume issue with podman run/create
The destination path of the built-in volume was not being created
but a relabel was being attempted on it, this was causing issues
with all images that have built-in volumes.
This patch fixes that and ensures the destination volume path
is created.

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

Closes: #1026
Approved by: mheon
2018-06-29 19:56:12 +00:00
Daniel J Walsh 7fc1a329bd Add podman container cleanup to CLI
When we run containers in detach mode, nothing cleans up the network stack or
the mount points.  This patch will tell conmon to execute the cleanup code when
the container exits.

It can also be called to attempt to cleanup previously running containers.

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

Closes: #942
Approved by: mheon
2018-06-29 15:25:21 +00:00
TomSweeneyRedHat 41bd607c12 Allow multiple containers and all for umount
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1012
Approved by: rhatdan
2018-06-29 15:01:21 +00:00
umohnani8 3b9046a170 Remove the --registry flag from podman search
Instead of setting the --registry flag to search a single registry,
prefix the registry before the image name in the input, an example is
`podman search registry.fedoraproject.org/fedora` and this will search for
the fedora image in only registry.fedoraproject.org.

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

Closes: #1011
Approved by: rhatdan
2018-06-28 16:55:29 +00:00
Giuseppe Scrivano ea06dccba2 test: add env variables to the debug output
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #936
Approved by: rhatdan
2018-06-27 14:07:17 +00:00
Matthew Heon 55dd266ec1 Add tests for podman refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
Daniel J Walsh 2c81a756e3 Update the version of conmon used in test
Also start using podmin in /usr/libexec/podman rather then crio.

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

Closes: #979
Approved by: baude
2018-06-22 13:19:08 +00:00
haircommander 4ab054073d Added --sort to ps
Also podman ps now allows user to only output size of root FS, changed language of images and ps --sort to be by "created" as opposed to "time", and refactored the way templates are created (converted from psJSONParams type).

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #948
Approved by: rhatdan
2018-06-19 14:45:29 +00:00
haircommander d8f2cb8622 TLS verify is skipped per registry.
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #952
Approved by: rhatdan
2018-06-18 18:46:55 +00:00
umohnani8 db094f6e15 Add --all,-a flag to podman images
podman images will not show intermediate images by default.
To view all images, including intermediate images created during
a build, use the --all flag.

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

Closes: #947
Approved by: rhatdan
2018-06-18 14:41:51 +00:00
Valentin Rothberg b1e709806d top: make output tabular
Make the output of top tabular to be compatible with Docker.  Please
note, that any user-input for `GetContainerPidInformation(...)` will be
ignored until we have found a way to generically and reliably parse ps-1
output or until there is a go-lib to extract all the data from /proc in
a ps-1 compatible fashion.

Fixes: #458
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #939
Approved by: rhatdan
2018-06-18 12:56:44 +00:00
haircommander b43677c9fd Added --tls-verify functionality to podman search, with tests
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #932
Approved by: baude
2018-06-15 17:09:33 +00:00
Giuseppe Scrivano 33eb31e031 test: add test for running a rootless container
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #871
Approved by: mheon
2018-06-15 14:53:19 +00:00
Matthew Heon c1ef1151ac Temporarily turn of ps --last test until fixed
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #944
Approved by: rhatdan
2018-06-14 19:03:52 +00:00
haircommander b868470238 Added --sort flag to podman image
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #937
Approved by: rhatdan
2018-06-14 10:26:21 +00:00
Daniel J Walsh 1cbce851fa Test to make sure we are getting proper exit codes on podman run
podman run command screws up we should get 125
podman run command succeeds but command in container fails to exec 126
podman run command succeeds but command exits with non 0 exit code

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

Closes: #921
Approved by: TomSweeneyRedHat
2018-06-07 21:32:39 +00:00
haircommander d7f9781bd6 Propegate exit code on Exec calls and integrated test
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #904
Approved by: rhatdan
2018-06-07 18:20:19 +00:00
Yiqiao Pu 28d1cec9f6 Add some test for podman run flag security-opt
Add following test cases for security-opt:
  - Check default selinux value
  - Disable security options in container
  - Setup selinux type in security-opt
  - Disable seccomp protection
  - Configure custom seccomp.json

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Yiqiao Pu c69f80c86c Add a function for e2e test to write json file
This function is used to write json format configure files.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Yiqiao Pu 37751ea5b5 Use go-selinux for selinux check
Use function in opencontainers/selinux/go-selinux to check the
selinux status in our test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Matthew Heon 6d52ebdd13 Add flag to add annotations to a container
Also add annotations from the image the container was created
from.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #886
Approved by: rhatdan
2018-06-04 17:52:28 +00:00
Daniel J Walsh bae80a0b66 Clear all caps, except the bounding set, when --user is specified.
Currently we are giving all caps to users when running with podman run --user,
They should get none by default.  If the command line includes --cap-add, then
we need to run with those capabilties.  Similarly we need to drop caps from
bounding set, if user specifies --cap-drop

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

Closes: #851
Approved by: mheon
2018-05-31 13:46:08 +00:00
umohnani8 c8b72e57a7 save and load should support multi-tag for docker-archive
The docker-archive tar files can have multiple tags for the same
image stored in it. Load pulls all the tags found in the archive
when loading a tar file. Save can oush multiple tags of the same
image to a tar archive.

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

Closes: #819
Approved by: rhatdan
2018-05-25 15:15:47 +00:00
Jhon Honce 684b544e9c Spell check strings and comments
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #831
Approved by: rhatdan
2018-05-25 08:45:15 +00:00
Nalin Dahyabhai e686269da3 chrootuser: default to GID 0 when given a numeric --user
When we're given a numeric --user value, default to GID 0 if the numeric
ID doesn't correspond to a user entry in /etc/passwd that can provide us
with the user's primary group ID.

Make sure that GetAdditionalGroupsForUser() returns wrapped errors.

Also test various user:group forms.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #728
Approved by: mheon
2018-05-17 17:05:44 +00:00
umohnani8 7dced311d1 Allow push/save without image reference
If the user uses the image ID when saving to either docker-archive
or oci-archive, then do not save a reference in the manifest/index.json.
If the user chooses to push without an image reference, i.e <transport>:<path>
it should be valid and succeed.

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

Closes: #782
Approved by: rhatdan
2018-05-16 18:06:52 +00:00
Matthew Heon fee9ec1858 Skip systemd-style CGroups test
Until we get Systemd cgroup manager working, this will
cause a validation error.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
Giuseppe Scrivano 769f8f2d72 test/e2e/run_userns_test.go: new file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
baude 970eaf0033 podman should assign a host port to -p when omitted
If the user does not provide a host port when adding -p to create/run, podman should inject an available random port.

podman run -p 80 .... podman should assign a random port to the host and expose the container port 80 to it

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

Closes: #703
Approved by: rhatdan
2018-05-01 21:47:34 +00:00
baude 9924956dc8 do not commit default volumes from container
when performing a container commit, we should not add the default list of volumes
for a container to the resulting image.  it will cause the resulting image to crash
when run subsequently.

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

Closes: #699
Approved by: mheon
2018-04-30 21:07:59 +00:00
umohnani8 d5d6e68592 Make ':' a restricted character for file names
file names for podman load, save, export, and import cannot
contain ":" in them. It is a reserved character for parsing
filenames.

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

Closes: #694
Approved by: rhatdan
2018-04-30 19:58:22 +00:00
baude a824186ac9 Use buildah commit and bud in podman
Vendor in buildah and use as much of commit and bug as possible for podman
build and commit.

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

Closes: #681
Approved by: mheon
2018-04-27 20:51:07 +00:00
umohnani8 6ac8a24db4 Add --default-mounts-file hidden flag
The hidden flag is used to override the path of the default mounts file
for testing purposes.
Also modified the secrets pkg to allow for this override to happen.

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

Closes: #678
Approved by: mheon
2018-04-26 16:33:25 +00:00
umohnani8 cf41dc70b3 Modify --user flag for podman create and run
If an integer is passed into the --user flag, i.e --user=1234
don't look up the user in /etc/passwd, just assign the integer as the uid.

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

Closes: #652
Approved by: mheon
2018-04-24 14:28:33 +00:00
Yiqiao Pu e76caee338 Add some podman search test with filter
Add search test with filter stars, is-automated and is-official.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #662
Approved by: rhatdan
2018-04-24 13:42:37 +00:00
Yiqiao Pu 863196f303 Fix podman search no-trunc test
Add --no-trunc to the command line and add output check for the
lines not include "..." with this flag.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #662
Approved by: rhatdan
2018-04-24 13:42:37 +00:00
Daniel J Walsh 10f9dc0d88
Merge pull request #647 from umohnani8/secrets
Add FIPS mode secret
2018-04-23 20:25:31 -04:00
umohnani8 57afb7514d Add FIPS mode secret
If the host is in FIPS mode and /etc/system-fips exists
/run/secrets/system-fips is created in the container so that
the container can run in FIPS mode as well.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-04-23 13:17:12 -04:00
Yiqiao Pu 04b58bc80c Add restart test with timeout
Test the --timeout flag with a container which can not be stopped with
SIGSTOP. This means the container should can not be stopped and will be
killed then restart with timeout value. Test steps:
  Start a container with STOPSIGNAL=SIGKILL
  Restart it with --timeout set to 2s
  Check the restart command will finished more than 2s and less than
  10s(the default timeout)

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:34:26 +08:00
Yiqiao Pu 18c98375a0 Improve restart latest container test
Remove the --latest from the restart running container test, and
add a separated case with following steps:
  start two container in order: test1, test2
  restart container with --latest
  check the start time for test1 and test2

And the results should be test1 is not restarted and test2 is restarted.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:34:21 +08:00
Yiqiao Pu 3a220be5bb Add start time check for restart test
Check the start time changed after restart the container.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:14:22 +08:00
baude 69669cf394 enable no test cache
been meaning to do this for a while.  add an environment variable that
disables the caching and restoring of images before integration tests
are run.  this is useful for developers only ... when testing specific
integration tests where caching and restoring the images is not worth
the benefit.

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

Closes: #650
Approved by: rhatdan
2018-04-21 10:54:18 +00:00
Matthew Heon 228732decc Fix tests for podman run --attach
When STDOUT and STDERR are not attached, we now print a container
ID. Make the tests aware of this.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #638
Approved by: rhatdan
2018-04-19 16:56:29 +00:00
Yiqiao Pu f2658ecda2 Add one test case for check diff in container and committed image
The test steps are:
1. Start a container and touch a file under /tmp
2. Use diff to check the container
3. commit the change into a new image
4. Use diff to check the image

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #643
Approved by: mheon
2018-04-19 14:19:04 +00:00
umohnani8 27107fdac1 Vendor in latest containers/image and contaners/storage
Made necessary changes to functions to include contex.Context wherever needed

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

Closes: #640
Approved by: baude
2018-04-19 14:08:47 +00:00
Yiqiao Pu 6a9dbf3305 Fix a typo
Update LineInOuputContains to LineInOutputContains.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #642
Approved by: rhatdan
2018-04-19 09:28:08 +00:00
Nathan Williams 982927468c ip validation game too strong
Signed-off-by: Nathan Williams <nath.e.will@gmail.com>

Closes: #635
Approved by: rhatdan
2018-04-18 10:58:24 +00:00
Nathan Williams 94f20cdd00 - reverse host field order (ip goes first)
- fix host string split to permit IPv6

Signed-off-by: Nathan Williams <nath.e.will@gmail.com>

Closes: #635
Approved by: rhatdan
2018-04-18 10:58:24 +00:00
Yiqiao Pu f1a4867bcd Add a function for check if command exist
Use this function to check if command exist before execute it
in our test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:29 +08:00
Yiqiao Pu d6d7edb841 Add WaitContainerReady for wait for docker registry ready
Sometime podman push local registry still failed caused by the
docker registry is not start yet after sleep 5s in the test.
So add this function to check the container status by its output
and skip the test when the docker registry can not start normally
instead of failed the case.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:21 +08:00
Yiqiao Pu 0fe0c79dc9 Add several podman push tests
Add five tests for podman push tests:
- push to docker with authorization
- push to docker-archive
- push to docker-daemon
- push to oci-archive
- push to ostree

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:11 +08:00
baude 62b59df053 Allow the use of -i/-a on any container
We used to not allow the use of -a/-i on containers that were not
started with -i or a tty.  Given the improvements in our terminal
handling, this should work now.

This also fixes a systemic problem with the autotests.

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

Closes: #617
Approved by: baude
2018-04-14 13:48:35 +00:00
umohnani8 9aafc25a3d Fix secrets patch
The secrets code was just tarring and copying the contents of the secrets directory on host as is.
This meant it was not accounting for any symlinks inside the directory, leading up to the contents
not being copied over.

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

Closes: #611
Approved by: mheon
2018-04-13 21:25:15 +00:00
Matthew Heon 8265294d78 Fix podman run --attach tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #608
Approved by: baude
2018-04-13 18:43:44 +00:00
Matthew Heon 5eb9ebcf59 Add tests for podman attach
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #608
Approved by: baude
2018-04-13 18:43:44 +00:00
Matthew Heon b8394600d8 HACK temporary fix for test suite
We leak open files when creating new c/storage stores (locks do
not close themselves, so the open FDs in the test suite increase
every time we use c/storage to load cached images for the tests).
Fix this temporarily by increasing rlimits on open files until we
can create a permanent fix next release.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #615
Approved by: baude
2018-04-13 17:51:27 +00:00
Matthew Heon ec90d6f4cc Fix leaking files in Ginkgo
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #612
Approved by: rhatdan
2018-04-13 04:24:28 +00:00
umohnani8 998fd2ece0 Functionality changes to the following flags
--group-add
	--blkio-weight-device
	--device-read-bps
	--device-write-bps
	--device-read-iops
	--device-write-iops

--group-add now supports group names as well as the gid associated with them.
All the --device flags work now with moderate changes to the code to support both
bps and iops.
Added tests for all the flags.

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

Closes: #590
Approved by: mheon
2018-04-06 00:09:46 +00:00
Daniel J Walsh fdcf633a33 Add hooks support to podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #155
Approved by: mheon
2018-04-05 14:13:49 +00:00
baude 35a10c9ba5 Only allocate tty when -t
In our ezrly development, we always allocated a tty when not -d.  Now we should only allocated when the user asks for it.

Resolves: #573

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

Closes: #574
Approved by: rhatdan
2018-04-03 22:23:23 +00:00
TomSweeneyRedHat 2eb38a0271 Sleep for 5 seconds before pushing to registry in tests
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #576
Approved by: rhatdan
2018-04-02 17:57:28 +00:00
baude 03ec980dcf Eliminate raceyness of sig-proxy test
Use a socket to coordinate between the test suite and the container and its
script.

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

Closes: #567
Approved by: rhatdan
2018-03-30 09:17:27 +00:00
baude 1e59053cc5 Allow sha256: prefix for input
We should allow users to pass in image ids with the sha256: prefix
for local images.

Resolves: #493

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

Closes: #560
Approved by: baude
2018-03-29 16:31:43 +00:00
umohnani8 8a96b4acbc Add secrets patch to podman
Adds support for mounting secrets especially on RHEL where the container
can use the host subsription to run yum

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

Closes: #544
Approved by: rhatdan
2018-03-29 14:15:27 +00:00
Matthew Heon 196c3ab3a5 Disable --sig-proxy tests due to race conditions
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #564
Approved by: rhatdan
2018-03-28 23:29:45 +00:00
Daniel J Walsh a3156da21c podman exec should handle options --env foo
If the user does not specify foo=bar, then the exec code should
look for the foo environment variable in its environment and pass it
in.  This is the way podman run works.

Also added tests to make sure this all works.

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

Closes: #552
Approved by: mheon
2018-03-26 23:27:00 +00:00
baude d364d41e1b Removing tagged images change in behavior
An image name is really just a tag.  When an image has multiple tags, we should be
able to "delete" the one of its tags without harm. In this case, the "delete' is
really a form of Untag (removing the tag from the image).

If an image has multiple tags and the user tries to delete by ID without force, this
should be denied because when you delete by ID there is no distinguishing it like
image tags.

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

Closes: #528
Approved by: mheon
2018-03-22 19:06:51 +00:00
baude 38a1b2f16d Image library stage 4 - create and commit
Migrate the podman create and commit subcommandis to leverage the images library.  I also had
to migrate the cmd/ portions of run and rmi.

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

Closes: #498
Approved by: mheon
2018-03-20 16:20:12 +00:00
Matthew Heon c80bfe1be1 Fix Travis tests for sig-proxy
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #511
Approved by: rhatdan
2018-03-16 18:03:25 +00:00
Daniel J Walsh d7acfb478e
Merge pull request #447 from mheon/sig_proxy
Add signal proxying to podman run and attach
2018-03-16 10:34:32 -04:00
Matthew Heon 2f533888a5 Fix E2E tests
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 358f84ad39 Fix E2E tests
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 05fb5a0aa7 Fix nit in restart E2E tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 540a441234 Add tests for restart
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Yiqiao Pu eb33cc2193 Add a test case for remove the latest container
Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #508
Approved by: baude
2018-03-16 13:35:10 +00:00
Yiqiao Pu d560ddd102 Correct the test case name
Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #508
Approved by: baude
2018-03-16 13:35:10 +00:00
Matthew Heon cd73a6904d Add signal proxying to podman run, start, and attach
Also removes sig-proxy from 'podman create', where is does not
make sense.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-15 16:00:20 -04:00
Matthew Heon 99b959560a Fix test build
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 525d023c89 Fix gofmt
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 8d7dc94a27 Add extra E2E test for restarting containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon d176e9f781 Fix broken 'podman start' test
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 4739fc2d98 Add test. Move attach code in start back
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00