summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Set context dir for play kube buildBrent Baude2021-09-23
| | | | | | | | When performing an image build with play kube, we need to set the context directory so things like file copies have the correct input path. Signed-off-by: Brent Baude <bbaude@redhat.com>
* Generate kube should'd add podman default environment varsDaniel J Walsh2021-09-22
| | | | | | | | | | | | Currently we add the default PATH, TERM and container from Podman to every kubernetes.yaml file. These values should not be recorded in the yaml files. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* sync container state before reading the healthcheckPaul Holzinger2021-09-22
| | | | | | | | | | The health check result is stored in the container state. Since the state can change or might not even be set we have to retrive the current state before we try to read the health check result. Fixes #11687 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Eighty-six eighty-eightyEd Santiago2021-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Sorry, couldn't resist). CI flakes have been coming down - thank you to everyone who has been making them a priority. This leaves a noisy subset that I've just been ignoring for months: Running: podman ... -p 8080:something ...cannot listen on the TCP port: listen tcp4 :8080: bind: address already in use Sometimes these are one-time errors resolved on 2nd try; sometimes they fail three times, forcing CI user to hit Rerun. In all cases they make noise in my flake logs, which costs me time. My assumption is that this has to do with ginkgo running random tests in parallel. Since many e2e tests simplemindedly use 8080, collisions are inevitable. Solution: simplemindedly replace 8080 with other (also arbitrarily picked) numbers. This is imperfect -- it requires human developers to pick a number NNNN and 'grep NNNN test/e2e/*' before adding new tests, which I am 100% confident ain't gonna happen -- but it's better than what we have now. Side note: I considered writing and using a RandomAvailablePort() helper, but that would still be racy. Plus, it would be a pain to interpolate strings into so many places. Finally, with this hand-tooled approach, if/when we _do_ get conflicts on port NNNN, it should be very easy to grep for NNNN, find the offending tests that reuse that port, and fix one of them. Signed-off-by: Ed Santiago <santiago@redhat.com>
* vendor c/psgo@v1.7.1Valentin Rothberg2021-09-22
| | | | | | | | | | psgo added support for listing supplementary groups via two new descriptors: * `groups` for supplementary groups inside the container * `hgroups` for the counterpart on the host Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Support --format tables in ps outputJhon Honce2021-09-22
| | | | | | | | | | | - Added tests to help ensure there is no future regressions - Added WaitWithTimeout(int) rather than calling WaitWithDefaultTimeout() multiple times - Exposed DefaultWaitTimeout to allow test to use a multiplier Fixes #2221 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* compat API: /images/json prefix image id with sha256Paul Holzinger2021-09-22
| | | | | | | | | Docker adds the `sha256:` prefix to the image ID, so our compat endpoint has to do this as well. Fixes #11623 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* remote untag: support digestsValentin Rothberg2021-09-22
| | | | | | | | | Fix a bug when remotely untagging an image via tag@digest. The digest has been lost in the remote client and hence led to a wrong behaviour on the server. Fixes: #11557 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* System tests: cleanup, and remove obsolete skipsEd Santiago2021-09-22
| | | | | | | | | | | | | | | | * 070-build: - remove workaround for #9567, which is closed. - add many more cases to the ignorefile test, to test complicated special cases of Buildah PR 3486. * 160-volumes: - remove a skip_if_remote, volumes now work on remote - use a random name for tarball, and clean up when done using it. This fixes a gating-test failure (test runs as root, then rootless, and rootless can't clobber root's file). Signed-off-by: Ed Santiago <santiago@redhat.com>
* Only add 127.0.0.1 entry to /etc/hosts with --net=nonePaul Holzinger2021-09-22
| | | | | | | | | | | The check for net=none was wrong. It just assumed when we do not create the netns but have one set that we use the none mode. This however also applies to a container which joins the pod netns. To correctly check for the none mode use `config.NetMode.IsNone()`. Fixes #11596 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* container runlabel remove image tag from namePaul Holzinger2021-09-22
| | | | | | | | | | | When no name is given for podman container runlabel it will default to the image base name. However this can contain a tag. Since podman does not accept container names with a colon the run command will fail if it contains something like `podman run --name NAME ...`. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2004263 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Fix /auth compat endpointMatej Vasek2021-09-22
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* test/apiv2: set main version back to 3Valentin Rothberg2021-09-20
| | | | | | Must have slipped through when creating the 3.4 branch. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Fix buildah-bud tests by using main's diff fileMatthew Heon2021-09-16
| | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* Remove Pod CPU testsMatthew Heon2021-09-16
| | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* libpod: honor --cgroups=split also with podsGiuseppe Scrivano2021-09-16
| | | | | | Honor --cgroups=split also when the container is running in a pod. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* build.bats: fix copy tests after containers/buildah#3486Aditya Rajan2021-09-16
| | | | | | | | Fix copy tests after https://github.com/containers/buildah/pull/3486 [NO TESTS NEEDED] Signed-off-by: Aditya Rajan <arajan@gmail.com>
* api: handle nil pointer dereference in rest endpointsJelle van der Waa2021-09-16
| | | | | | | | When `?all=garbage` is passed to an API endpoint schema validation fails and err is nil. Wrapf uses err to create an error message causing a nil pointer dereference. Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
* tests: enable --cgroups=disabled test for rootlessGiuseppe Scrivano2021-09-16
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* tests: simplify --cgroups=disabled testGiuseppe Scrivano2021-09-16
| | | | | | read the cgroup directly from the container. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Enhance bindings for IDE hintsJhon Honce2021-09-16
| | | | | | | | | | | * Follow https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source for leading comment * Add godoc strings for all exposed methods for IDE support * Copy field godoc strings into generated code as function godoc string * Remove unused/unnecessary fields from generator.go structures * Cleanup code regarding template usage Signed-off-by: Jhon Honce <jhonce@redhat.com>
* fix restart always with rootlessportPaul Holzinger2021-09-16
| | | | | | | | When a container is automatically restarted due its restart policy and the container uses rootless cni networking with ports forwarded we have to start a new rootlessport process since it exits with conmon. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* test: enable --cgroup-parent testGiuseppe Scrivano2021-09-16
| | | | | | | | and fix it for running with runc. Closes: https://github.com/containers/podman/issues/11165 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Add deprecated fields for 1.22+ clients that still expect themJason T. Greene2021-09-16
| | | | Signed-off-by: Jason Greene <jason.greene@redhat.com>
* If container exits with 125 podman should exit with 125Daniel J Walsh2021-09-16
| | | | | | fixes: https://github.com/containers/podman/issues/11540 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #11517 from jwhonce/issues/10053OpenShift Merge Robot2021-09-12
|\ | | | | Refactor API server emphasis on logging
| * Refacter API server emphasis on loggingJhon Honce2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * To aid in debugging log API request and response bodies at trace level. Events can be correlated using the X-Reference-Id. * Server now echos X-Reference-Id from client if set, otherwise generates an unique id. * Move logic for X-Reference-Id into middleware * Change uses of Header.Add() to Set() when setting Content-Type * Log API operations in Apache format using gorilla middleware * Port server code to use BaseContext and ConnContext Fixes #10053 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #11525 from rhatdan/healthcheckOpenShift Merge Robot2021-09-11
|\ \ | | | | | | Stop outputting 'healthy' on healthcheck
| * | Stop outputting 'healthy' on healthcheckDaniel J Walsh2021-09-10
| |/ | | | | | | | | | | | | | | | | We should only print unhealthy if the check fails. Currently this is filling logs when users are running lots of healthchecks. Improves: https://github.com/containers/podman/issues/11157 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #11513 from Luap99/unshareOpenShift Merge Robot2021-09-11
|\ \ | | | | | | podman unshare keep exit code
| * | podman unshare keep exit codePaul Holzinger2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the command inside the podman unshare env failed podman unshare always exits with 125 and prints `Error: exit status 125`. This is a bad user experience and makes it difficult to use in scripts which could expect certain exit codes. This commit makes sure podman unshare uses the same exit code as the command and does not print the useless `exit status X` message. Also to match podman run/exec it should return 126 for EPERM and 127 for ENOENT. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #11323 from umohnani8/initOpenShift Merge Robot2021-09-10
|\ \ \ | |_|/ |/| | Add init containers to generate and play kube
| * | Add init containers to generate and play kubeUrvashi Mohnani2021-09-10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kubernetes has a concept of init containers that run and exit before the regular containers in a pod are started. We added init containers to podman pods as well. This patch adds support for generating init containers in the kube yaml when a pod we are converting had init containers. When playing a kube yaml, it detects an init container and creates such a container in podman accordingly. Note, only init containers created with the init type set to "always" will be generated as the "once" option deletes the init container after it has run and exited. Play kube will always creates init containers with the "always" init container type. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
* / stats: allow to read stats for paused containersGiuseppe Scrivano2021-09-10
|/ | | | | | paused containers still a cgroup we can use to grab the stats. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Merge pull request #11426 from fj-tsubasa/system-test-scenarioOpenShift Merge Robot2021-09-09
|\ | | | | Add a system test to modify and import an exported container
| * Add a system test to modify and import an exported container.Tsubasa Watanabe2021-09-10
| | | | | | | | | | | | | | This test has completed one of TODO items in test/system/TODO.md. The item is "Implied pull, build, export, modify, import, tag, run, kill" Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
* | Fix conmon attach socket buffer sizePaul Holzinger2021-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conmon buffer size is 8192, however the attach socket needs two extra bytes. The first byte of each message will be the STREAM type. The last byte is a null byte. So when we want to read 8192 message bytes we need to read 8193 bytes since the first one is special. check https://github.com/containers/conmon/blob/1ef246896b4f6566964ed861b98cd32d0e7bf7a2/src/ctr_stdio.c#L101-L107 This problem can be seen in podman-remote run/exec when it prints output with 8192 or more bytes. The output will miss the 8192 byte. Fixes #11496 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | Merge pull request #11502 from vrothberg/vendor-mpbOpenShift Merge Robot2021-09-09
|\ \ | | | | | | vendor mpb@v7.1.4
| * | test/e2e/search_test.go - relax testsValentin Rothberg2021-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some search tests were looking for an explicit amount of images to match. Since images are moving targets on these registries, make sure to use lower bounds instead of exact matches. Fixes CI which started to break when Red Hat images changed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | Merge pull request #11447 from chenzhiwei/respect-configOpenShift Merge Robot2021-09-09
|\ \ \ | | | | | | | | fix play kube can't use infra_image in config file
| * | | fix play kube can't use infra_image in config fileChen Zhiwei2021-09-08
| | | | | | | | | | | | | | | | Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
* | | | Merge pull request #11499 from flouthoc/inspect-tmpl-flush-writerOpenShift Merge Robot2021-09-09
|\ \ \ \ | |_|/ / |/| | | inspect: printTmpl must Flush writer
| * | | inspect: printTmpl must Flush writerAditya Rajan2021-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Flush should be called after the last call to Write to ensure that any data buffered in the Writer is written to output. Any incomplete escape sequence at the end is considered complete for formatting purposes. Signed-off-by: Aditya Rajan <arajan@redhat.com>
* | | | Merge pull request #11485 from Luap99/network-upgrade-testOpenShift Merge Robot2021-09-09
|\ \ \ \ | |/ / / |/| | | podman upgrade tests for networking
| * | | podman upgrade tests for networkingPaul Holzinger2021-09-09
| | | | | | | | | | | | | | | | | | | | | | | | Test basic networking functionality in the upgrade tests. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | | Add logDriver to podman infoDaniel J Walsh2021-09-08
|/ / / | | | | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | system tests: new random_free_port helperEd Santiago2021-09-08
| | | | | | | | | | | | | | | | | | | | | Picks a pseudorandom open port within a range. Refactor existing instances of such code. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | | Merge pull request #11468 from Luap99/play-kube-slirpOpenShift Merge Robot2021-09-08
|\ \ \ | | | | | | | | fix play kube --network options
| * | | fix play kube --network optionsPaul Holzinger2021-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 092902b45555 introduced advanced network options for podman play kube. However this never worked because it unconditionally set the network mode to bridge after it parsed the network option. Added a test to ensure the correct mode is set. Truly fixes #10807 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | | test/testvol/main.go: Fix missing arguments to Errorf()Raoul Bhatia2021-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | go test -v -p 1 -tags apparmor,ostree,seccomp,selinux,systemd github.com/containers/podman/v2/test/testvol results in the following error: > test/testvol/main.go:227:10: Errorf format %s reads arg #1, but call has 0 args > test/testvol/main.go:233:10: Errorf format %s reads arg #1, but call has 0 args This patch passes req.Name as an argument to the Errorf() call Signed-off-by: Raoul Bhatia <raoul.bhatia@radarcs.com>