Commit graph

1016 commits

Author SHA1 Message Date
OpenShift Merge Robot 86c8650c23
Merge pull request #4174 from cevich/use_bash_not_sh
System-tests: Use bash explicitly
2019-10-03 11:28:58 -07:00
Chris Evich 584c70a9f8
Raise start_test polling interval
According to the documentation
https://onsi.github.io/gomega/#eventually

> the default value for the polling interval is 10 milliseconds

That is excessively fast given the observed failures in
issue #4021 are always using podman-remote.  Lower the interval to
3-seconds, which should be plenty long enough for container removal.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-10-03 12:08:36 -04:00
Ed Santiago 0ed9763b72 system tests: info: deal with hyphen in username
...e.g. cloud-user. 9822f54ac was intended to fix this,
but it doesn't. Simple and standard solution is to
move the dash to the end of the character class.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-10-03 07:55:41 -06:00
Chris Evich c091374d77
System-tests: Use bash explicitly
On Ubuntu, /bin/sh != /bin/bash.  Update system-tests to only use
bash for testing consistency across platforms.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-10-02 14:32:31 -04:00
Ed Santiago 6c0b5a2fab system tests: reenable skipped tests
Issue #3829 (cp symlinks) has been fixed: enable tests for it

And, it looks like podman-remote is now handling exit status
of a force-rm'ed container. Enable that test too.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-10-02 06:22:36 -06:00
OpenShift Merge Robot 2c23729c84
Merge pull request #4001 from kunalkushwaha/podman-import-fix
podman import syntax fix
2019-09-30 07:20:09 -07:00
OpenShift Merge Robot 01a802e546
Merge pull request #4118 from cevich/fix_sig_proxy
Move noCache logic lower in stack
2019-09-27 23:21:25 -07:00
OpenShift Merge Robot d4399eebb9
Merge pull request #4121 from jwhonce/issue/4021
Change ginkgo Wait() to Eventually() test
2019-09-27 20:09:17 +02:00
Kunal Kushwaha 039b44ea11 new testcase for podman import --change added
Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2019-09-27 17:17:12 +09:00
Nalin Dahyabhai 65b20bd521 Correct use of reexec.Init()
A true result from reexec.Init() isn't an error, but it indicates that
main() should exit with a success exit status.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-09-26 18:19:07 -04:00
Jhon Honce f4723beac6 Change ginkgo Wait() to Eventually() test
Changing the test in WaitWithDefaultTimeout() to use Eventually() and
gexec.Exit(). Using ExitCode() before command has really exited returns
a -1, which can cause issues for tests testing for podman to return
non-zero values.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-26 14:11:54 -07:00
Chris Evich 437d9d2cde
Move noCache logic lower in stack
One or more tests are not taking advantage of the local image cache.
This has been observed to cause a testing flake in at least one
`--sigproxy` test which uses `PodmanTestIntegration.PodmanPID()`.
It has a rather short timeout of 15-seconds, which isn't always
enough time to pull down a remote image.

Fix this by reloacing the `noCache` logic from
`PodmanTest.PodmanAsUserBase()` down the stack into
`PodmanTestIntegration.makeOptions()`.  This also eliminates the need to
also check if a remote-client is being used - since it uses a different
function.

Also reverse the parameter order in `PodmanTest.PodmanBase` so that
everywhere is consistently `noEvents` then `noCache`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-26 10:56:24 -04:00
Qi Wang 0144c3796b fix cp none exists dest path ends with '/'
close #3894
This patch let podman cp return 'no such file or directory' error if DEST_PATH does not exist and ends with / when copying file.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-09-25 12:48:05 -04:00
Matthew Heon d89414b1f0 Handle conflict between volumes and --read-only-tmpfs
When a named volume is mounted on any of the tmpfs filesystems
created by read-only tmpfs, it caused a conflict that was not
resolved prior to this.

Fixes BZ1755119

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-24 15:57:17 -04:00
OpenShift Merge Robot b300b981e7
Merge pull request #3756 from gabibeyer/rootlessOrdering
rootless: Rearrange setup of rootless containers
2019-09-24 18:47:18 +02:00
Ed Santiago c146f8d7d2 system tests: run test: reenable and fix
Test had incorrectly been disabled for all podman; it
should've been disabled only for podman-remote. Fixed
that, and fixed the problem that was causing failures:
podman-remote is gobbling up stdin (#4095), so no
tests were actually being run at all, or only one.
Fixed by redirecting input on the run_podman invocation.
Added, as backup, a confirmation mechanism to ensure
that all expected tests are being run.

Note that test is reenabled, but the output check is
disabled for podman-remote due to #4096; this at least
lets us check exit status.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-09-24 08:46:40 -06:00
gabi beyer 65d5a9823e add list mount tests
Add two unit tests to determine whether mounts are being listed
correctly. One tests that a created container is not listed
until mounted. The second checks that running containers are
mounted, and then no longer listed as mounted when they stop
running. The final test creates three containers, mounts two,
and checks that mount correctly only lists the two mounted.

Signed-off-by: gabi beyer <gabrielle.n.beyer@intel.com>
2019-09-24 11:01:28 +02:00
Giuseppe Scrivano fb353f6f42
execuser: look at the source for /etc/{passwd,group} overrides
look if there are bind mounts that can shadow the /etc/passwd and
/etc/group files.  In that case, look at the bind mount source.

Closes: https://github.com/containers/libpod/pull/4068#issuecomment-533782941

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-21 22:11:09 +02:00
Giuseppe Scrivano e42e1c45ae
container: make sure $HOME is always set
If the HOME environment variable is not set, make sure it is set to
the configuration found in the container /etc/passwd file.

It was previously depending on a runc behavior that always set HOME
when it is not set.  The OCI runtime specifications do not require
HOME to be set so move the logic to libpod.

Closes: https://github.com/debarshiray/toolbox/issues/266

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-20 16:01:38 +02:00
Chris Evich 52c4df0f9a
System-test: Temporarily disable 030-run
While investigating issue
https://github.com/containers/libpod/issues/4044 there is no sense
subjecting forward progress elsewhere.  Skip the test with a note
temporarily, until a resolution to 4044 and any other related issues
is found and fix implemented.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-17 12:54:49 -04:00
Daniel J Walsh 34d22a4e5c
Fix exit code failure
Be less precise on the exit code and lot the exit code to the journal when it fails.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-17 12:01:02 -04:00
OpenShift Merge Robot 42e080bcd3
Merge pull request #4043 from haircommander/preserve-fd-fix
exec: fix --preserve-fds
2019-09-16 23:23:59 +02:00
OpenShift Merge Robot 2a4e062c71
Merge pull request #3941 from gabibeyer/fix_unit_test
fix unit test using strings.Contains
2019-09-16 22:24:05 +02:00
Peter Hunt 5f97721afc exec: fix --preserve-fds
There were two problems with preserve fds.
libpod didn't open the fds before passing _OCI*PIPE to conmon. This caused libpod to talk on the preserved fds, rather than the pipes, with conmon talking on the pipes. This caused a hang.
Libpod also didn't convert an int to string correctly, so it would further fail.

Fix these and add a unit test to make sure we don't regress in the future

Note: this test will not pass on crun until crun supports --preserve-fds

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-16 15:27:00 -04:00
OpenShift Merge Robot 7875e00c66
Merge pull request #3934 from rhatdan/wait
Podman-remote run should wait for exit code
2019-09-13 18:12:25 +02:00
Jhon Honce a6836eae52 Do not support wildcards on cp
* symlink processing and wildcarding led to unexpected files
  being copied

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-12 16:56:38 -07:00
gabi beyer 69c58236ae fix unit test to use Expect
The Expect function does not return a result of True or False
depending on the value of the first instance, but instead requires
a comparison using ".To(", so change to use ".To(ContainSubstring("

Signed-off-by: gabi beyer <gabrielle.n.beyer@intel.com>
2019-09-12 21:01:43 +00:00
Daniel J Walsh 82ac0d8925
Podman-remote run should wait for exit code
This change matches what is happening on the podman local side
and should eliminate a race condition.

Also exit commands on the server side should start to return to client.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
Daniel J Walsh 535111b5d5
Use exit code constants
We have leaked the exit number codess all over the code, this patch
removes the numbers to constants.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
Debarshi Ray 137ec81634 Test that PTYs created by 'podman exec --tty' have the ONLCR flag
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-09-12 18:34:56 +02:00
OpenShift Merge Robot 9cf852c305
Merge pull request #3927 from openSUSE/manager-annotations
Add `ContainerManager` annotation to created containers
2019-09-11 09:34:14 +02:00
OpenShift Merge Robot 7ac6ed3b4b
Merge pull request #3581 from mheon/no_cgroups
Support running containers without CGroups
2019-09-11 00:58:46 +02:00
OpenShift Merge Robot 997c4b56ed
Merge pull request #3961 from mheon/copy_volume_contents
When first mounting any named volume, copy up
2019-09-10 22:24:43 +02:00
Matthew Heon c2284962c7 Add support for launching containers without CGroups
This is mostly used with Systemd, which really wants to manage
CGroups itself when managing containers via unit file.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-10 10:52:37 -04:00
Sascha Grunert df036f9f8e
Add ContainerManager annotation to created containers
This change adds the following annotation to every container created by
podman:

```json
"Annotations": {
    "io.containers.manager": "libpod"
}
```

Target of this annotaions is to indicate which project in the containers
ecosystem is the major manager of a container when applications share
the same storage paths. This way projects can decide if they want to
manipulate the container or not. For example, since CRI-O and podman are
not using the same container library (libpod), CRI-O can skip podman
containers and provide the end user more useful information.

A corresponding end-to-end test has been adapted as well.

Relates to: https://github.com/cri-o/cri-o/pull/2761

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-09-10 09:37:14 +02:00
Matthew Heon b6106341fb When first mounting any named volume, copy up
Previously, we only did this for volumes created at the same time
as the container. However, this is not correct behavior - Docker
does so for all named volumes, even those made with
'podman volume create' and mounted into a container later.

Fixes #3945

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-09 17:17:39 -04:00
OpenShift Merge Robot 9a55bce9e4
Merge pull request #3896 from mheon/volume_lookup
Add ability to look up volumes by unambiguous partial name
2019-09-09 21:48:30 +02:00
Matthew Heon 046178e55f Add function for looking up volumes by partial name
This isn't included in Docker, but seems handy enough.

Use the new API for 'volume rm' and 'volume inspect'.

Fixes #3891

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-09 12:06:10 -04:00
baude ee432cf279 podman network create
initial implementation of network create.  we only support bridging
networks with this first pass.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-09 09:32:43 -05:00
OpenShift Merge Robot 88980859ec
Merge pull request #3958 from haircommander/play-kube-sec
play kube: fix segfault
2019-09-06 15:40:13 +02:00
Peter Hunt 9259693826 play kube: fix segfault
when securityContext wasn't specified in yaml.
add a test as well

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-06 08:41:04 -04:00
Matthew Heon a760e325f3 Add ability for volumes with options to mount/umount
When volume options and the local volume driver are specified,
the volume is intended to be mounted using the 'mount' command.
Supported options will be used to volume the volume before the
first container using it starts, and unmount the volume after the
last container using it dies.

This should work for any local filesystem, though at present I've
only tested with tmpfs and btrfs.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-05 17:12:27 -04:00
OpenShift Merge Robot b962b1e353
Merge pull request #3943 from gabibeyer/fix_tests
Fix unit tests missing comparative for 'Expect'
2019-09-05 12:49:21 +02:00
gabi beyer 95f5411e88 Fix unit tests missing comparative for 'Expect'
Add '.To(BeTrue())' to 'Expect(' statements in unit tests that
are missing them. These tests weren't being compared to anything,
thus reporting false positives.

Signed-off-by: gabi beyer <gabrielle.n.beyer@intel.com>
2019-09-04 23:30:24 +00:00
OpenShift Merge Robot e74fcd7335
Merge pull request #3940 from edsantiago/bats
System tests: support for crun on f31/rawhide
2019-09-04 23:13:22 +02:00
OpenShift Merge Robot ab44484bec
Merge pull request #3876 from mheon/fix_mount_flags
Allow suid, exec, dev mount options to cancel nosuid/noexec/nodev
2019-09-04 22:43:41 +02:00
Ed Santiago acf55e1f87 System tests: support for crun on f31/rawhide
crun emits wildly different error messages than runc in
two cases:

    podman run ... /no/such/path   (enoent)
    podman run ... /etc            (trying to exec a directory)

Deal with it by getting the runtime from 'podman info' and,
if crun, changing what we expect.

There may be more tweaks needed to get system tests working
with crun, but right now podman rawhide is too broken to
have any hope of finding them all.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-09-04 14:03:55 -06:00
Matthew Heon 5f15501578 Add test to verify noexec works with volume mounts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-04 13:19:19 -04:00
Giuseppe Scrivano ba1c57030f
rootless: bind mount devices instead of creating them
when running in rootless mode, --device creates a bind mount from the
host instead of specifying the device in the OCI configuration.  This
is required as an unprivileged user cannot use mknod, even when root
in a user namespace.

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

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2019-09-02 13:03:19 +02:00
OpenShift Merge Robot d110998744
Merge pull request #3907 from baude/commitcaps
dont panic when using varlink commit and uppercase image names
2019-08-29 14:13:09 -07:00
baude 2fb6cc2cea dont panic when using varlink commit and uppercase image names
when using an upper case image name for container commit, we observed
panics due to a channel closing early.

Fixes: #3897

Signed-off-by: baude <bbaude@redhat.com>
2019-08-29 14:08:29 -05:00
Matthew Heon c13a52cfde Add a test for the new suid/exec/dev options
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-28 14:28:52 -04:00
OpenShift Merge Robot bdf9e56813
Merge pull request #3893 from mheon/readd_volume_locks
Re-add volume locks
2019-08-28 11:25:12 -07:00
OpenShift Merge Robot ced3ebb512
Merge pull request #3728 from mheon/systemd_container_test
Add an integration test for systemd in a container
2019-08-28 11:25:05 -07:00
Matthew Heon e563f41116 Re-add locks to volumes.
This will require a 'podman system renumber' after being applied
to get lock numbers for existing volumes.

Add the DB backend code for rewriting volume configs and use it
for updating lock numbers as part of 'system renumber'.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-28 11:35:00 -04:00
Matthew Heon ca0dfca5c9 Temporarily disable systemd test for CGroups V2
Revert this one CGroups V2 support for systemd containers is
added.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-08-28 09:28:49 -04:00
Matthew Heon 63d989a344 Add an integration test for systemd in a container
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-28 09:28:49 -04:00
Ed Santiago 4e2cccd9af podman cp: big set of system tests
podman cp has had some unexpected bugs, and still has
some surprising behavior. It looks like this part of
the code is fragile. Add tests to try to prevent
future breakages.

Note that two of the new tests are disabled (skipped)
until #3829 gets fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-26 15:33:38 -06:00
OpenShift Merge Robot 67926d86b5
Merge pull request #3824 from baude/varlinkendpointtest
Create framework for varlink endpoint integration tests
2019-08-26 17:11:12 +02:00
TomSweeneyRedHat ada0568f53 Update cni config instructions
Update the CNI configuration instructions to line up with
the changes introduced in #3868.  Also do a bit less documentation
of the configuration and point to the GitHub project so we won't
get out of sync in the future.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-08-22 19:39:07 -04:00
OpenShift Merge Robot b263dd9e81
Merge pull request #3800 from vrothberg/generate-pod
generate systemd pod
2019-08-22 19:08:08 +02:00
Valentin Rothberg 56a65cffac generate systemd: support pods and geneartig files
Support generating systemd unit files for a pod.  Podman generates one
unit file for the pod including the PID file for the infra container's
conmon process and one unit file for each container (excluding the infra
container).

Note that this change implies refactorings in the `pkg/systemdgen` API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-21 17:28:30 +02:00
TomSweeneyRedHat 9ced2488c9 Add --digestfile option to push
Add the digestfile option to the push command so the digest can
be stored away in a file when requested by the user.  Also have added
a debug statement to show the completion of the push.

Emulates Buildah's https://github.com/containers/buildah/pull/1799/files

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-08-21 10:11:52 -04:00
Peter Hunt cc3d8da968 exec: run with user specified on container start
Before, if the container was run with a specified user that wasn't root, exec would fail because it always set to root unless respecified by user.
instead, inherit the user from the container start.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-20 11:44:27 -04:00
OpenShift Merge Robot 33906a4c40
Merge pull request #3852 from edsantiago/bats
Flake fix: build test timeout
2019-08-19 21:06:04 +02:00
Ashley Cui 8c7014f11d Implement healthcheck for remote client
Previously unimplemented. Works the same way the local one does, except its remote.

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-08-19 12:14:54 -04:00
OpenShift Merge Robot c137e8fcf9
Merge pull request #3849 from openSUSE/directory-pull
Fix directory pull image name for OCI images
2019-08-19 17:50:39 +02:00
OpenShift Merge Robot b1acc43481
Merge pull request #3848 from giuseppe/enable-all-tests-crun
tests: enable all tests for crun
2019-08-19 16:42:19 +02:00
Ed Santiago cb4804de38 Flake fix: build test timeout
The priv test added to the build test in June runs an 'apk'
command which, unavoidably, has to fetch stuff from the net.
This is slow and unreliable, and periodically leads to
timeout failures. Worse, when this happens, some sort of
invisible buildah-only container gets left behind that leads
to failures in subsequent tests when trying to reset to
known state.

Imperfect workaround: try a 240-second timeout (up from 60)
when running apk. As backup, add a custom teardown() which
attempts to force-remove all containers and any new images.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-19 08:05:33 -06:00
OpenShift Merge Robot befaa95d93
Merge pull request #3777 from rhatdan/vendor
Add support & documentation to run containers with different file types
2019-08-19 13:48:15 +02:00
Giuseppe Scrivano f7527fb06d
test: enable all tests for crun
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 13:41:42 +02:00
Giuseppe Scrivano 570e55fdfb
test: fix return code check for missing workdir
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 13:41:41 +02:00
OpenShift Merge Robot 98dee275d0
Merge pull request #3836 from chenzhiwei/hostname
Allow customizing pod hostname
2019-08-19 13:33:15 +02:00
Sascha Grunert 22f55ce406
Fix directory pull image name for OCI images
This is a breaking change and modifies the resulting image name when
pulling from an directory via `oci:...`.

Without this patch, the image names pulled via a local directory got
processed incorrectly, like this:

```
> podman pull oci:alpine
> podman images
REPOSITORY      TAG      IMAGE ID       CREATED       SIZE
localhost/oci   alpine   4fa153a82426   5 weeks ago   5.85 MB
```

We now use the same approach as in the corresponding [buildah fix][1] to
adapt the behavior for correct `localhost/` prefixing.

[1]: https://github.com/containers/buildah/pull/1800

After applying the patch the same OCI image pull looks like this:

```
> ./bin/podman pull oci:alpine
> podman images
REPOSITORY         TAG      IMAGE ID       CREATED       SIZE
localhost/alpine   latest   4fa153a82426   5 weeks ago   5.85 MB
```

End-to-end tests have been adapted as well to cover the added scenario.

Relates to: https://github.com/containers/buildah/issues/1797

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-08-19 12:49:59 +02:00
Chen Zhiwei 7aefc1ac33 Allow customizing pod hostname
* set hostname in pod yaml file
* set --hostname in pod create command

Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
2019-08-18 03:48:40 +00:00
OpenShift Merge Robot 76f327f73f
Merge pull request #3617 from QiWang19/create_pull
add --pull flag for podman create&run
2019-08-17 14:55:14 +02:00
OpenShift Merge Robot 704cc582ac
Merge pull request #3719 from baude/networklist
inclusion of podman network
2019-08-16 17:33:31 +02:00
baude 04f2f95bb4 Create framework for varlink endpoint integration tests
add the ability to write integration tests similar to our e2e tests for
the varlink endpoints.

Signed-off-by: baude <bbaude@redhat.com>
2019-08-16 10:10:50 -05:00
OpenShift Merge Robot 2d47f1ae54
Merge pull request #3796 from giuseppe/enable-cgroupsv2-crun
cirrus: enable cgroups v2 tests with crun
2019-08-16 13:20:30 +02:00
baude 6220ef1488 inclusion of podman network
adding podman network and the subcommands inspect, list, and rm.  the
inspect subcommand displays the raw cni network configuration.  the list
subcommand displays a summary of the cni networks ala ps.  and the rm
subcommand removes a cni network.

Signed-off-by: baude <bbaude@redhat.com>
2019-08-15 12:49:12 -05:00
Ed Santiago 4fb7036ca1 tests for exit status on podman run --rm
...and on a container killed by 'podman rm -f'. See #3795

Disable when testing podman-remote; see #3808

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-14 15:14:55 -06:00
Chen Zhiwei fb9e1d7d9f Fix play kube command in pod yaml
Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
2019-08-14 09:22:29 -04:00
Giuseppe Scrivano 4929cafb91
tests: skip pause tests if freezer is not available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-13 21:44:23 +02:00
Giuseppe Scrivano 2e6164d124
tests: enable run tests for cgroups v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-13 21:44:22 +02:00
Giuseppe Scrivano ebd2b70019
tests: enable cpu tests for cgroups v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-13 21:44:21 +02:00
Giuseppe Scrivano 7e38a73c4b
tests: enable memory tests for cgroups v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-13 21:43:37 +02:00
Giuseppe Scrivano 231b6cb758
test: fix option name
the option is --quiet, not --q

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-13 21:43:35 +02:00
Daniel J Walsh 316e51f0a9
Add support & documentation to run containers with different file types
Udica is adding new features to allow users to define container process
and file types. This would allow us to setup trusted communications channels
between multiple security domains.  ContainerA -> ContainerB -> ContainerC

Add tests to make sure users can change file types

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-08-13 10:16:01 -04:00
Giuseppe Scrivano 9f67cde9f8
tests: disable some tests currently failing when not using runc
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-12 16:09:34 +02:00
OpenShift Merge Robot 8c77dd77af
Merge pull request #3742 from adrianreber/ConmonPidFile
Conmon pid file
2019-08-10 12:01:45 +02:00
OpenShift Merge Robot d65cb66437
Merge pull request #3758 from edsantiago/bats
implement 'make remotesystem'
2019-08-10 11:52:44 +02:00
Qi Wang decfea65be add --pull flag for podman create&run
Requirement from https://github.com/containers/libpod/issues/3575#issuecomment-512238393

Added --pull for podman create and pull to match the newly added flag in docker CLI.
`missing`: default value, podman will pull the image if it does not exist in the local.
`always`: podman will always pull the image.
`never`: podman will never pull the image.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-09 15:21:34 -04:00
Adrian Reber 0c9a941d01
Test that restored container does not depend on the original container
In the restore from external checkpoint archive test, the second restore
using a new name and ID is now done first to ensure that nothing in the
restored container depends on the original container.

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

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-08-09 19:26:57 +02:00
Qi Wang cfdf891552 fix create&run getting --authfile from cli
Add flag `--authfile` to create and run so Podman can read authfile path from not only environemnt variable REGISTRY_AUTH_FILE but also CLI

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-09 12:27:32 -04:00
OpenShift Merge Robot 76840f2d99
Merge pull request #3764 from rhatdan/dnssearch
Allow the passing of '.' to --dns-search
2019-08-09 04:03:17 +02:00
Qi Wang a2561ec58a fix copy change file owner if cp from container
If copies file from container to local machine, change the file owner to the cp command caller.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-08 17:14:47 -04:00
Daniel J Walsh 5270cd89d3
Allow the passing of '.' to --dns-search
--dns-search is defined to remove all search domains from a container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-08-08 15:25:50 -04:00
OpenShift Merge Robot 09cedd152d
Merge pull request #3750 from baude/portreporting
fix port early return
2019-08-08 20:34:49 +02:00
Ed Santiago 5c108cdab4 implement 'make remotesystem'
podman-remote rm now works; that's the only thing we were
waiting for to enable podman-remote (varlink) system tests.

Add a (too-complicated, sorry) Makefile target that will
define a random socket path, start the podman varlink server,
and run the test suite using podman-remote.

Also: add two convenience functions, is_rootless and is_remote,
and use those in skip_if_rootless/if_remote and elsewhere

Also: workarounds for broken tests:
 - basic version test: podman-remote emits an empty 'Client'
   line. Just ignore it.
 - looks like 'podman-remote pod' doesn't work; skip test.

Also: minor documentation update

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-08-08 11:44:55 -06:00
OpenShift Merge Robot 5701fe6689
Merge pull request #3744 from mheon/fix_command
When populating CMD, do not include Entrypoint
2019-08-08 14:32:27 +02:00
OpenShift Merge Robot 8776a577bf
Merge pull request #3738 from mheon/mount_opts_bools
Allow --ro=[true|false] with mount flag
2019-08-08 14:20:29 +02:00
Matthew Heon 8d44c61f27 Add a test for verifying ENTRYPOINT and CMD
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-07 11:49:34 -04:00
baude b7b86bda2d fix port early return
when listing multiple ports on a container with podman port, an early
return was limiting results.

Fixes: #3747

Signed-off-by: baude <bbaude@redhat.com>
2019-08-07 09:10:47 -05:00
Matthew Heon c0a124ea89 Allow --ro=[true|false] with mount flag
The 'podman run --mount' flag previously allowed the 'ro' option
to be specified, but was missing the ability to set it to a bool
(as is allowed by docker). Add that. While we're at it, allow
setting 'rw' explicitly as well.

Fixes #2980

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-07 10:03:01 -04:00
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
Daniel J Walsh df75fc62c8
Add support for -env-host
This flag passes the host environment into the container.  The basic idea is to
leak all environment variables from the host into the container.

Environment variables from the image, and passed in via --env and --env-file
will override the host environment.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-11 13:25:47 -04:00
Giuseppe Scrivano 7b75796a60
cgroups: fix a leak when using cgroupfs
be sure to load all the existing handlers, so that they can also be
freed in addition to the handlers we treat differently.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-11 18:07:49 +02:00
Adrian Reber c70657a6d1
Add tests for --ignore-rootfs checkpoint/restore option
This adds three tests for the --ignore-rootfs option to verify that it
works in all combination.

1. Not used at all
2. Only used during restore
3. Only used during checkpoint

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-07-11 15:27:38 +02:00
baude e053e0e05e first pass of corrections for golangci-lint
Signed-off-by: baude <bbaude@redhat.com>
2019-07-10 15:52:17 -05:00
OpenShift Merge Robot 5786a3a7dc
Merge pull request #3501 from adrianreber/random
Randomize IP addresses during checkpoint/restore tests
2019-07-09 15:59:02 +02:00
OpenShift Merge Robot 2843d0dc86
Merge pull request #3480 from mheon/potential_ps_test_fix
Restart failed containers in tests
2019-07-09 15:58:50 +02:00
Adrian Reber d0f540e24d
Use random IP addresses during checkpoint/restore tests
This tries to reduce CI errors which might happen due to parallel CI
runs which all are using the same IP addresses. Using random addresses
should reduce the possibility of parallel tests using the same IP address.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-07-09 08:04:19 +02:00
OpenShift Merge Robot fce2e6577e
Merge pull request #3497 from QazerLab/bugfix/systemd-generate-pidfile
Use conmon pidfile in generated systemd unit as PIDFile.
2019-07-08 23:39:42 +02:00
OpenShift Merge Robot 8d37c2073f
Merge pull request #3515 from baude/rootlessintegrationtests
speed up rootless tests
2019-07-08 21:16:04 +02:00
OpenShift Merge Robot edc7f52c95
Merge pull request #3425 from adrianreber/restore-mount-label
Set correct SELinux label on restored containers
2019-07-08 20:31:59 +02:00
baude c187da23c4 speed up rootless tests
when running integrations tests as rootless, several tests still
unnecessarily pull images which is costly in terms of time.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-08 12:31:31 -05:00
OpenShift Merge Robot 3fdf1a2c44
Merge pull request #3377 from TomSweeneyRedHat/dev/tsweeney/gate
Add RUN priv'd test for build
2019-07-08 19:25:29 +02:00
Giuseppe Scrivano fb88074e68
podman: add --ulimit host
add a simple way to copy ulimit values from the host.

if --ulimit host is used then the current ulimits in place are copied
to the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-08 19:22:54 +02:00
baude 3dee49f131 fix integration flake tests
attempts to correct three of our flakey integration tests

Signed-off-by: baude <bbaude@redhat.com>
2019-07-08 09:06:40 -05:00
Danila Kiver 8fde4194b6 Move skipping systemd tests to early setup.
There is no meaning of performing setup/teardown for these tests
when we even can not work with systemd.

Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-07-06 20:45:26 +03:00
Danila Kiver 1f435bf92c Reload systemd daemon on creation of units location dir in tests.
Systemd manager drops non-existent directories from the units search
path during initialization, thus, creation of UNIT_DIR, if it did not
exist before, requres reloading the daemon.

Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-07-06 17:41:29 +03:00
Danila Kiver c490754ff7 Add debug information to "generate systemd" test.
Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-07-06 01:35:46 +03:00
Danila Kiver a54429cf87 Use conmon pidfile in generated systemd unit as PIDFile.
By default, podman points PIDFile in generated unit file to non-existent
location. As a result, the unit file, generated by podman, is broken:
an attempt to start this unit without prior modification results in a crash,
because systemd can not find the pidfile of service's main process.

Fix the value of "PIDFile" and add a system test for this case.

Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-07-04 03:58:37 +03:00
Matthew Heon 1322dbc24f Restart failed containers in tests
When we're waiting for a container to come up with healthchecks,
and it's not even running, there's no point to waiting further.
Instead, let's restart the container and continue waiting.

This may fix some flakes we're seeing with 'podman port' tests.
Then again, all the tests there seem to fail, not just a single
test flaking - so I bet there's some other underlying cause.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-02 15:46:39 -04:00
Peter Hunt 341f5e22e5 Add test for generate kube with volumes
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-02 15:18:44 -04:00
Danila Kiver 1a42123710 Update the testing documentation with system tests.
Add Bats installation procedure.

Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-07-02 02:44:14 +03:00
OpenShift Merge Robot ed394070a8
Merge pull request #3422 from nalind/no-layer-images
Handle images which contain no layers
2019-06-28 19:14:45 +02:00
TomSweeneyRedHat 19ddcf9251 Add RUN priv'd test for build
Podman 1.4.1 had problems with builds with a
RUN command that tried to to a privliged command.

This adds a gating test for that situation.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-06-28 12:27:45 -04:00
OpenShift Merge Robot 7705f99fe6
Merge pull request #3429 from cevich/strip_crio_conmon
Remove refs to crio/conmon
2019-06-27 03:05:33 +02:00
Chris Evich fc32439c29
Remove refs to crio/conmon
Conmon has moved out of cri-o and into it's own dedicated repository.
This commit updates configuration and definitions which referenced
the old cri-o based paths.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-06-26 12:44:22 -04:00
Nalin Dahyabhai 8e79de2848 Add tests that we don't hit errors with layerless images
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-06-26 10:43:04 -04:00
OpenShift Merge Robot a488e197a6
Merge pull request #3417 from mheon/fix_play_kube_ports
Only include ports in one container in Kube YAML
2019-06-25 20:21:24 +02:00
Adrian Reber 95719b6d6b
Add exec after checkpoint/restore test
A container restored from a checkpoint archive used to have the root
file-system mounted with a wrong (new) SELinux label. This made it, for
example, impossible to use 'podman exec' on a restored container.

This test tests exactly this. 'podman exec' after 'podman container restore'.

Unfortunately this test does not fail, even without the patch that fixes
it as the test seems to run in an environment where the SELinux label of
the container root file-system is not relevant. Somehow.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-25 19:42:04 +02:00
Matthew Heon 068d3bb3bf Update 'generate kube' tests to verify YAML
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-25 12:34:53 -04:00
Matthew Heon 101a5cd755 Use a different method to retrieve YAML output in tests
OutputToString() was mangling newlines, which made YAML parsers
very, very angry. But not angry enough to actually error, that
would be too easy. Just angry enough to silently not decode
anything.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-25 11:10:50 -04:00
OpenShift Merge Robot d8b18a9879
Merge pull request #3401 from mheon/templating_is_dumb
Fix inspect --format '{{.Mounts}}.
2019-06-25 00:20:25 +02:00
OpenShift Merge Robot 394e12aa65
Merge pull request #3391 from QiWang19/cp_file
fix bug creats directory copying file
2019-06-24 23:49:57 +02:00
Matthew Heon 79d835457d Fix tests
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 15:27:37 -04:00
Matthew Heon 803a2b04d1 Change Marshal -> Unmarshal in generate kube tests
We need to verify that valid YAML was produced - Marshal will
just pack the generated YAML even further.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:56:41 -04:00
Matthew Heon 567e7c60fa Add test for generate kube on a pod with ports
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:45:07 -04:00
Matthew Heon 2d9f1e95eb Support aliases for .Src and .Dst in inspect .Mounts
This provides backwards compatability with 1.4.0-1.4.2 releases
which name .Source and .Destination as .Src and .Dst - useful for
not breaking toolbox.

Also add a test.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:08:25 -04:00
OpenShift Merge Robot a1a4a75abe
Merge pull request #3412 from mheon/fix_ps_sync_segfault
Fix a segfault in 'podman ps --sync'
2019-06-24 18:36:20 +02:00
Matthew Heon de75b1a277 Fix a segfault in 'podman ps --sync'
We weren't properly populating the container's OCI Runtime in
Batch(), causing segfaults on attempting to access it. Add a test
to make sure we actually catch cases like this in the future.

Fixes #3411

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 09:26:03 -04:00
Giuseppe Scrivano bd5e113b71
rootless: add an entry to /etc/hosts when using slirp4netns
Closes: https://github.com/containers/libpod/issues/3405

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-24 10:12:33 +02:00
Adrian Reber 1e706a021d
Add --latest, -l to 'podman diff'
The man page of 'podman diff' claims that the diff sub-command knows
about --latest, -l. This adds support, as described in the man-page, to
the diff sub-command for --latest, -l.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-21 13:37:04 +02:00
Qi Wang c962d214e6 fix bug creats directory copying file
close #3384

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-06-20 17:52:12 -04:00
OpenShift Merge Robot 4d470c73ca
Merge pull request #3369 from mheon/add_cached_delegated
Add support for cached, delegated mounts
2019-06-19 20:16:08 +02:00
OpenShift Merge Robot 360adac374
Merge pull request #3366 from edsantiago/test_typo_fixes
fix broken healthcheck tests
2019-06-19 19:34:00 +02:00
OpenShift Merge Robot c60d7ca5d6
Merge pull request #3372 from TomSweeneyRedHat/dev/tsweeney/testpriv
Add RUN with priv'd command build test
2019-06-19 18:51:47 +02:00
OpenShift Merge Robot 7be87f5551
Merge pull request #3078 from cevich/cirrus_f30
Cirrus F30
2019-06-19 16:13:47 +02:00
Matthew Heon 30f24bb760 Add tests for cached and delegated mounts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-19 09:57:33 -04:00