Commit graph

171 commits

Author SHA1 Message Date
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