Commit Graph

6961 Commits

Author SHA1 Message Date
Michael Zimmermann 315e7412e8 add support for driver-specific options during container creation
This way has a huge disadvantage: The user will not see an error when he
uses a non-existent option. Another disadvantage is, that if we add more
options within podman, they might collide with the names chosen by
plugins. Such issues might be hard to debug.
The advantage is that the usage is very nice:
--network bridge:opt1=val1,opt2=val2.

Alternatively, we could put this behind `opt=`, which is harder to use,
but would solve all issues above:
--network bridge:opt=opt1=val1,opt=opt2=val2

Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
2024-11-13 18:14:58 +01:00
openshift-merge-bot[bot] 6a6e890553
Merge pull request #24553 from containers/renovate/setuptools-75.x
chore(deps): update dependency setuptools to ~=75.5.0
2024-11-13 12:47:43 +00:00
renovate[bot] 590fcafc2b
chore(deps): update dependency setuptools to ~=75.5.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 12:01:33 +00:00
Ed Santiago 1c77ee6fc5 CI: system tests: parallelize 010
Final cleanup. Has been working fine in #23257 for weeks.
Not much gain here, but every little bit helps.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-13 04:14:57 -07:00
openshift-merge-bot[bot] 8f2d5011f2
Merge pull request #24532 from mheon/subpath
Add subpath support to volumes in `--mount` option
2024-11-12 21:46:58 +00:00
openshift-merge-bot[bot] f41eab21de
Merge pull request #24540 from Luap99/vendor
vendor containers projects to tagged versions
2024-11-12 15:00:03 +00:00
Matt Heon 8a192c8403 Add subpath support to volumes in `--mount` option
All the backend work was done a while back for image volumes, so
this is effectively just plumbing the option in for volumes in
the parser logic. We do need to change the return type of the
volume parser as it only worked on spec.Mount before (which does
not have subpath support, so we'd have to pass it as an option
and parse it again) but that is cleaner than the alternative.

Fixes #20661

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-11-12 09:13:16 -05:00
openshift-merge-bot[bot] 2bcbffa186
Merge pull request #24531 from containers/renovate/setuptools-75.x
chore(deps): update dependency setuptools to ~=75.4.0
2024-11-12 12:39:16 +00:00
Paul Holzinger 0a1363d8eb
test/e2e: remove FIPS test
First, creating a global file /etc/system-fips was never a good idea for
testing as it affects other running tests at the same time.
And as of a recent change to FIPS mounts[1] we no longer use the file so
the test breaks with c/common v0.61. Instead it uses the kernel file
/proc/sys/crypto/fips_enabled which requires the real fips mode to be
activated and that in turn requires a reboot. As such this is not
somthing that can be tested in upstream CI like that.

[1] https://github.com/containers/common/pull/2174

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-12 10:59:04 +01:00
renovate[bot] ca7703643b
chore(deps): update dependency setuptools to ~=75.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-11 19:10:38 +00:00
Ed Santiago 969417711d system tests: safer install_kube_template()
Previous version was badly broken: it relied on 'make'
rebuilding a file under cwd, which is a no-no; and, in
the case where we don't have a source directory, just
blindly hoped that there'd be a system-installed .service
file with the correct path to podman.

Solution:
  . if running in source directory, run sed directly into
    destination service file in $UNIT_DIR. This is ugly
    duplication of a line in Makefile.

  . if NOT running in a source directory, check $PODMAN:
    . if it's /usr/bin/podman, continue. Include a warning
      that will be shown only on test failure.
    . otherwise skip, because we don't know what we're testing

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-11 10:44:32 -07:00
Ed Santiago 33398ebc1e Buildah treadmill tweaks
* treadmill script: handle an obscure corner case
  wherein the script would bail because it thought
  there were no buildah-vendor changes.

* two new test skips

* update the diffs; line-number changes due to buildah
  PRs touching helpers.bash

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-11 07:04:39 -07:00
Paul Holzinger 9eca92d625
update golangci-lint to v1.62.0
- fix issues found by recvcheck
- skip k8s files from recvcheck
- remove two removed linters gomnd and execinquery

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-11 14:21:17 +01:00
renovate[bot] e1a6c53909
fix(deps): update module golang.org/x/tools to v0.27.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-11 10:19:25 +00:00
openshift-merge-bot[bot] ee5b8de70d
Merge pull request #24413 from giuseppe/add-test-zstd-chunked
tests: add basic zstd:chunked system test
2024-11-08 14:36:06 +00:00
openshift-merge-bot[bot] a1c1ae62e7
Merge pull request #24340 from l0rd/ssh-knownhosts-test
New `system connection add` test
2024-11-08 13:24:46 +00:00
Giuseppe Scrivano 30a82cad7a
test: add zstd:chunked system tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-11-08 12:39:07 +01:00
Ed Santiago fbbfd07463 kube SIGINT system test: fix race in timeout handling
Up to now this test has been run using:

    PODMAN_TIMEOUT=2 run_podman kube play ...

...and this gives podman time to start the pod before getting
the signal.

When run in parallel, under heavy load, the above command seems
to time out before podman has gotten its act together. Weird
things happen, like weird exit status and (most crucially)
zombie containers.

Solution: wait for container to actually start before we kill it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-07 11:01:08 -07:00
Mario Loriedo b20960b860 New `system connection add` tests
These tests verify that podman successfully adds (or
fails to add) a connection to an SSH server based on
the entries in the `~/.ssh/known_hosts` file.

In particular `system connection add` should succeed if:
- there is no `know_hosts` file
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry for another SSH server, not for the target server

It should fail if the `known_host` file has an entry for
the target server that matches the protocol but not the key.

Depends on containers/common#2212
Fixes #23575

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-11-07 17:48:27 +01:00
Mario Loriedo cbf1d7fcae Avoid printing PR text to stdout in system test
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-11-07 17:48:27 +01:00
Paul Holzinger 22152a2f9c
test/buildah-bud: build new inet helper
Added in https://github.com/containers/buildah/pull/5783

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-07 10:39:15 +01:00
Paul Holzinger fb3a0e93a8
test/system: add regression test for TZDIR local issue
Regression test for #23550. Setting the TZDIR env should make no
difference for the local timezone as this is not a real timezone name
that is resolved from that directory.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-07 10:39:15 +01:00
openshift-merge-bot[bot] aac206e9c5
Merge pull request #24412 from Sativarsainath-26/network-events
Fix: To print create and remove network in podman events
2024-11-06 18:33:18 +00:00
Daniel J Walsh 6346a11b09
AdditionalSupport for SubPath volume mounts
Add support for inspecting Mounts which include SubPaths.

Handle SubPaths for kubernetes image volumes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-11-06 10:10:26 -05:00
openshift-merge-bot[bot] a358d83ce9
Merge pull request #24437 from lambinoo/feat-split-pod-container-start-24401
Add key to control if a container can get started by its pod
2024-11-05 15:04:16 +00:00
Sainath Sativar c23d9c6f23 Log network creation and removal events in Podman
This commit resolves an issue where network creation and removal events were not being logged in `podman events`. A new function has been introduced in the `events` package to ensure consistent logging of network lifecycle events. This update will allow users to track network operations more effectively through the event log, improving visibility and aiding in debugging network-related issues.

Fixes: #24032
Signed-off-by: Sainath Sativar <Sativar.sainath@gmail.com>
2024-11-05 11:58:47 +00:00
openshift-merge-bot[bot] c8af2f2c1e
Merge pull request #24334 from rhatdan/quadlet
Honor users requests in quadlet files
2024-11-05 09:45:11 +00:00
Farya L. Maerten 2597eeae70 Add key to control if a container can get started by its pod
By default today, the container is always started if its pod is also
started. This prevents to create custom with systemd where containers in
a pod could be started through their `[Install]` section.

We add a key `StartWithPod=`, enabled by default, that enables one to
disable that behavior.

This prevents the pod service from changing the state of the container
service.

Fixes #24401

Signed-off-by: Farya L. Maerten <me@ltow.me>
2024-11-05 08:39:23 +01:00
Daniel J Walsh c6be5a6684
Honor users requests in quadlet files
Fixes: https://github.com/containers/podman/issues/24322

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-11-04 15:08:26 -05:00
openshift-merge-bot[bot] df41725d61
Merge pull request #24461 from edsantiago/stop-trap-timeout
CI: systests: workaround for parallel podman-stop flake
2024-11-04 18:56:59 +00:00
openshift-merge-bot[bot] 0f25d9ee15
Merge pull request #24406 from Luap99/event-api-response
fix API issue about missing the status code in the events and logs endpoints
2024-11-04 18:54:14 +00:00
Ed Santiago 2c01264568 CI: systests: workaround for parallel podman-stop flake
Just bump up a timeout when running parallel, because of high load.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-04 10:45:14 -07:00
openshift-merge-bot[bot] 2279a77303
Merge pull request #24403 from Luap99/tools-vendor
go.mod vendor: ensure we never have the toolchain directive set
2024-11-04 17:15:12 +00:00
Ygal Blum dbfc8cccda Quadlet - support image file based mount in container file
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-11-01 16:20:23 -04:00
Paul Holzinger e6d987882e
API: container logs flush status code
API clients expect the status code quickly otherwise they can time out.
If we do not flush we may not write the header immediately and only when
futher logs are send.

Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
Paul Holzinger 768ad8653a
rework event code to improve API errors
One of the problems with the Events() API was that you had to call it in
a new goroutine. This meant the the error returned by it had to be read
back via a second channel. This cuased other bugs in the past but here
the biggest problem is that basic errors such as invalid since/until
options were not directly returned to the caller.
It meant in the API we were not able to write http code 200 quickly
because we always waited for the first event or error from the
channels. This in turn made some clients not happy as they assume the
server hangs on time out if no such events are generated.

To fix this we resturcture the entire event flow. First we spawn the
goroutine inside the eventer Read() function so not all the callers have
to. Then we can return the basic error quickly without the goroutine.
The caller then checks the error like any normal function and the API
can use this one to decide which status code to return.
Second we now return errors/event in one channel then the callers can
decide to ignore or log them which makes it a bit more clear.

Fixes c46884aa93 ("podman events: check for an error after we finish reading events")
Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
Paul Holzinger 0acd192b59
Makefile: vendor target should always remove toolchain
We never want the toolchain as the default is to use the same as the go
version. So the only purpose of toolchain is to force a newer compiler
than necessary which we do not want as we are getting build by many
different distributions and block builds that would otherwise work fine
is just not helpful to anyone.

Also update the go.mod comments remind people that there should be no
toolchain. The make vendor target with the toolchain will now guarantee
this so the CI will fail otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 13:23:01 +01:00
Paul Holzinger f4ad93d5f6
test/tools/go.mod: remove toolchain
Like our main go.mod we never want to force a specific toolchain.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 13:23:01 +01:00
Paul Holzinger d633824a95
Instrument cleanup tracer to log weird volume removal flake
Debug for #23913, I though if we have no idea which process is nuking
the volume then we need to figure this out. As there is no reproducer
we can (ab)use the cleanup tracer. Simply trace all unlink syscalls to
see which process deletes our special named volume. Given the volume
name is used as path on the fs and is deleted on volume rm we should
know exactly which process deleted it the next time hopefully.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-30 18:50:07 +01:00
renovate[bot] c7ff3b75cb
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.21.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 12:17:30 +00:00
renovate[bot] 5f66277138
chore(deps): update dependency setuptools to ~=75.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-29 10:33:01 +00:00
openshift-merge-bot[bot] a56cda18cf
Merge pull request #24388 from shenpengfeng/main
chore: fix some function names in comment
2024-10-29 10:32:12 +00:00
shenpengfeng 9abc17f1e1 chore: fix some function names in comment
Signed-off-by: shenpengfeng <xinhangzhou@icloud.com>
2024-10-29 17:57:31 +08:00
openshift-merge-bot[bot] 3a7e1deed4
Merge pull request #24390 from edsantiago/safename-070
CI: make 070-build.bats use safe image names
2024-10-28 14:41:28 +00:00
openshift-merge-bot[bot] 2cbb2e8c42
Merge pull request #24392 from edsantiago/parallelize-520
CI: parallelize 520-checkpoint tests
2024-10-28 13:49:13 +00:00
Ed Santiago 41a82c9a95 CI: parallelize 450-interactive system tests
This has been running reliably for weeks in #23275

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-28 07:03:29 -06:00
Ed Santiago 10d056cc5e CI: parallelize 520-checkpoint tests
This has been running reliably for weeks in #23275

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-28 07:02:51 -06:00
Ed Santiago e6b7e4ff84 CI: make 070-build.bats use safe image names
In preparation for maybe some day being able to run build tests
in parallel.

SUPER IMPORTANT NOTE! BUILD TESTS CANNOT BE PARALLELIZED YET!
buildah, when run in parallel, barfs with:

    race: parallel builds: copying...committing...creating... layer not known

Until this is fixed, podman-build can never be run in parallel.
See https://github.com/containers/buildah/issues/5674

This PR is simply cleaning things up so, if/when that day comes,
the ensuing parallelize PR will be short & sweet.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-28 06:58:26 -06:00
openshift-merge-bot[bot] 0962a1e1bf
Merge pull request #24352 from edsantiago/systemd-leak-cleanup
System tests: clean up unit file leaks
2024-10-28 12:07:27 +00:00
Paul Holzinger 64516e1b8f
test/system: add podman network reload test to distro gating
The recent fedora kernel 6.11.4 has a problem with ipv6 networks [1].
This is not a podman bug at all but rather a kernel regression. I can
reproduce the issue easily by running this test.

Given many users were hit by this add it to the distro level gating
which runs in the fedora openQA framework and then we should catch a
bad kernel like this hopefully in the future and prevent it from going
into stable.

[1] https://github.com/containers/podman/issues/24374

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-28 11:51:43 +01:00
Ed Santiago 743a0d49eb System tests: clean up unit file leaks
Quadlet tests and some systemd tests leak unit files, as
reported by 'systemctl list-units --failed'. Clean them up.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-28 04:45:04 -06:00
Paul Holzinger 6069cdda00
healthcheck: do not leak statup service
The startup service is special because we have to transition from
startup to the normal unit. And in order to do so we kill ourselves (as
we are run as part of the service). This means we always exited 1 which
causes systemd to keep us failure and not remove the transient unit
unless "reset-failed" is called. As there is no process around to do
that we cannot really do this, thus make us exit(0) which makes more
sense.

Of course we could try to reset-failed the unit later but the code for
that seems more complicated than that.

Add a new test from Ed that ensures we check for all healthcheck units
not just the timer to avoid leaks. I slightly modified it to provide a
better error on leaks.

Fixes: 0bbef4b830 ("libpod: rework shutdown handler flow")
Fixes: #24351

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-25 13:47:59 +02:00
Jan Rodák afedb83917
Add Startup HealthCheck configuration to the podman inspect
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-10-24 13:49:51 +02:00
Ed Santiago ee9c681f31 Buildah treadmill: improve wording in test-fail instructions
Clarify, expand, fix a typo. These are the instructions
shown when the **patching** step fails, typically when
buildah's helpers.bash is changed in a way that conflicts
with our make-it-work-in-podman patches.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-23 12:34:33 -06:00
Paul Holzinger 0cdb9b3b22
ps: fix display of exposed ports
This fixes two problems, first if a port is published and exposed it
should not be shown twice. It is enough to show the published one.

Second, if there is a huge range the ports were no grouped causing the
output to be unreadable basically. Now we group exposed ports like we do
with the normal published ports.

Fixes #23317

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-23 15:03:30 +02:00
David Gibson 5b131b8273 test/system: Fix spurious "duplicate tests" failures in pasta tests
As an internal consistency check, the pasta tests check for duplicated test
cases by grepping a log file for a parsed test id.  However it uses
grep -F for the purpose which will not perform an exact match, but a
substring match.  There are some tests which generate an id which is a
substring of the id for other tests, so when test order is randomised, this
can cause a spurious failure.  This can happen in practice when running
the test in parallel with very high concurrency (e.g. -j 100).

Fix this by adding the -x option to grep, which only checks for full line
exact matches.

Fixes: https://github.com/containers/podman/issues/24342

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-23 14:02:53 +11:00
Miloslav Trmač 6fd0e227b4 Improve "podman load - from URL"
Don't assume that the loaded image will be deduplicated
with the server image.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-22 19:36:14 +02:00
Miloslav Trmač 77ef28c14f Try to repair c/storage after removing an additional image store
The additional image store feature assumes that images / layers
in the additional store never go away, while we do remove it after
this test. Try to repair the store.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-22 19:36:03 +02:00
Miloslav Trmač 1d7ec1ef5f Use the config digest to compare images loaded/pulled using different methods
Historically, non-schema1 images had a deterministic image ID == config digest.
With zstd:chunked, we don't want to deduplicate layers pulled by consuming the
full tarball and layers partially pulled based on TOC, because we can't cheaply
ensure equivalence; so, image IDs for images where a TOC was used differ.

To accommodate that, compare images using their configs digests, not using image IDs.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-22 19:36:02 +02:00
Miloslav Trmač bf8f2b5551 Simplify the additional store test
When looking up the current-store image ID, do that
from the same output where we verify that the ID is from the
current store, instead of listing images twice.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-22 19:15:46 +02:00
Miloslav Trmač 3bc6072142 Fix the store choice in "podman pull image with additional store"
The test got the stores RW status backwards.

Before zstd:chunked, both image IDs should be the same, so this used
to make no difference.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-22 19:15:46 +02:00
openshift-merge-bot[bot] 57095a9e62
Merge pull request #24335 from giuseppe/test-set-soft-ulimit
test: set soft ulimit
2024-10-22 11:09:41 +00:00
openshift-merge-bot[bot] f4227e887c
Merge pull request #24275 from Luap99/wait-condition
libpod API: only return exit code without conditions
2024-10-22 10:53:12 +00:00
Giuseppe Scrivano 94878af151
test: set soft ulimit
when the current soft limit is higher than the new value, ulimit fails
to set the hard limit as (tested on Rawhide):

[root@rawhide ~]# ulimit -n -H 1048575
-bash: ulimit: open files: cannot modify limit: Invalid argument

to avoid the problem, set also the soft limit:

[root@rawhide ~]# ulimit -n -H
12345678
[root@rawhide ~]# ulimit -n -H 1048575
-bash: ulimit: open files: cannot modify limit: Invalid argument
[root@rawhide ~]# ulimit -n -SH 1048575
[root@rawhide ~]# ulimit -n -H
1048575

commit 71d5ee0e04 introduced the issue.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-22 12:05:07 +02:00
Miloslav Trmač fdc9feea0e Fix 330-corrupt-images.bats in composefs test runs
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-18 23:44:04 +02:00
openshift-merge-bot[bot] 290d94d3c0
Merge pull request #24300 from edsantiago/flake-fix-checkpoint-test
CI: e2e: fix checkpoint flake
2024-10-18 16:42:44 +00:00
Paul Holzinger 67e0fa8b89
quadlet: add default network dependencies to all units
There is no good reason for the special case, kube and pod units
definitely need it. Volume and network units maybe not but for
consistency we add it there as well. This makes the docs much easier to
write and understand for users as the behavior will not differ.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 14:01:22 +02:00
Paul Holzinger 57b022782b
quadlet: ensure user units wait for the network
As documented in the issue there is no way to wait for system units from
the user session[1]. This causes problems for rootless quadlet units as
they might be started before the network is fully up. TWhile this was
always the case and thus was never really noticed the main thing that
trigger a bunch of errors was the switch to pasta.

Pasta requires the network to be fully up in order to correctly select
the right "template" interface based on the routes. If it cannot find a
suitable interface it just fails and we cannot start the container
understandingly leading to a lot of frustration from users.

As there is no sign of any movement on the systemd issue we work around
here by using our own user unit that check if the system session
network-online.target it ready.

Now for testing it is a bit complicated. While we do now correctly test
the root and rootless generator since commit ada75c0bb8 the resulting
Wants/After= lines differ between them and there is no logic in the
testfiles themself to say if root/rootless to match specifics. One idea
was to use `assert-key-is-rootless/root` but that seemed like more
duplication for little reason so use a regex and allow both to make it
pass always. To still have some test coverage add a check in the system
test to ask systemd if we did indeed have the right depdendencies where
we can check for exact root/rootless name match.

[1] https://github.com/systemd/systemd/issues/3312

Fixes #22197

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 11:43:48 +02:00
Paul Holzinger ada75c0bb8
test/e2e: test quadlet with and without --user
This seems to be a testing gap, we need to test both for full coverage.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-17 15:53:10 +02:00
Ed Santiago fa920f54c7 CI: e2e: fix checkpoint flake
Two flakes seen in the last three months. One of them was in
August, so it's not related to ongoing criu-4.0 problems.

Suspected cause: race waiting for "podman run --rm" container
to transition from stopped to removed.

Solution: allow a 5-second grace period, retrying every second.

Also: add explanations to the Expect()s, remove unnecessary
code, and tighten up the CID check.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-17 06:40:33 -06:00
Ed Santiago fe96c843bf APIv2 test fix: image history
I'm assuming this was buildah#5595: the COMMENT field moved around.
Deal with it, and add a few more checks while we're at it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
Ed Santiago 67e39c1ec5 pasta udp tests: new bytecheck helper
...for debugging #24147, because "md5sum mismatch" is not
the best way to troubleshoot bytestream differences.

socat is run on the container, so this requires building a
new testimage (20241011). Bump to new CI VMs[1] which include it.

 [1] https://github.com/containers/automation_images/pull/389

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
renovate[bot] 927cb7624c
Update dependency setuptools to ~=75.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 13:48:10 +00:00
Ed Santiago 1ddb15c81f System tests: safer pause-image creation
The current mypod hack breaks down when running individual tests:

    $ hack/bats 010   <<< barfs because it does not want pause-image!

Reason: Bats does not provide any official way to tell if tests
are being run in parallel.

Workaround: use an undocumented way.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 06:02:23 -06:00
openshift-merge-bot[bot] a2eb5429b3
Merge pull request #24264 from edsantiago/try-try-again
CI: fix changing-rootFsSize flake
2024-10-15 22:05:42 +00:00
openshift-merge-bot[bot] d5be88e0c2
Merge pull request #24228 from giuseppe/do-not-lower-rlimits
podman: do not set rlimits to the default value
2024-10-15 22:02:52 +00:00
Paul Holzinger 768aaadca1
libpod API: only return exit code without conditions
The special handling to return the exit code after the container has
been removed should only be done if there are no special conditions
requested. If a user asked for running or nay other state returning the
exit code immediately with a success response is just wrong. We only
want to allow that so the remote client can fetch the exit code without
races.

Fixes b3829a2932 ("libpod API: make wait endpoint better against rm races")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-15 18:31:36 +02:00
Paul Holzinger b0f2ebbe9d
test/e2e: fix default signal exit code test
By default golang programs exit 2 on special exit signals that can be
cought and produce a stack trace. However this is behavior that can be
modfied via GOTRACEBACK=crash[1], in that case it does not exit(2) but
rather sends itself SIGABRT to the parent sees the signal exit and out
test sees that es exit code 134, 128 + 6 (SIGABRT), like most shells do.

As it turns out GOTRACEBACK=crash is the default mode on all fedora and
RHEL rpm builds as they patch the build with a special
"rpm_crashtraceback" go build tag.

While that change is old and existing for a very long time it was never
caught until commit 5e240ab1f5, which switched the old ExitWithError()
check that accepted anything > 0, to just accept 2. And as CI only test
upstream builds that are build without rpm_crashtraceback we did not
catch in CI either. Only once a user actually used distro build against
the source e2e test it failed.

I like to highlight that running distro builds against upstream e2e
tests is not something we really support or plan to support but given
this is a easy fix I decided to just fix it here as any user with
GOTRACEBACK=crash set would face the same issue.

While I touch this test remove the unnecessary RestoreArtifact() call
which is not needed at all as we do nothing with the image and just
slows the test down for now reason.

[1] https://pkg.go.dev/runtime#section-sourcefiles

Fixes #24213

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-15 15:17:50 +02:00
Ed Santiago 1b57dcab61 CI: fix changing-rootFsSize flake
(Second try). Use an airgapped image in the inspect-data tests.

Fixes: #23756

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-15 05:14:49 -06:00
Giuseppe Scrivano 71d5ee0e04
podman: do not set rlimits to the default value
since the effect would be to lower the rlimits when their definition
is higher than the default value.

The test doesn't fail on the previous version, unless the system is
configured with a nofile ulimit higher than the default value.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-11 23:04:27 +02:00
openshift-merge-bot[bot] d512e44147
Merge pull request #24227 from Luap99/ci-image-update
cirrus: update CI images
2024-10-10 17:25:39 +00:00
Paul Holzinger 4e3a03795d
test/e2e: skip some Containerized checkpoint tests
They no longer work in the latest image update, it is not clear why and
I do not have the time to debug that stuff. I opened #24230 to track it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-10 17:44:09 +02:00
Paul Holzinger fe404959ed
test: update timezone checks
In debian EST and MST7MDT are gone by default and moved to a special
package[1], instead of also installing that in the images lets use
different timezones in the test.

[1] 42c0008f86

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-10 17:44:08 +02:00
Paul Holzinger f517e52167
test/e2e: try debug potential pasta issue
Run pasta with --trace and a log file to see if the hangs are caused by
pasta not correctly closing connections as assumed in #24219.

As the log is super verbose do not log it by default so I added some
extra logic to make sure it is only logged when the test fails.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-10 12:00:25 +02:00
Ed Santiago 38803713d6 CI: quadlet system tests: use airgapped testimage
This command sequence causes SizeRootFs to change on foo:

   podman tag foo newimagename
   podman save ... newimagename
   podman load ...

Solution: get foo completely out of the picture. Use an
airgapped image: new image, new digest, new everything.

Fixes: #23756

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-09 14:11:00 -06:00
openshift-merge-bot[bot] 5890190c59
Merge pull request #24194 from lambinoo/quadlet-disable-default-dependencies
Allow removing implicit quadlet systemd dependencies
2024-10-09 16:23:31 +00:00
Farya L. M bac655a6b1 Allow removing implicit quadlet systemd dependencies
Quadlet inserts network-online.target Wants/After dependencies to ensure pulling works.
Those systemd statements cannot be subsequently reset.

In the cases where those dependencies are not wanted, we add a new
configuration item called `DefaultDependencies=` in a new section called
[Quadlet]. This section is shared between different unit types.

fixes #24193

Signed-off-by: Farya L. Maerten <me@ltow.me>
2024-10-09 14:48:05 +02:00
Ed Santiago e7833d52cf 055-rm test: clean up a test, and document
There's an important reason why the healthcheck container in 055-rm
test uses 'sleep infinity' and not 'top. Document it.

And, the test itself wasn't actually working as intended. Make
it safer by confirming that the container actually enters
the "stopping" state.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-07 15:22:49 -06:00
openshift-merge-bot[bot] 6b0ad8269c
Merge pull request #24182 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.26.0
2024-10-07 16:59:17 +00:00
Paul Holzinger 45df394072
server: fix url parsing in info
When we are activated by systemd the code assumed that we had a valid
URL which was not the case so it failed to parse the URL which causes
the info call to fail all the time.
This fixes two problems first add the schema to the systemd activated
listener URL so it can be parsed correctly but second simply do not
parse it as url as all we care about in the info call is if it is unix
and the file path exists.

Fixes #24152

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-07 12:03:56 +02:00
renovate[bot] b8dbe09f98
fix(deps): update module golang.org/x/tools to v0.26.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-07 10:00:55 +00:00
openshift-merge-bot[bot] d28af234de
Merge pull request #24164 from mheon/host_network_no_expose_in_ports
Exposed ports are only included when not --net=host
2024-10-04 17:03:40 +00:00
openshift-merge-bot[bot] 1f7fe1d1e8
Merge pull request #24167 from giuseppe/improve-check-for-current-user-mapped
libpod: hasCurrentUserMapped checks for gid too
2024-10-04 16:55:13 +00:00
openshift-merge-bot[bot] d6da198c87
Merge pull request #24166 from ygalblum/doc-testflags
[CI:DOCS] Document TESTFLAGS in test README file
2024-10-04 16:52:29 +00:00
openshift-merge-bot[bot] e9e9f7e1ff
Merge pull request #24124 from mheon/validate_bind_propagation
Validate the bind-propagation option to `--mount`
2024-10-04 15:29:58 +00:00
Matt Heon 8061553c0f Exposed ports are only included when not --net=host
Undoing some of my own work here from #24090 now that we have the
ExposedPorts field implemented in inspect. I considered a revert
of that patch, but it's still needed as without it we'd be
including exposed ports when --net=container which is not
correct.

Basically, exposed ports for a container should always go in the
new ExposedPorts field we added. They sometimes go in the Ports
field in NetworkSettings, but only when the container is not
net=host and not net=container. We were always including exposed
ports, which was not correct, but is an easy logical fix.

Also required is a test change to correct the expected behavior
as we were testing for incorrect behavior.

Fixes https://issues.redhat.com/browse/RHEL-60382

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-04 11:19:43 -04:00
Giuseppe Scrivano e46ae46f18
libpod: hasCurrentUserMapped checks for gid too
the kernel checks that both the uid and the gid are mapped inside the
user namespace, not only the uid:

/**
 * privileged_wrt_inode_uidgid - Do capabilities in the namespace work over the inode?
 * @ns: The user namespace in question
 * @idmap: idmap of the mount @inode was found from
 * @inode: The inode in question
 *
 * Return true if the inode uid and gid are within the namespace.
 */
bool privileged_wrt_inode_uidgid(struct user_namespace *ns,
				 struct mnt_idmap *idmap,
				 const struct inode *inode)
{
	return vfsuid_has_mapping(ns, i_uid_into_vfsuid(idmap, inode)) &&
	       vfsgid_has_mapping(ns, i_gid_into_vfsgid(idmap, inode));
}

for this reason, improve the check for hasCurrentUserMapped to verify
that the gid is also mapped, and if it is not, use an intermediate
mount for the container rootfs.

Closes: https://github.com/containers/podman/issues/24159

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-04 16:17:04 +02:00
Ygal Blum e948c4ed90 [CI:DOCS] Document TESTFLAGS in test README file
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-10-04 10:16:27 -04:00
openshift-merge-bot[bot] 30a25a0d3d
Merge pull request #24135 from Luap99/vendor
vendor: update c/common and buildah
2024-10-04 13:14:43 +00:00
Matt Heon 985b57d9f7 Validate the bind-propagation option to `--mount`
Similar to github.com/containers/buildah/pull/5761 but not
security critical as Podman does not have an expectation that
mounts are scoped (the ability to write a --mount option is
already the ability to mount arbitrary content into the container
so sneaking arbitrary options into the mount doesn't have
security implications). Still, bad practice to let users inject
anything into the mount command line so let's not do that.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-04 09:07:51 -04:00
openshift-merge-bot[bot] 70f31281d6
Merge pull request #24114 from kolyshkin/sys-cap
vendor: switch to moby/sys/capability
2024-10-02 16:56:54 +00:00
Ed Santiago 043b82ef59
Fixes for vendoring Buildah
This commit was automatically cherry-picked
by buildah-vendor-treadmill v0.3
from the buildah vendor treadmill PR, #13808

  * Fix conflict caused by Ed's local-registry PR in buildah
  * Wire in "new" --retry and --retry-delay, these existed for longer
    but where non functional.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-02 18:38:38 +02:00
openshift-merge-bot[bot] 4eb43de41a
Merge pull request #24128 from ygalblum/quadlet-remove-equal-sign
Quadlet - prefer "param val" over "param=val" to allow env expansion
2024-10-02 15:34:35 +00:00
openshift-merge-bot[bot] 75a6a6681d
Merge pull request #24110 from mheon/fix_rhel_60382_round_2
Add ExposedPorts to Inspect's ContainerConfig
2024-10-02 13:41:34 +00:00
openshift-merge-bot[bot] 06f24180ce
Merge pull request #24125 from edsantiago/ci-desired-network
CI: require and test CI_DESIRED_NETWORK on RHEL
2024-10-02 12:48:49 +00:00
Ygal Blum fc25a3a5fc Quadlet - prefer "param val" over "param=val" to allow env expansion
When possible use a generic function to add strings and booleans
Adjust tests

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-10-01 18:01:05 -04:00
Ed Santiago 410537808e System tests: sdnotify: wait for socket file creation
Potential race between starting socat (which creates a socket
file) and processes accessing said socket. Or maybe not. I
dunno, I'm grasping at straws. This is an elusive flake.

Fixes: #23798 (I hope)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-01 14:50:16 -06:00
Kir Kolyshkin 28e01cc8cc Switch to moby/sys/capability
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-10-01 12:52:18 -07:00
Ed Santiago b791dfb558 CI: require and test CI_DESIRED_NETWORK on RHEL
Although podman has moved on from CNI, RHEL has not. Make
sure that builds on RHEL test the desired network backend(s).

Effective immediately, gating.yaml on all RHEL branches
must set CI_DESIRED_NETWORK (=cni or =netavark)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-01 10:44:07 -06:00
Matt Heon edc3dc5e11 Add ExposedPorts to Inspect's ContainerConfig
A field we missed versus Docker. Matches the format of our
existing Ports list in the NetworkConfig, but only includes
exposed ports (and maps these to struct{}, as they never go to
real ports on the host).

Fixes https://issues.redhat.com/browse/RHEL-60382

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-01 07:54:52 -04:00
Paul Holzinger abc4cfb049
quadlet: allow variables in PublishPort
There is no reason to validate the args here, first podman may change
the syntax so this is just duplication that may hurt us long term. It
also added special handling of some options that just do not make sense,
i.e. removing 0.0.0.0, podman should really be the only parser here. And
more importantly this prevents variables from being used.

Fixes #24081

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-01 10:07:20 +02:00
openshift-merge-bot[bot] e1496c992a
Merge pull request #24090 from mheon/fix_rhel_60382
Include exposed ports in inspect output when net=host
2024-09-27 22:32:08 +00:00
Matt Heon a619c03eff Include exposed ports in inspect output when net=host
Previously, we didn't bother including exposed ports in the
container config when creating a container with --net=host. Per
Docker this isn't really correct; host-net containers are still
considered to have exposed ports, even though that specific
container can be guaranteed to never use them.

We could just fix this for host container, but we might as well
make it generic. This patch unconditionally adds exposed ports to
the container config - it was previously conditional on a network
namespace being configured. The behavior of `podman inspect` with
exposed ports when using `--net=container:` has also been
corrected. Previously, we used exposed ports from the container
sharing its network namespace, which was not correct. Now, we use
regular port bindings from the namespace container, but exposed
ports from our own container.

Fixes https://issues.redhat.com/browse/RHEL-60382

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-09-27 12:54:24 -04:00
fixomatic-ctrl 1dd90dbe20
feat(libpod): support kube play tar content-type (#24015)
feat(libpod): support kube play tar content-type

Signed-off-by: fixomatic-ctrl <180758136+fixomatic-ctrl@users.noreply.github.com>
2024-09-27 15:40:55 +02:00
openshift-merge-bot[bot] 514d25d53b
Merge pull request #24068 from edsantiago/cors-fixes
CORS system test: clean up
2024-09-27 13:19:28 +00:00
openshift-merge-bot[bot] 87dcf9d9d2
Merge pull request #24062 from ygalblum/quadlet-restore-dir-order
Quadlet - make sure the order of the UnitsDir is deterministic
2024-09-27 12:02:24 +00:00
openshift-merge-bot[bot] 08cbd38994
Merge pull request #24073 from edsantiago/oh-i-give-up
System tests: set a default XDG_RUNTIME_DIR
2024-09-26 18:45:39 +00:00
Ygal Blum ebbec00b0d Quadlet - make sure the order of the UnitsDir is deterministic
Change getUnitDirs to maintain a slice in addition to the map and return the slice
Add helper functions to make the code more readable
Adjust unit tests
Restore system test

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-09-26 10:57:47 -04:00
openshift-merge-bot[bot] 4e38381d37
Merge pull request #23900 from Honny1/healthcheck-log
HealthCheck log output options
2024-09-26 11:55:55 +00:00
Ed Santiago 70c131ed68 System tests: set a default XDG_RUNTIME_DIR
Yield to reality: if $XDG_RUNTIME_DIR is unset, assume a
reasonable default (rootless only). This clears up a
common failure in Fedora gating tests, and will probably
prevent future time wasters.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-25 12:45:17 -06:00
Ed Santiago 73cbc13190 CORS system test: clean up
Primary motivator: 'curl -v' format changes in f42

Drive-bys:
 * 127.0.0.1, not localhost
 * use wait_for_port, not sleep
 * show curl commands and their output, to ease debugging failures
 * better failure assertions

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-25 07:46:07 -06:00
Jan Rodák de856dab99
Add --health-max-log-count, --health-max-log-size, --health-log-destination flags
These flags can affect the output of the HealtCheck log. Currently, when a container is configured with HealthCheck, the output from the HealthCheck command is only logged to the container status file, which is accessible via `podman inspect`.
It is also limited to the last five executions and the first 500 characters per execution.

This makes debugging past problems very difficult, since the only information available about the failure of the HealthCheck command is the generic `healthcheck service failed` record.

- The `--health-log-destination` flag sets the destination of the HealthCheck log.
  - `none`: (default behavior) `HealthCheckResults` are stored in overlay containers. (For example: `$runroot/healthcheck.log`)
  - `directory`: creates a log file named `<container-ID>-healthcheck.log` with JSON `HealthCheckResults` in the specified directory.
  - `events_logger`: The log will be written with logging mechanism set by events_loggeri. It also saves the log to a default directory, for performance on a system with a large number of logs.

- The `--health-max-log-count` flag sets the maximum number of attempts in the HealthCheck log file.
  - A value of `0` indicates an infinite number of attempts in the log file.
  - The default value is `5` attempts in the log file.
- The `--health-max-log-size` flag sets the maximum length of the log stored.
  - A value of `0` indicates an infinite log length.
  - The default value is `500` log characters.

Add --health-max-log-count flag

Signed-off-by: Jan Rodák <hony.com@seznam.cz>

Add --health-max-log-size flag

Signed-off-by: Jan Rodák <hony.com@seznam.cz>

Add --health-log-destination flag

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-09-25 14:01:35 +02:00
David Gibson 1f2658e0ef test/system: For pasta port forwarding tests don't bind socat server
The various pasta port forwarding tests run a socat server inside a
container, then connect to it from a socat client on the host.  Currently
we have the server bind to the same specific address within the container
as we connect to on the host.

That's not quite what we want.  For "tap" tests where the traffic goes over
pasta's L2 link to the container it's fine, though unnecessary.  For
"loopback" tests where traffic is forwarded by pasta at the L4 socket
level, however, it's not quite right.  In this case the address used is
either 127.0.0.1 or ::.  That's correct and as needed for the host side
address we're connecting to.  However on the container side, this only
works because of an odd and arguably undesirable behaviour of pasta: we use
the fact that we have an L4 socket within the container to make such
"spliced" L4 connections appear as if they come from loopback within the
container.  A container will generally expect it's loopback address to be
only accessible from within the container, and this odd behaviour may be
changed in pasta in future.

In any case, the binding of the container side server is unnecessary, so
simply remove it.

Link: https://github.com/containers/podman/issues/24045

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-25 14:47:46 +10:00
openshift-merge-bot[bot] 66139fc266
Merge pull request #24056 from edsantiago/skip-quadlet-flake
CI: skip the flaking quadlet test (temporary)
2024-09-24 14:31:15 +00:00
Ed Santiago fd4c63838b CI: skip the flaking quadlet test
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-24 07:18:50 -06:00
Ed Santiago faf4604883 CI: make systemd tests parallel-safe (*)
Mostly just switch to safename. Rewrite setup() to guarantee
unique service file names, atomically created.

* IMPORTANT NOTE: enabling parallelization on these tests
  triggers #24010 ("fragment file" flake), but only on my
  f40 laptop. I have never seen the flake in Cirrus despite
  many many runs in #23275. I am submitting this for review
  and merging because even though _something_ is broken,
  this breakage is unlikely to affect our CI.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-24 06:13:50 -06:00
Ed Santiago 4be6bf2270 CI: parallelize logs test as much as possible
Any test that uses --events-backend=file cannot be run in parallel
due to #23750. This seems to be a hard block, unfixable.

All other tests, enable ci:parallel.

And, bring in timing fixes #23600. Thanks, @Honny1!

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-23 13:46:00 -06:00
openshift-merge-bot[bot] edcee32116
Merge pull request #24041 from edsantiago/610-search-local
CI: format test: use local registry if available
2024-09-23 17:33:38 +00:00
openshift-merge-bot[bot] b98fffd36a
Merge pull request #23998 from edsantiago/safename-700
CI: make 700-play parallel-safe
2024-09-23 17:22:48 +00:00
openshift-merge-bot[bot] 3fb9619298
Merge pull request #23336 from dgibson/pasta-dns
Fix several reliability problems with pasta DNS handling tests
2024-09-23 16:02:53 +00:00
Ed Santiago 600634c62c CI: format test: use local registry if available
The format test flakes when quay is down, because we've
been doing 'podman search $IMAGE', which is a quay image.

Solution: check if local registry is running, and use it.
We don't need a real image.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-23 07:48:35 -06:00
Ed Santiago d92f2d39ee CI: make 700-play parallel-safe
(where possible. Not all tests are parallelizable).

And, refactor two complicated tests into one. This one
is hard to review, sorry.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-23 05:27:45 -06:00
openshift-merge-bot[bot] 7aedb541d5
Merge pull request #24018 from ygalblum/allow-symlinks
Quadlet - add full support for Symlinks
2024-09-23 06:49:12 +00:00
Ygal Blum 133ea31ffb Quadlet - add full support for Symlinks
Use os.ReadDir recursively instead of filepath.WalkDir
Use map instead of list to easily find looped Symlinks
Update existing tests and add a more elaborate one
Update the man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-09-20 11:11:03 -04:00
Paul Holzinger 792796183f
libpod: setupNetNS() correctly mount netns
The netns dir has a special logic to bind mout itself and make itslef
shared. This code here didn't which lead to catastrophic bug during
netns unmounting as we were unable to unmount the netns as the mount got
duplicated and had the wrong parent mount. This caused us to loop forever
trying to remove the file.

Fixes https://issues.redhat.com/browse/RHEL-59620
Fixes #23685

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-20 15:19:22 +02:00
Ed Santiago a08ae98161 CI: Quadlet rootfs test: use container image as rootfs
Test was written to use / (root). This is not parallel-safe.

Fixes: #23909

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-19 15:19:14 -06:00
openshift-merge-bot[bot] 217ecac740
Merge pull request #23996 from edsantiago/safename-200
CI: make 200-pod parallel-safe
2024-09-19 14:27:38 +00:00
openshift-merge-bot[bot] 80776fa5bb
Merge pull request #24007 from edsantiago/systest-cleanup
CI: system tests: various small cleanups
2024-09-19 14:05:36 +00:00
Ed Santiago 9c51eead06 CI: system test registry: use --net=host
This removes the need for a tricky/fragile namespace workaround.

Huge thanks to Paul for discovering documentation on the
Registry container, and how to override config.yml settings:

   https://distribution.github.io/distribution/about/configuration/#override-specific-configuration-options

Drive-by: consistentize quotes in -eVAR="value". Minor, but
makes them all easier to read with emacs/vi syntax highlighting.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-19 05:17:15 -06:00
Ed Santiago e3af5a38d3 CI: rm system test: bump grace period
The "rm on stopping containers" test is flaking under high load,
probably because I bumped up two timeouts in the healthcheck
container that it relies on. Bump up this test's timeout as well.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-18 11:35:00 -06:00
Ed Santiago 3396dabdf3 CI: system tests: minor documentation on parallel
Only in 000-TEMPLATE. I know I need to write more thorough
documentation. I choose to defer that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-18 11:32:36 -06:00
Ed Santiago 1d5c8ac18e CI: system tests: always create pause image
...not just when running parallel Bats, because Bats
does not provide any way to know if we're parallel.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-18 11:23:12 -06:00
Ed Santiago 5e5c68ffbe CI: quadlet system test: be more forgiving
...of high system load (such as when running parallel tests).
Allow time for services to reach desired state, by retrying
a few times in a loop.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-18 11:22:48 -06:00
openshift-merge-bot[bot] 04d193daa9
Merge pull request #23987 from edsantiago/safename-090
CI: make 090-events parallel-safe
2024-09-18 16:06:31 +00:00
openshift-merge-bot[bot] bef0aabbdd
Merge pull request #23995 from Luap99/netns-leak
CI: netns leak checks for system and e2e
2024-09-18 15:49:59 +00:00
openshift-merge-bot[bot] 7fee222d52
Merge pull request #23997 from Luap99/expose-sctp
allow exposed sctp ports
2024-09-18 15:08:45 +00:00
openshift-merge-bot[bot] f580ae0d19
Merge pull request #23985 from Luap99/wait-hang
wait: fix handling of multiple conditions with exited
2024-09-18 12:26:28 +00:00
Ed Santiago 6fe832d5d6 CI: make 200-pod parallel-safe
...as much as possible. Not all tests can be parallelized.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-18 06:25:18 -06:00
Paul Holzinger d7335855d7
allow exposed sctp ports
There is no reason to disallow exposed sctp ports at all. As root we can
publish them find and as rootless it should error later anyway.

And for the case mentioned in the issue it doesn't make sense as the
port is not even published thus it is just part of the metadata which is
totally in all cases.

Fixes #23911

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-18 14:24:45 +02:00
Paul Holzinger 755a06aa44
test/e2e: add netns leak check
Like we do in system tests now check for netns leaks in e2e as well. Now
because things run in parallel and this dir is shared we cannot test
after each test only once per suite. This will be a PITA to debug if
leaks happen as the netns files do not contain the container ID and are
just random bytes (maybe we should change this?)

Fixes #23715

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-18 14:05:26 +02:00
Paul Holzinger 2d469e517d
test/system: netns leak check for rootless as well
This fixes the problem where even as root we check the netns files from
root. But in order to catch any rootless bugs we must check the rootless
files from $XDG_RUNTIME_DIR/netns.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-18 12:07:11 +02:00
David Gibson 2505381551 test/system: Improve TODO comments on IPv6 pasta custom DNS forward test
This test is currently disabled due to several issues, only some of which
are described in the existing comments.  Add some more details to clarify
the situation.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-18 11:19:47 +10:00
David Gibson 4919440428 test/system: Clarify "Local forwarder" pasta tests
This name for the tests is misleading, since in the default configuration
podman will already configure a forwarding addres, which could forward
to either another local forwarder or an external nameserver on the host
side.  What this test is really about is explicitly configuring the pasta
DNS forwarding address.  Rename accordingly.

The IPv4 version of the test doesn't use the podman --dns option, only
the pasta --dns-forward option.  This exercises the podman behaviour that
pasta --dns-forward options are added to /etc/resolv.conf automatically.
However there could also be other things in /etc/resolv.conf, so the
nslookup might not use the custom forwarding address for the lookup.

To fix that, split the test into two parts: one verifying that the custom
address is in /etc/resolv.conf and another performing the nslookup with an
explicit server address to make sure we exercise the pasta side as well.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-18 10:59:43 +10:00
David Gibson 63e286ac55 test/system: Simplify testing for nameserver connectivity
In both the "Basic nameserver lookup" and "Local forwarder, IPv4" pasta
tests, we check whether DNS resolution is working by running "nslookup
127.0.0.1" in the container and checking if 1.0.0.127.in-addr.arpa is in
the output.

1.0.0.127.in-addr.arpa isn't the expected result of the resolution though,
it's just the DNS name that nslookup will tranlated 127.0.0.1 into.  The
test mostly works, because nslookup echoes that on successful lookups.
However, it could also echo it in certain sorts of failure, so it's not a
very reliable test.

Furthermore, resolving 127.0.0.1 from a nameserver is a rather strange
thing to do.  It's done that way because RFC1912[0] suggests it should
always resolve, even for nameservers on a disconnected network.  But, this
doesn't really appear to be true in practice: a number of resolvers return
NXDOMAIN.  That works by accident because nslookup seems to echo the
name above as part of the error message.

Change to instead looking up one of the root servers by name.  This does
now rely on access to the global DNS during tests, but other podman tests
attempt to resolve google.com, so that should be ok.  One of the root
servers is about as close to universal resolvability as it's possible to
get

[0] https://datatracker.ietf.org/doc/html/rfc1912#section-4.1

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-18 10:59:43 +10:00
David Gibson 6c79fe292b test/system: Consolidate "External resolver" pasta tests
The idea behind the "External resolver" tests is simply to check that we
can contact a nameserver, regardless of this configuration.  To this end
the "IPv4" version looks up 127.0.0.1 which RFC1912[0] suggests should
always be resolvable.

The IPv6 version instead looks up [::1].  While it makes sense for
that to be resolvable in a similar way, there appear to be quite a few
nameservers which do not resolve it, making this test flaky.
Furthermore the idea behind resolving [::1] is that it should make
nslookup prefer to resolve over IPv6.  That appears to be very
unreliable at best.  Since making a different query doesn't actually
exercise anything different in pasta, drop the test.

The remaining IPv4 test isn't really specific to an "external" resolver,
it's simply checking that we can contact some sort of resolver with the
default podman configuration.  Rename accordingly, and run it regardless of
IPv4 connectivity on the host: we can still query a nameserver about an
IPv4 address, even if we only have IPv6 connectivity ourselves.

[0] https://datatracker.ietf.org/doc/html/rfc1912#section-4.1

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-18 10:59:43 +10:00
David Gibson 85045406b5 test/system: Move test for default forwarder into its own case
The "Local forwarder, IPv4" pasta test, amongst other things, checks that
podman's default DNS forwarding address - 169.254.0.1 - appears in the
container's /etc/resolv.conf.  That's not really related to anything else
going on in that test (which is about _changing_ that default address).

So, move it into its own test case.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-09-18 10:59:43 +10:00
Ed Santiago 5468718f22 CI: make 090-events parallel-safe
...or at least as much as possible. Some tests cannot
be run in parallel due to #23750: "--events-backend=file"
does not actually work the way a naïve user would intuit.
Stop/die events are asynchronous, and can be gathered
by *ANY OTHER* podman process running after it, and if
that process has the default events-backend=journal,
that's where the event will be logged. See #23987 for
further discussion.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 18:21:58 -06:00
openshift-merge-bot[bot] 1e9464c9b4
Merge pull request #23937 from edsantiago/test-crun-17
New VMs: test crun 1.17
2024-09-17 20:28:43 +00:00
openshift-merge-bot[bot] 4dfff40840
Merge pull request #23989 from edsantiago/enable-bats-parallel
CI: system tests: enable parallel tests
2024-09-17 19:30:57 +00:00
openshift-merge-bot[bot] 75369fd283
Merge pull request #23986 from mheon/fix_23981
Match output of Compat Top API to Docker
2024-09-17 19:06:13 +00:00
Ed Santiago 8402b6535f Misc minor test fixes
...for dealing with flakes in parallel mode

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago 7fcf94d7b5 Add network namespace leak check
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago b3da5be2b1 Add workaround for buildah parallel bug
Need --layers=false in podman build, otherwise a buildah race
can trigger "layer not known" failures:

   https://github.com/containers/buildah/issues/5674

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago 5fc3de5583 registry: lock start attempts
When running parallel, multiple tests could be trying to start
the registry at once. Make this parallel-safe.

Also, use a safer port range for the registry. Something
outside of /proc/sys/net/ipv4/ip_local_port_range

Sorry, I'm including a FIXME section that I haven't investigated
deeply enough.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago bf6131780a Update system test template and README
Add a few best-practices examples, and add a whole section
describing the dos and donts of writing parallel-safe tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago 6502e30cfd bats log: differentiate parallel tests from sequential
For tests run in parallel, show file number as |nnn| (vs [nnn])

Teach logformatter to distinguish the two, adding 'p' to anchors
in parallel tests. Necessary because in this scheme we run bats
twice, thus see 'ok 1' twice, and we want to differentiate them.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:37 -06:00
Ed Santiago bcffa9ce30 clean_setup: create pause image
Workaround for #23292, where simultaneous 'pod create' commands
will all start a podman-build of the pause image, but only
one of them will be tagged, and the others will leak <none>
images.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 11:19:36 -06:00
Ed Santiago 812c7e9436 CI: make 012-manifest parallel-safe
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 10:35:01 -06:00
Paul Holzinger aa108924ea
test/system: remove wait workaround
The issue is closed and I recently fixed a number of races (bf74797c69)
in the remote attach API that sound like exactly like the same error
that was mentioned in issue #9597.

As such I think this works, if it start flaking again we can revert this
or better fix the actual bug.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-17 17:35:18 +02:00
Paul Holzinger fbed3a01d2
wait: fix handling of multiple conditions with exited
As it turns on things are not so simple after all...
In podman-py it was reported[1] that waiting might hang, per our docs wait
on multiple conditions should exit once the first one is hit and not all
of them. However because the new wait logic never checked if the context
was cancelled the goroutine kept running until conmon exited and because
we used a waitgroup to wait for all of them to finish it blocked until
that happened.

First we can remove the waitgroup as we only need to wait for one of
them anyway via the channel. While this alone fixes the hang it would
still leak the other goroutine. As there is no way to cancel a goroutine
all the code must check for a cancelled context in the wait loop to no
leak.

Fixes 8a943311db ("libpod: simplify WaitForExit()")
[1] https://github.com/containers/podman-py/issues/425

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-17 17:35:17 +02:00
Matt Heon e04668c8ca Match output of Compat Top API to Docker
We were only splitting on tabs, not spaces, so we returned just a
single line most of the time, not an array of the fields in the
output of `ps`. Unfortunately, some of these fields are allowed
to contain spaces themselves, which makes things complicated, but
we got lucky in that Docker took the simplest possible solution
and just assumed that only one field would contain spaces and it
would always be the last one, which is easy enough to duplicate
on our end.

Fixes #23981

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-09-17 11:34:22 -04:00
Ed Santiago d571ca6536 system test parallelization: enable two-pass approach
For the past two months we've been splitting system tests
into two categories: those that CAN be run in parallel,
and those that CANNOT. Much work has been done to replace
hardcoded names (mycontainer, mypod) with safename().
Hundreds of test runs, in CI and on Ed's laptop, have
proven this approach viable.

make {local,remote}system now runs in two steps: first
the serial ones, then the parallel ones. hack/bats will
now recognize the 'ci:parallel' tag and add --jobs (nprocs).

This requires some tweaking of leak_check, because there
can be umpteen tests running (affecting image/container/pod/etc
state) when any given test completes.

Rules for enabling parallelization in tests:

   * use unique container/pod/volume/network names (safename)
   * do not run 'podman rm -a' or 'rmi -a'
   * never use the -l (--latest) option
   * do not run 'podman ps/images' and expect precise output

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 09:25:02 -06:00
openshift-merge-bot[bot] f4a08f46b7
Merge pull request #23959 from auyer/hide-secrets-from-container-inspect
Hide secrets from container inspect command
2024-09-17 13:00:18 +00:00
Ed Santiago 8d119f0c2d New VMs: test crun 1.17
...and remove one old skip() for older debian, but leave
two others in place and mark that they're still a problem.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 06:51:36 -06:00
openshift-merge-bot[bot] 214e64e287
Merge pull request #23979 from edsantiago/workaround-remote-events-flake
CI: e2e: workaround for events out-of-sequence flake
2024-09-17 12:49:19 +00:00
openshift-merge-bot[bot] a4794bc9c6
Merge pull request #23977 from giuseppe/fix-permissions-copyup-volume-userns
libpod: convert owner IDs only with :idmap
2024-09-17 12:46:32 +00:00
Rafael Passos a5e9b4d126 libpod: hides env secrets from container inspect
Replaces env values supplied from podman secrets,
returns ******* instead

Fixes: #23788

Signed-off-by: Rafael Passos <rafael@rcpassos.me>
2024-09-17 09:12:39 -03:00
Ed Santiago 111a4bbe71 CI: e2e: workaround for events out-of-sequence flake
podman-remote events are not flushed, so order is not guaranteed.
This results in CI flakes. Only on Debian, for reasons unknown.

Make the network-connection events test more lenient when remote.

Closes: #23634 (but does not actually fix it)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-17 06:12:26 -06:00
Giuseppe Scrivano 432325236b
libpod: convert owner IDs only with :idmap
convert the owner UID and GID into the user namespace only when
":idmap" mount is used.

This changes the behaviour of :idmap with an empty volume.  Now the
existing directory ownership is copied up as in the other case.

Closes: https://github.com/containers/podman/issues/23347

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-09-17 12:38:53 +02:00
renovate[bot] 1a1001d824
fix(deps): update module github.com/cpuguy83/go-md2man/v2 to v2.0.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 18:26:51 +00:00
openshift-merge-bot[bot] e315697ed3
Merge pull request #23966 from containers/renovate/setuptools-75.x
chore(deps): update dependency setuptools to ~=75.1.0
2024-09-16 17:12:23 +00:00
renovate[bot] c436a9b658
chore(deps): update dependency setuptools to ~=75.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 13:17:21 +00:00
Ed Santiago c6616004f1 CI: make 260-sdnotify parallel-safe
Use safename. Add ci:parallel tags. Do not remove pause image
nor kube network.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-16 05:04:24 -06:00
renovate[bot] 95833a6207
chore(deps): update dependency setuptools to v75
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-15 16:55:11 +00:00
openshift-merge-bot[bot] d4cda112f1
Merge pull request #23921 from edsantiago/safename-710
CI: make 710-kube parallel-safe
2024-09-13 12:41:54 +00:00
openshift-merge-bot[bot] 421a80bcb7
Merge pull request #23908 from edsantiago/safename-505
CI: make 505-pasta parallel safe
2024-09-13 12:39:11 +00:00
openshift-merge-bot[bot] 29f75000dd
Merge pull request #23916 from edsantiago/safename-320
CI: mark 320-system-df *NOT* parallel safe
2024-09-13 12:33:41 +00:00
openshift-merge-bot[bot] 7764bea981
Merge pull request #23819 from l0rd/kube-play-image-type-volumes
Add `kube play` support for volumes of type image
2024-09-11 18:32:24 +00:00
openshift-merge-bot[bot] c66d46c39a
Merge pull request #23899 from edsantiago/new-vms
Bump VMs. ShellCheck is now built-in
2024-09-11 13:46:14 +00:00
Ed Santiago e61682f50e CI: make 710-kube parallel-safe
Use safename. Add ci:parallel tags. Use a random port, not
hardcoded 9999. Do not remove pause image. And especially
do not "rm -a" anything.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-10 14:49:14 -06:00
openshift-merge-bot[bot] c38c197c71
Merge pull request #23907 from edsantiago/safename-020
CI: make 020-tag parallel-safe
2024-09-10 19:09:45 +00:00
Ed Santiago 0ff89a00af CI: mark 320-system-df *NOT* parallel safe
...because it requires 100% control and knowledge of the
state of all images, containers, and volumes.

Use safename anyway, just in case we ever have a leak from here.
I'm finding safename sooooooo helpful when reading journal.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-10 08:48:44 -06:00
Mario Loriedo db12343e27 Add kube play support for image volume source
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-09-10 12:37:06 +00:00
openshift-merge-bot[bot] ff0f6eb8c6
Merge pull request #23906 from edsantiago/safename-410
CI: make 410-selinux parallel-safe
2024-09-10 10:39:45 +00:00
renovate[bot] a83fef34a9
fix(deps): update module golang.org/x/tools to v0.25.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-09 21:51:16 +00:00
Ed Santiago 22ec8ea06d CI: make 505-pasta parallel safe
Add ci:parallel tags; move one non-parallel-safe test to
another networking-test file; and a few drive-by fixes

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-09 14:02:48 -06:00
Ed Santiago 18932e0339 CI: make 020-tag parallel-safe
Use safename, with guaranteed-adjacent image names

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-09 13:37:57 -06:00
Ed Santiago a165289574 CI: make 410-selinux parallel-safe
Use safename for containers and pods. Add ci:parallel tags.
And reenable distro-integration tests that had been skipped
due to a container-selinux bug that is now fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-09 13:09:37 -06:00
openshift-merge-bot[bot] 649730c9a1
Merge pull request #23887 from Luap99/sort-tags
podman images: sort repository with tags
2024-09-09 16:39:15 +00:00
Ed Santiago 359092e463 Bump VMs. ShellCheck is now built-in
Minor bump. Fedora VMs now include ShellCheck, so we can
remove the 'dnf install' at CI run time.

Also, FWIW, Debian *vark are now at 1.12 (from 1.9)

VMs built in https://github.com/containers/automation_images/pull/385

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-09-09 06:16:20 -06:00