summaryrefslogtreecommitdiff
path: root/test/e2e
Commit message (Collapse)AuthorAge
* podman play kube apply correct log driverPaul Holzinger2021-04-16
| | | | | | | | | | | | | | The --log-driver flag was silently ignored by podman play kube. This regression got introduced during the play kube rework. Unfortunately the test for this was skipped for no good reason. Fixes #10015 Signed-off-by: Paul Holzinger <paul.holzinger@web.de> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
* Fix handling of remove --log-rusage paramDaniel J Walsh2021-04-16
| | | | | | Fixes: https://github.com/containers/podman/issues/9889 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Ensure that `--userns=keep-id` sets user in configMatthew Heon2021-04-16
| | | | | | | | | | | | | | | | | | | | | | | One of the side-effects of the `--userns=keep-id` command is switching the default user of the container to the UID of the user running Podman (though this can still be overridden by the `--user` flag). However, it did this by setting the UID and GID in the OCI spec, and not by informing Libpod of its intention to switch users via the `WithUser()` option. Because of this, a lot of the code that should have triggered when the container ran with a non-root user was not triggering. In the case of the issue that this fixed, the code to remove capabilities from non-root users was not triggering. Adjust the keep-id code to properly inform Libpod of our intention to use a non-root user to fix this. Also, fix an annoying race around short-running exec sessions where Podman would always print a warning that the exec session had already stopped. Fixes #9919 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Fixes invalid expression in save commandzhangguanzhang2021-04-16
| | | | Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* Fix test failureMatthew Heon2021-03-29
| | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* Validate passed in timezone from tz optionTomSweeneyRedHat2021-03-29
| | | | | | | | | | | | | | | | | | | | | | | | Erik Sjolund reported an issue where a badly formated file could be passed into the `--tz` option and then the date in the container would be badly messed up: ``` erik@laptop:~$ echo Hello > file.txt erik@laptop:~$ podman run --tz=../../../home/erik/file.txt --rm -ti docker.io/library/alpine cat /etc/localtime Hello erik@laptop:~$ podman --version podman version 3.0.0-rc1 erik@laptop:~$ ``` This fix checks to make sure the TZ passed in is a valid value and then proceeds with the rest of the processing. This was first reported as a potential security issue, but it was thought not to be. However, I thought closing the hole sooner rather than later would be good. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* Generate Kubernetes PersistentVolumeClaims from named volumesJordan Williams2021-03-29
| | | | | | | | | | | | Fixes #5788 This commit adds support for named volumes in podman-generate-kube. Named volumes are output in the YAML as PersistentVolumeClaims. To avoid naming conflicts, the volume name is suffixed with "-pvc". This commit adds a corresponding suffix for host path mounts. Host path volumes are suffixed with "-host". Signed-off-by: Jordan Williams <jordan@jwillikers.com>
* Ensure manually-created volumes have correct ownershipMatthew Heon2021-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | As part of a fix for an earlier bug (#5698) we added the ability for Podman to chown volumes to correctly match the user running in the container, even in adverse circumstances (where we don't know the right UID/GID until very late in the process). However, we only did this for volumes created automatically by a `podman run` or `podman create`. Volumes made by `podman volume create` do not get this chown, so their permissions may not be correct. I've looked, and I don't think there's a good reason not to do this chwon for all volumes the first time the container is started. I would prefer to do this as part of volume copy-up, but I don't think that's really possible (copy-up happens earlier in the process and we don't have a spec). There is a small chance, as things stand, that a copy-up happens for one container and then a chown for a second, unrelated container, but the odds of this are astronomically small (we'd need a very close race between two starting containers). Fixes #9608 Signed-off-by: Matthew Heon <mheon@redhat.com>
* Support multi doc yaml for generate/play kubeEduardo Vega2021-03-29
| | | | | | | | Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
* Fix podman build --pull-neverDaniel J Walsh2021-03-29
| | | | | | | | | | | | | | | Currently pull policy is set incorrectly when users set --pull-never. Also pull-policy is not being translated correctly when using podman-remote. Fixes: #9573 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> <MH: Fixed cherry-pick conflict> Signed-off-by: Matthew Heon <mheon@redhat.com>
* Add problematic volume name to kube play error messagesJordan Christiansen2021-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When kube play fails to create a volume, it should say which volume had the problem so the user doesn't have to guess. For the following pod spec: apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - name: myfrontend image: nginx volumeMounts: - mountPath: "/var/www/html" name: mypd volumes: - name: mypd hostPath: path: /var/blah podman will now report: Error: failed to create volume "mypd": error in parsing HostPath in YAML: error checking path "/var/blah": stat /var/blah: no such file or directory Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
* test: check for io.stat existence on cgroup v2Giuseppe Scrivano2021-03-17
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* test: fix test for last crun/runcGiuseppe Scrivano2021-03-17
| | | | | | | | | there was a documentation issue for the kernel that reported the range to be different than on cgroup v1. The issue has been fixed in crun/runc. Adapt the test. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* test: simplify cgroup pathGiuseppe Scrivano2021-03-17
| | | | | | with cgroup v2, the cgroupns is enabled by default. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Latest crun/runc should handle blkio-weight testDaniel J Walsh2021-03-17
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Switch all builds to pull-neverDaniel J Walsh2021-03-16
| | | | | | Fixes: https://github.com/containers/buildah/issues/2779 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix remote client timezone testPaul Holzinger2021-03-15
| | | | | | | The New York timezone changes between summer and winter time. Make sure the test allows both timezones. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variablesDaniel J Walsh2021-03-10
| | | | | | | Also Switch to using CONTAINERS_REGISTRIES_CONF for registries.conf overrides. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* podman cp: ignore EPERMs in rootless modeValentin Rothberg2021-03-09
| | | | | | | | | | | | Ignore permission errors when copying from a rootless container. TTY devices inside rootless containers are owned by the host's root user which is "nobody" inside the container's user namespace rendering us unable to even read them. Enable the integration test which was temporarily disabled for rootless users. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Allow users to generate a kubernetes yaml off non running containersDaniel J Walsh2021-03-08
| | | | | | | | | | | | | | | Currently if you attempt to create a kube.yaml file off of a non running container where the container runs as a specific User, the creation fails because the storage container is not mounted. Podman is supposed to read the /etc/passwd entry inside of the container but since the container is not mounted, the c.State.Mountpoint == "". Podman incorrectly attempts to read /etc/passwd on the host, and fails if the specified user is not in the hosts /etc/passwd. This PR mounts the storage container, if it was not mounted so the read succeeds. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* podman-remote stop -time 0 does not workDaniel J Walsh2021-03-05
| | | | | | | | This patch will allow users to pass in the time 0. Currently the timeout will take 10 seconds if user passes in the 0 flag. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #9622 from jmguzik/network-rm-fixOpenShift Merge Robot2021-03-05
|\ | | | | Fix podman network rm (-f) workflow
| * Fix for podman network rm (-f) workflowJakub Guzik2021-03-05
| | | | | | | | Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
* | Merge pull request #9593 from vrothberg/cp-tmpOpenShift Merge Robot2021-03-05
|\ \ | | | | | | podman cp: support copying on tmpfs mounts
| * | podman cp: support copying on tmpfs mountsValentin Rothberg2021-03-04
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, the path resolution for containers has been resolved on the *host*; relative to the container's mount point or relative to specified bind mounts or volumes. While this works nicely for non-running containers, it poses a problem for running ones. In that case, certain kinds of mounts (e.g., tmpfs) will not resolve correctly. A tmpfs is held in memory and hence cannot be resolved relatively to the container's mount point. A copy operation will succeed but the data will not show up inside the container. To support these kinds of mounts, we need to join the *running* container's mount namespace (and PID namespace) when copying. Note that this change implies moving the copy and stat logic into `libpod` since we need to keep the container locked to avoid race conditions. The immediate benefit is that all logic is now inside `libpod`; the code isn't scattered anymore. Further note that Docker does not support copying to tmpfs mounts. Tests have been extended to cover *both* path resolutions for running and created containers. New tests have been added to exercise the tmpfs-mount case. For the record: Some tests could be improved by using `start -a` instead of a start-exec sequence. Unfortunately, `start -a` is flaky in the CI which forced me to use the more expensive start-exec option. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Merge pull request #9598 from rhatdan/kvmOpenShift Merge Robot2021-03-04
|\ \ | | | | | | Check for supportsKVM based on basename of the runtime
| * | Check for supportsKVM based on basename of the runtimeDaniel J Walsh2021-03-03
| |/ | | | | | | | | | | | | | | | | | | | | Fixes: https://github.com/containers/podman/issues/9582 This PR also adds tests to make sure SELinux labels match the runtime, or if init is specified works with the correct label. Add tests for selinux kvm/init labels Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / Fix cni teardown errorsPaul Holzinger2021-03-04
|/ | | | | | | | | | | Make sure to pass the cni interface descriptions to cni teardowns. Otherwise cni cannot find the correct cache files because the interface name might not match the networks. This can only happen when network disconnect was used. Fixes #9602 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Merge pull request #9536 from jmguzik/enable-cgroupsv2-sec-optsOpenShift Merge Robot2021-03-03
|\ | | | | Enable cgroupsv2 rw mount via security-opt unmask
| * Enable cgroupsv2 rw mount via security-opt unmaskJakub Guzik2021-02-28
| | | | | | | | Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
* | Merge pull request #9575 from mheon/rewrite_renameOpenShift Merge Robot2021-03-03
|\ \ | | | | | | Rewrite Rename backend in a more atomic fashion
| * | Rewrite Rename backend in a more atomic fashionMatthew Heon2021-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the core of renaming logic into the DB. This guarantees a lot more atomicity than we have right now (our current solution, removing the container from the DB and re-creating it, is *VERY* not atomic and prone to leaving a corrupted state behind if things go wrong. Moving things into the DB allows us to remove most, but not all, of this - there's still a potential scenario where the c/storage rename fails but the Podman rename succeeds, and we end up with a mismatched state. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | | Merge pull request #9580 from rhatdan/timestampDaniel J Walsh2021-03-03
|\ \ \ | | | | | | | | Fix support for podman build --timestamp
| * | | Fix support for podman build --timestampDaniel J Walsh2021-03-02
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Currently podman is ignoreing the build --timestamp flag. This PR fixes this for local and remote clients. Fixes: https://github.com/containers/podman/issues/9569 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / / Tidy duplicate log testsAshley Cui2021-03-02
|/ / | | | | | | | | | | | | Some log tests were duplicated, and some didn't need to be repeated for every driver. Also, added some comments Signed-off-by: Ashley Cui <acui@redhat.com>
* / Enable no_hosts from containers.confDaniel J Walsh2021-02-26
|/ | | | | | | | | | Since we have no good way to enable this on the server side, we will just allow it to be set on the client side. This should solve almost all cases. Partially fixes: https://github.com/containers/podman/issues/9500 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #9487 from giuseppe/split-test-named-hierarchiesOpenShift Merge Robot2021-02-25
|\ | | | | test: ignore named hierarchies for cgroups=split
| * test: ignore named hierarchies for cgroups=splitGiuseppe Scrivano2021-02-23
| | | | | | | | | | | | | | | | | | ignore named hierarchies for the --cgroups=split test as crun does not set it. Closes: https://github.com/containers/podman/pull/9302#issuecomment-784157272 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | Updated based on Jhonce commentsParker Van Roy2021-02-24
| | | | | | | | | | | | | | | | | | Added ID to default removed outdated imports slight refactor Test Network Headers added to network_test.go Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
* | Merge pull request #9494 from mheon/sort_capsOpenShift Merge Robot2021-02-24
|\ \ | | | | | | Sort CapDrop in inspect to guarantee order
| * | Sort CapDrop in inspect to guarantee orderMatthew Heon2021-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The order of CapAdd when inspecting containers is deterministic. However, the order of CapDrop is not (for unclear reasons). Add a quick sort on the final array to guarantee a consistent order. Fixes #9490 Signed-off-by: Matthew Heon <mheon@redhat.com>
* | | Add dns search domains from cni response to resolv.confPaul Holzinger2021-02-24
| | | | | | | | | | | | | | | | | | | | | This fixes slow local host name lookups. see containers/dnsname#57 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Network connect error if net mode is not bridgePaul Holzinger2021-02-23
|/ / | | | | | | | | | | | | | | | | | | Only the the network mode bridge supports cni networks. Other network modes cannot use network connect/disconnect so we should throw a error. Fixes #9496 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* / Add U volume flag to chown source volumesEduardo Vega2021-02-22
|/ | | | Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
* Merge pull request #9455 from Luap99/fix-network-idsOpenShift Merge Robot2021-02-22
|\ | | | | Fix podman network IDs handling
| * Fix podman network IDs handlingPaul Holzinger2021-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | The libpod network logic knows about networks IDs but OCICNI does not. We cannot pass the network ID to OCICNI. Instead we need to make sure we only use network names internally. This is also important for libpod since we also only store the network names in the state. If we would add a ID there the same networks could accidentally be added twice. Fixes #9451 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #9445 from jmguzik/no-header-info-for-systemd-generationOpenShift Merge Robot2021-02-22
|\ \ | |/ |/| No header info for systemd generation
| * --no-header flag implementation for generate systemdJakub Guzik2021-02-22
| | | | | | | | Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
* | Merge pull request #9420 from rhatdan/kubeOpenShift Merge Robot2021-02-22
|\ \ | | | | | | [NO TESTS NEEDED] Allow podman play kube to read yaml file from stdin
| * | Allow podman play kube to read yaml file from stdinDaniel J Walsh2021-02-19
| |/ | | | | | | | | | | Fixes: https://github.com/containers/podman/issues/8996 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>