Commit graph

762 commits

Author SHA1 Message Date
Peter Hunt 7c92256103 add test to verify hostname is shared in a pod
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-07 08:44:08 -04:00
Ed Santiago 8922dfcc76 pod top test: reenable
It looks like #2780 is fixed: an overnight run yielded no
instances of 'pod top' returning incomplete output.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-06 11:46:51 -06:00
OpenShift Merge Robot 337358ae63
Merge pull request #3690 from adrianreber/ignore-static-ip
restore: added --ignore-static-ip option
2019-08-05 16:11:50 +02:00
Qi Wang 0ad374af6a podman events format json
Enable podman events to format the output as jsonline

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-02 11:47:43 -04:00
OpenShift Merge Robot 3cc9ab8992
Merge pull request #3695 from edsantiago/bats_hang_fix
System tests: resolve hang in rawhide rootless
2019-08-02 15:37:47 +02:00
OpenShift Merge Robot 5370c53c9c
Merge pull request #3692 from haircommander/play-caps
Add Capability support to play kube
2019-08-02 10:42:46 +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
Ed Santiago 6eee9ab080 System tests: resolve hang in rawhide rootless
Fedora CI tests are failing on rawhide under kernel
5.3.0-0.rc1.git3.1.fc31 (rhbz#1736758). But there's
another insidious failure, a 4-hour hang in the
rootless tests on the same CI system. The culprit
line is in the podman build test, but it's actually
BATS itself that hangs, not the build command -- which
suggests that it's the usual FD 3 problem (see BATS README).
It would seem that podman is forking a process that
inherits fd 3 but that process is not getting cleaned
up when podman crashes upon encountering the kernel bug.

Today it's podman build, tomorrow it might be something
else. Let's just run all podman invocations in run_podman
with a non-bats FD 3.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-01 20:19:54 -06:00
OpenShift Merge Robot e3240daa47
Merge pull request #3551 from mheon/fix_memory_leak
Fix memory leak with exit files
2019-08-02 03:44:43 +02:00
OpenShift Merge Robot e48dc506d1
Merge pull request #3693 from QiWang19/search
fix search output limit
2019-08-02 01:22:44 +02:00
Qi Wang 619a39f7bb fix search output limit
close https://bugzilla.redhat.com/show_bug.cgi?id=1732280
From the bug Podman search returns 25 results even when limit option `--limit` is larger than 25(maxQueries). They want Podman to return `--limit` results.

This PR fixes the number of output result.
if --limit not set, return MIN(maxQueries, len(res))
if --limit is set, return MIN(option, len(res))

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-01 16:15:15 -04:00
Peter Hunt 834107c82e Add capability functionality to play kube
Take capabilities written in a kube and add to a container
adapt test suite and write cap-add/drop tests

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-01 15:47:45 -04:00
Matthew Heon 8da24f2f7d Use "none" instead of "null" for the null eventer
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-01 15:01:54 -04:00
OpenShift Merge Robot 6f62dac163
Merge pull request #3341 from rhatdan/exit
Add new exit codes to rm & rmi for running containers & dependencies
2019-08-01 13:37:19 +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
Matthew Heon 318438fcb3 Do not use an events backend when restoring images
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
Matthew Heon fd73075cbe Force tests to use file backend for events
Podman-in-podman (and possibly ubuntu) have "issues" with
journald. Let's just use file instead to be safe.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
Matthew Heon 6619c073bd Fix test suite
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
Valentin Rothberg da609fc40b e2e test: check exit codes for pull, save, inspect
Check the exit codes of pull, save and inspect to avoid masking those
errors.  We've hit a case where a corrupted/broken image has been pulled
which then surfaced for some tests later.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-31 15:41:34 +02:00
OpenShift Merge Robot e84ed3c1bc
Merge pull request #3665 from QiWang19/env
Set -env variables as appropriate
2019-07-30 21:20:34 +02:00
Qi Wang 2da86bdc3a Set -env variables as appropriate
close #3648

podman create and podman run do not set --env variable if the environment is not present with a value

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-30 12:02:18 -04:00
Major Hayden 9822f54ac3
Allow info test to work with usernames w/dash
The regular expression used in the `info` test does not allow for
usernames that have a dash, such as `test-user`. This patch adjusts
the regex to allow for a dash.

Fixes #3666.

Signed-off-by: Major Hayden <major@redhat.com>
2019-07-29 16:08:51 -05:00
OpenShift Merge Robot 5343d79e6c
Merge pull request #3663 from adrianreber/random-test-ip
Move random IP code for tests from checkpoint to common
2019-07-29 21:31:13 +02:00
OpenShift Merge Robot c3c45f3ba5
Merge pull request #3646 from vrothberg/hi-scott
fix `podman -v` regression
2019-07-29 19:54:49 +02:00
Valentin Rothberg 6065070bae fix podman -v regression
Re-add the shortflag for --version and add e2e tests to avoid regressing
in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-29 14:47:21 +02: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
OpenShift Merge Robot 0c4dfcfe57
Merge pull request #3639 from giuseppe/user-ns-container
podman: support --userns=ns|container
2019-07-26 15:06:06 +02:00
Giuseppe Scrivano 1d72f651e4
podman: support --userns=ns|container
allow to join the user namespace of another container.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-25 23:04:55 +02:00
Matthew Heon 0934949220 Use systemd cgroups for Ubuntu
It seems like our VM images now support systemd CGroups with the
Ubuntu LTS images. No reason to keep testing CGroupfs as such,
systemd is much less racy (and CGroupfs on systemd-enabled
systems can be iffy).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-07-25 14:57:58 -04:00
Peter Hunt 5bf99a82ff add detach keys support for remote
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-23 13:29:33 -04:00
Peter Hunt 35ba77e040 Update e2e tests for remote exec
including changing -l to the container id
and separating a case of setting the env that remote can't handle

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-23 13:29:33 -04:00
Peter Hunt 2a474c88c9 Finish up remote exec implementation
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-23 13:29:33 -04:00
Peter Hunt a1a79c08b7 Implement conmon exec
This includes:
	Implement exec -i and fix some typos in description of -i docs
	pass failed runtime status to caller
	Add resize handling for a terminal connection
	Customize exec systemd-cgroup slice
	fix healthcheck
	fix top
	add --detach-keys
	Implement podman-remote exec (jhonce)
	* Cleanup some orphaned code (jhonce)
	adapt remote exec for conmon exec (pehunt)
	Fix healthcheck and exec to match docs
		Introduce two new OCIRuntime errors to more comprehensively describe situations in which the runtime can error
		Use these different errors in branching for exit code in healthcheck and exec
	Set conmon to use new api version

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 15:57:23 -04:00
Daniel J Walsh 8ae97b2f57
Add support for listing read/only and read/write images
When removing --all images prune images only attempt to remove read/write images,
ignore read/only images

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-19 06:59:49 -04:00
OpenShift Merge Robot 398aeac853
Merge pull request #3599 from QiWang19/ps-regexp
support podman ps filter regular expressions
2019-07-19 03:27:28 +02:00
OpenShift Merge Robot deb087d7b1
Merge pull request #3443 from adrianreber/rootfs-changes-migration
Include changes to the container's root file-system in the checkpoint archive
2019-07-19 02:38:26 +02:00
OpenShift Merge Robot b59abdc1b1
Merge pull request #3579 from QiWang19/dns_net
fix --dns and --network conflict
2019-07-19 02:22:28 +02:00
OpenShift Merge Robot 2254a35d3a
Merge pull request #3593 from giuseppe/rootless-privileged-devices
rootless: add host devices with --privileged
2019-07-18 19:50:22 +02:00
Qi Wang 5047c79e71 support podman ps filter regular expressions
podman ps --filter use regexp to match the container name.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 13:11:04 -04:00
Giuseppe Scrivano 350ede1eeb
rootless: add rw devices with --privileged
when --privileged is specified, add all the devices that are usable by
the user.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1730773

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-18 17:07:50 +02:00
Qi Wang 3f721f8b17 fix --dns* and --network not set to host conflict
Close #3553
This PR makes --dns, --dns-option, --dns-search, and --network not set to host flag mutually exclusive for podman build and create. Returns conflict error if both flags are set.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 09:39:31 -04:00
Giuseppe Scrivano 0b57e77d7c
libpod: support for cgroup namespace
allow a container to run in a new cgroup namespace.

When running in a new cgroup namespace, the current cgroup appears to
be the root, so that there is no way for the container to access
cgroups outside of its own subtree.

By default it uses --cgroup=host to keep the previous behavior.

To create a new namespace, --cgroup=private must be provided.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-18 10:32:25 +02:00
OpenShift Merge Robot 7488ed6d9a
Merge pull request #3522 from mheon/nix_the_artifact
Move the HostConfig portion of Inspect inside libpod
2019-07-18 09:23:47 +02:00
Matthew Heon 1e3e99f2fe Move the HostConfig portion of Inspect inside libpod
When we first began writing Podman, we ran into a major issue
when implementing Inspect. Libpod deliberately does not tie its
internal data structures to Docker, and stores most information
about containers encoded within the OCI spec. However, Podman
must present a CLI compatible with Docker, which means it must
expose all the information in 'docker inspect' - most of which is
not contained in the OCI spec or libpod's Config struct.

Our solution at the time was the create artifact. We JSON'd the
complete CreateConfig (a parsed form of the CLI arguments to
'podman run') and stored it with the container, restoring it when
we needed to run commands that required the extra info.

Over the past month, I've been looking more at Inspect, and
refactored large portions of it into Libpod - generating them
from what we know about the OCI config and libpod's (now much
expanded, versus previously) container configuration. This path
comes close to completing the process, moving the last part of
inspect into libpod and removing the need for the create
artifact.

This improves libpod's compatability with non-Podman containers.
We no longer require an arbitrarily-formatted JSON blob to be
present to run inspect.

Fixes: #3500

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-17 16:48:38 -04:00
Peter Hunt 6f35a57423 Fix play kube command
Before, play kube wasn't properly setting the command. Fix this
Also, begin a dedicated test suite for play kube to catch regressions like this in the future

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-17 12:59:50 -04:00
Hunor Csomortáni 3e53bfe36e Make the healthcheck flags compatible with Docker CLI
Docker CLI calls the healthcheck flags "--health-*", instead of
"--healthcheck-*".

Introduce the former, in order to keep compatibility, and alias
the later, in order to avoid breaking current usage.

Change "--healthcheck-*" to "--health-*" in the docs and tests.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-07-16 06:15:28 +02:00
Stefan Becker e4cba7d36a create: improve parser for --healthcheck-command
Fix Docker CLI compatibility issue: the "--healthcheck-command" option
value should not be split but instead be passed as single string to
"CMD-SHELL", i.e. "/bin/sh -c <opt>".

On the other hand implement the same extension as is already available
for "--entrypoint", i.e. allow the option value to be a JSON array of
strings. This will make life easier for tools like podman-compose.

Updated "--healthcheck-command" option values in tests accordingly.

Continuation of #3455 & #3507

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
2019-07-14 10:33:01 +03:00
OpenShift Merge Robot 6f3e7f7ecc
Merge pull request #3557 from rhatdan/env
Add support for --env-host
2019-07-12 10:33:18 +02:00
OpenShift Merge Robot 2b64f88446
Merge pull request #3491 from giuseppe/rlimit-host
podman: add --ulimit host
2019-07-11 21:35:37 +02:00
OpenShift Merge Robot 24409daa36
Merge pull request #3470 from QazerLab/docs/system-tests
Update the testing documentation with system tests.
2019-07-11 21:35:30 +02:00