Commit Graph

3719 Commits

Author SHA1 Message Date
Ben Krieger 6c68f4ad97 Use HTTP path prefix of TCP connections to match Docker context behavior
Signed-off-by: Ben Krieger <ben.krieger@intel.com>
2024-08-22 21:22:26 -04:00
openshift-merge-bot[bot] e7905122d7
Merge pull request #23679 from ruihe774/pod-userns
quadlet: support user mapping in pod unit
2024-08-22 12:33:43 +00:00
Ed Santiago 4dc5708f14 Revert "test/e2e: work around for pasta issue"
This reverts commit 1912dd4bf6.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-22 04:55:43 -06:00
Misaki Kasumi 4fbfa7de6e quadlet: support user mapping in pod unit
Signed-off-by: Misaki Kasumi <misakikasumi@outlook.com>
2024-08-22 09:41:06 +08:00
openshift-merge-bot[bot] 8be89caf46
Merge pull request #23675 from ruihe774/fix-pod-cgroups
Add key CgroupsMode in Quadlet container unit
2024-08-20 18:47:16 +00:00
Misaki Kasumi 1ccccde183 quadlet: add key CgroupsMode
Signed-off-by: Misaki Kasumi <misakikasumi@outlook.com>
2024-08-20 22:09:36 +08:00
Misaki Kasumi e5c91ff03a quadlet: set infra name to %s-infra
e.g.: if the pod name is systemd-awd, the name of its infra container will be systemd-awd-infra

Signed-off-by: Misaki Kasumi <misakikasumi@outlook.com>
2024-08-20 18:20:02 +08:00
openshift-merge-bot[bot] 8068bb2fc8
Merge pull request #23650 from Luap99/e2e-systemd-rm
test/e2e: rm systemd start test
2024-08-19 13:21:26 +00:00
Paul Holzinger 666d839157
golangci-lint: make windows linting happy
It qemu cannot be compiled anyway so make sure we do not try to compile
parts where the typechecker complains about on windows.
Also all the e2e test files are only used on linux as well.
pkg/machine/wsl also reports some error but to many for me to fix them
now. One minor problem was fixed in pkg/machine/machine_windows.go.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:29 +02:00
Paul Holzinger cd2a4c7cac
test/e2e: remove kernel version check
We need something newer than 4.14 anyway now for most Podman functions.
This is breaking liniting on windows as the function doesn't work there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:29 +02:00
Paul Holzinger 6c0d94328f
golangci-lint: remove most skip dirs
Now that we have propert !remote tags set everywhere we can just rely on
that and do not need to skip any dirs.
Also on linux do not lint three times, one remote run is enough.
We still have to skip the test dir for windows/macos though or we need
to add linux build tags there everywhere as well. This seems simpler.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:28 +02:00
Paul Holzinger 57016f5cc3
test/e2e: rm systemd start test
We have a lot of systemd and quadlet based tests in the system tests.
This test doesn't seem very useful and it seems to flake so just remove
it.

Fixes #23480

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-16 17:33:30 +02:00
openshift-merge-bot[bot] 734c4b98d4
Merge pull request #23519 from Luap99/netns-cleanup
update c/common to add some netns cleanup fixes
2024-08-15 12:39:22 +00:00
openshift-merge-bot[bot] 708d6c5e2b
Merge pull request #23449 from ygalblum/quadlet-override-service-name
Quadlet override service name
2024-08-12 13:56:48 +00:00
Paul Holzinger 20a32d33cd
test/e2e: work around new push warning
c/image now throws a warning when using encryption and zstd:chunked as
they do not work together[1]. As CI uses default configs from fedora it
means rawhide now defaults to zstd:chunked which trigger the warning
there. To work around that force zstd compression.

[1] https://github.com/containers/image/issues/2485

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-12 12:15:52 +02:00
Paul Holzinger 78cb1e28cb
libpod: do not save expected stop errors in ctr state
If we try to stop a contianer that is not running or paused we get an
ErrCtrStateInvalid or ErrCtrStopped error. As podman stop is idempotent
this is not a user visable error at all so we should also never log it
in the container state.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-12 12:09:01 +02:00
openshift-merge-bot[bot] c053194921
Merge pull request #23533 from edsantiago/fix-containerport-flake
CI: e2e: serialize root containerPort tests
2024-08-08 09:57:57 +00:00
Paul Holzinger 4620e91f86
podman container cleanup: ignore common errors
The podman container cleanup command is not really intended for human
use. Instead each conmon will spawn this command after the container
exit to make sure we can cleanup resources asynchronously. However this
command will always race against other foreground process such as podman
rm -fa. Therefore it is possible that the ctr was already removed and we
should not log errors in this case.

While these errors are normally not seen as the command is int he
background you can see it if you enable syslog logging and then they
just spam the log with useless errors so just ignore them.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-07 17:00:47 +02:00
Ygal Blum 795851edd3 Quadlet - Allow the user to override the default service name
Add support for the ServiceName key for all unit types
Extend the PodInfo struct into UnitInfo to consolidate all prepopulated data into a single map
Use the NodesInfo map instead of the resourceName
Update the UnitInfo in the convert function instead of returning it
No need to replace extension anymore just remove it
All e2e tests with dependencies on other Quadlet files moved to a separate section
Add the capability of overriding the service name in the test
Add e2e tests for the new functionality
Adjust integration tests
Update the MAN page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-08-07 17:50:49 +03:00
Ed Santiago 1a2e1eb46e CI: e2e: serialize root containerPort tests
Two tests, both check port 80 on host, one wants it live,
the other wants it blocked. Prevent them from running
concurrently.

Fixes: #23470

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-07 05:34:12 -06:00
Paul Holzinger 1912dd4bf6
test/e2e: work around for pasta issue
Use network slirp4netns for the registry container to work around a
pasta regression (#23517). This should be revert once it is fixed in
pasta and included in our CI images.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-06 13:16:34 +02:00
Paul Holzinger 71bcd25ab6
test/e2e: fix missing exit code checks
Both push commands didn't check the exit code so make sure they actually
work.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-06 13:16:34 +02:00
openshift-merge-bot[bot] 803ef5c16f
Merge pull request #23384 from edsantiago/root-namespace
CI: enable root user namespaces
2024-08-01 10:32:16 +00:00
Ygal Blum 7d9c1a2c53 Quadlet test - Split between success, warning and error cases
Split the table to three based on the expected outcome
Use helper functions to reduce the amount of parameter required in each entry
Remove the service name override code

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-07-30 16:33:14 +03:00
openshift-merge-bot[bot] 95c78b2716
Merge pull request #23444 from rhatdan/quadlet
Use new syntax for selinux options in quadlet
2024-07-30 13:16:28 +00:00
Daniel J Walsh 1c46686a41
Use new syntax for selinux options in quadlet
Fixes: https://github.com/containers/podman/issues/23432

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-30 06:15:45 -04:00
Ygal Blum f3a86266e6 Quadlet - Allow the user to set the service name for .pod files
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-07-29 16:11:19 +03:00
Ygal Blum 1c4fbe7965 Quadlet tests - allow overriding the expected service name
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-07-29 16:11:19 +03:00
Ed Santiago 7bb3b83c17
CI: enable root user namespaces
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-27 23:23:29 +02:00
openshift-merge-bot[bot] 85358aed81
Merge pull request #23379 from mtrmac/chunked-tests
Prepare tests for better reuse with zstd:chunked pulls
2024-07-24 19:53:52 +00:00
Giuseppe Scrivano fef125c7b1
test: disable artifacts cache with composefs
layers restored from a tarball won't be converted to composefs so
disable the cache when using composefs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-24 17:16:35 +02:00
Giuseppe Scrivano 8403f4c33f
test: fix podman pull tests
the condition is based on the fact that podman save|podman load
doesn't recreate the same digest, thus it would fail if the image in
the additional store was pulled with a simple "podman pull".

The same sequence of commands would fail using podman manually after a
"podman pull alpine".

Ignore the cache and use only the images that were pulled in the main
store.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-24 17:16:35 +02:00
Miloslav Trmač 84eb640160 Update encryption tests to avoid a warning if zstd:chunked is the default
It is not the default _yet_, but we are testing such setups.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-07-23 21:30:19 +02:00
Miloslav Trmač 059c298389 Fix "podman pull and decrypt"/"from local registry"
Actually test decryption, instead of handling of TLS failures.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-07-23 21:30:14 +02:00
Miloslav Trmač 6c55ef505d Use unique image names for the encrypted test images
"/my-alpine" is also being used by tests in search_test.go;
use unique names to make sure we are trying to pull the encrypted
images created in the test.

Purely to avoid doubt, this should not actually change (test) behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-07-23 21:26:11 +02:00
openshift-merge-bot[bot] 34e8c1e762
Merge pull request #23354 from rhatdan/quadlet
Add support for StopSignal in quadlet .container files
2024-07-22 15:20:11 +00:00
openshift-merge-bot[bot] 0551b0fb7e
Merge pull request #23339 from Luap99/nc-e2e-flake
test/e2e: fix ncat tests
2024-07-22 12:21:37 +00:00
Paul Holzinger 5209495865
test/e2e: fix ncat tests
These tests are flaking for unknown reasons. One problem could be ncat
did not bound the port before we connect to it. Simple fix do not use
ncat and just use the golang API to listen on the port without the
extra ncat process. This should be race free in theory.
Also do not run the nc container in the background, we want to see the
errors from the ncat process in the container.

And because both tests do the same thing deduplicate them into one that
just uses a loop to create both tests.

Fixes #23263

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-22 13:42:40 +02:00
Daniel J Walsh 0ecd6fa59f
Add support for StopSignal in quadlet .container files
Fixes: https://github.com/containers/podman/issues/23050

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-22 06:43:45 -04:00
Paul Holzinger 5e8884ab0d
libpod: correctly capture healthcheck output
Using the scanner is just unnecessary complicated an buggy as it will
not read the final line with a newline. There is also the problem that
it happens in a separate goroutine so it could loose output if we read
the array before the scanner was done.

The API accepts a Writer so we can just directly use a bytes.Buffer
which captures all output in memory without the need of another
goroutine.

This also means that now we always include the final newline in the
output. I checked with docker and they do the same so this is good.

Fixes #23332

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-19 15:16:55 +02:00
openshift-merge-bot[bot] 88c68a4b58
Merge pull request #23271 from giuseppe/drop-unmount-for-overlay-storage
test: podman system service doesn't leak mount on termination
2024-07-15 12:20:11 +00:00
Giuseppe Scrivano b08b630c84
test: drop unmount for overlay
The unmount for the driver home dir is done automatically by the store
on Shutdown.  Do not do the unmount from the tests cleanup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano e16e528f39
test: gracefully terminate server
send a SIGTERM to the server process instead of killing it so it has
time to do a proper cleanup and don't leak the home mount.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Félix Saparelli 54fce37968
Add NetworkAlias= support to quadlet
Adds a `NetworkAlias=` key to both .container and .pod quadlet files,
which translates to the `--network-alias` option to `podman run` and
`podman pod create` respectively. Can be repeated multiple times.

Signed-off-by: Félix Saparelli <felix@passcod.name>
2024-07-15 16:39:25 +12:00
openshift-merge-bot[bot] 360c4f372d
Merge pull request #23234 from Luap99/test-nftables
test netavark nftables driver
2024-07-11 22:19:32 +00:00
Paul Holzinger c4b2015e3a
test/e2e: rework some --expose tests
Stop using iptables to check anything, it does not work rootless and
will no longer work with nftables which will be used in the future.

Also fix up the test that say podman run to actually use podman run and
then just check via inspect that the ports are set correctly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:08:28 +02:00
Paul Holzinger 9945981afb
test: remove publish tests from e2e
This test checks a simple publish which is already covered in many other
places, it also used iptables wich is a invalid assumption going forward
as we start to enable nftables as firewall driver.

The only thing these tests added where checking that we cannot resuse
the same port. Given there was more than one kernel regression[1,2]
about correctly failing with EADDRINUSE I also added the
distro-integration tag to make sure we catch this early in fedora
testing.

[1] https://lore.kernel.org/regressions/e21bf153-80b0-9ec0-15ba-e04a4ad42c34@redhat.com/
[2] https://lore.kernel.org/regressions/CAFsF8vL4CGFzWMb38_XviiEgxoKX0GYup=JiUFXUOmagdk9CRg@mail.gmail.com/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:08:28 +02:00
Ed Santiago dd1bcabae9 CI: use local registry, part 2 of 3: fix tests
This commit gets tests working under the new local-registry system:

  * amend a few image names, mostly just sticking to a consistent
    list of those images in our registry cache. Mostly minor
    tag updates.

  * trickier: pull_test: change some error messages, and remove
    a test that's now a NOP. Basically, with a local (unprotected)
    registry we always get "404 manifest unknown"; with a real
    registry we'll get "403 I can't tell you".

  * trickiest: seccomp_test: build our own images at run time,
    with our desired labels. Until now we've been pulling
    prebuilt images, but those will not copy to the local
    cache registry. Something about v1? Anyhow, I gave up
    trying to cache them, and the workaround is straightforward.

Also took the liberty of strengthening a few error-message checks

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-11 04:39:45 -06:00
Ed Santiago d4c0e7ecbd CI: test composefs on rawhide
Run root e2e & system tests using composefs on rawhide.

Write magic settings to storage.conf. That part is easy.

e2e tests, however, ignore storage.conf. They require everything
to be specified on the command line. And "everything", in the
case of composefs, includes a long complicated --pull-options
string which in turn requires containers-storage PR 1966
which, as of this writing, is finally vendored into podman.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-10 14:51:58 -06:00
openshift-merge-bot[bot] b3dab682b1
Merge pull request #22972 from BlackHole1/improve-error
refactor(build): improve err when file specified by -f does not exist
2024-07-03 12:59:16 +00:00