Commit Graph

6576 Commits

Author SHA1 Message Date
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
Chris Evich a48cd241ad
Drop APIv2 CNI configuration
**Depends on PR 23538**

CNI is no longer needed/supported.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-08-09 10:20:38 -04:00
Chris Evich dcdb5408de
De-duplicate docker-py testing
Previously there were two CI tasks that ended up both testing docker-py
compatibility.  Remove the duplicate from the `localapiv2-python` make
target, and symlink the identical requirements file.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-08-09 10:13:02 -04:00
openshift-merge-bot[bot] 07d367622a
Merge pull request #23551 from Luap99/e2e-timeout
test/e2e: improve command timeout handling
2024-08-08 21:25:04 +00:00
openshift-merge-bot[bot] d13f2a5b5c
Merge pull request #23538 from cevich/apiv2_python_use_local_reg
Reduce python APIv2 test net dependency
2024-08-08 21:22:20 +00:00
Chris Evich 7936809f75
Reduce python APIv2 test net dependency
Previously these tests pulled some test images from quay, opening them up
to networking-flake induced failures.  As has already been done for
other tests, update to utilize the locally running registry server.

Also: Add `test/python/**` into the apiv2 task conditions as referenced
by the `Makefile` `localapiv2-python` target.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-08-08 10:40:22 -04:00
Paul Holzinger be2212804b
test/e2e: improve command timeout handling
Basically commit ada4e1a8c1 for e2e tests. The timeout does not kill the
process so if it is stucked it hangs forever. So make sure we kill it
via SIGABRT.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-08 16:27:23 +02:00
renovate[bot] 52ff2a41fa
Update module github.com/onsi/ginkgo/v2 to v2.20.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-08 12:10:24 +00: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
openshift-merge-bot[bot] 4e788bc611
Merge pull request #23532 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.24.0
2024-08-07 10:11:52 +00:00
Daniel J Walsh a06a7d7ba8
Should not force conversion of manifest type to DockerV2ListMediaType
Fixes: https://github.com/containers/podman/issues/23163

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-08-07 06:07:46 -04:00
openshift-merge-bot[bot] 61f7db5e7a
Merge pull request #23527 from edsantiago/safename-012
CI: manifest system tests: make parallel-safe
2024-08-07 08:25:10 +00:00
openshift-merge-bot[bot] 4109ffa649
Merge pull request #23529 from edsantiago/safename-060
CI: mount system test: make parallel-safe
2024-08-07 08:19:31 +00:00
openshift-merge-bot[bot] 9e8c4c4993
Merge pull request #23524 from mheon/fix_23515
Create volume path before state initialization
2024-08-07 08:16:54 +00:00
renovate[bot] 2038d88680
fix(deps): update module golang.org/x/tools to v0.24.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-07 03:20:04 +00:00
Ed Santiago f99c7ead92 CI: mount system test: parallelize
Use safename for containers, volumes, images.

Build a temporary scratch image for podman image mount, so
we can safely mount/umount it (instead of $IMAGE) without
risk of other parallel tests umounting it.

Fixed some oopsies ("$vol1" is empty string, so, NOP test)

And... an experiment. I'm leaving in my 'ci:parallel' tags
and notes, so I don't have to carry them in #23275. This
is harmless, basically just noisy comments. The drawback
is, if for some reason #23275 does not pan out, I'll have
to go back and remove those tags. Right now I'm feeling
pretty comfortable about this parallelization approach tho.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-06 13:28:47 -06:00
Ed Santiago f9b67cea57 CI: manifest system tests: make parallel-safe
Use safename instead of hardcoded "test"

Start registry once, in setup_file(), instead of requiring
individual tests to do so.

Add explicit --authfile arg to a bunch of places that now need it

Minor cleanup and improvements in test descriptions. I may have
gotten a little carried away here, but if this test ever fails
these additions will make someone's life much easier.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-06 13:07:10 -06:00
Matt Heon eb7ce80cf9 Create volume path before state initialization
Strictly speaking we don't need the path yet, but it existing
prevents a lot of strangeness in our path-checking logic to
validate the current Podman configuration, as it was the only
path that might not exist this early in init.

Fixes #23515

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-08-06 13:42:09 -04: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
Ed Santiago bfb42b3b15 CI: completion system test: use safename
Ongoing efforts to make system tests parallel-safe

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-05 05:09:19 -06:00
Giuseppe Scrivano 3ae1568933
libpod: fix volume copyup with idmap
if idmap is specified for a volume, reverse the mappings when copying
up from the container, so that the original permissions are maintained.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-08-01 22:49:27 +02:00
Ed Santiago 83e90a2f5b System tests: leak_test: readable output
BATS teardown logs are unreadable, making it almost impossible
to see tiny "Leaked this-or-that" messages.

Solution: new _run_podman_quiet() helper, replaces run_podman
in a small number of cases within teardown. Clunky, and
duplicative, sorry.

New helper for leak_check, basically spits out warnings (and
bumps error count) if it sees any output whatsoever from
individual "podman XXX ls" commands.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-08-01 05:39:50 -06:00
openshift-merge-bot[bot] 7c4b1f7aa7
Merge pull request #23431 from edsantiago/clean-up-stray-external
CI: kube test: fix broken external-storage test
2024-08-01 11:30:00 +00: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
Ed Santiago 84f57e4ba0 WIP: Fixes for vendoring Buildah
This commit was automatically cherry-picked
by buildah-vendor-treadmill v0.3
from the buildah vendor treadmill PR, #13808

/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> The git commit message from that PR is below. Please review it,
> edit as necessary, then remove this comment block.
\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Changes since 2024-05-21:

  * document --compat-volumes
  * Fix conflict caused by Ed's local-registry PR in buildah

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-07-30 18:26:21 -04:00
openshift-merge-bot[bot] d38268062a
Merge pull request #23442 from legobeat/compose-warning-logs-env-conf
fix: disable compose_warning_logs if PODMAN_COMPOSE_WARNING_LOGS=false
2024-07-30 14:28:00 +00:00
openshift-merge-bot[bot] aa077cdcaa
Merge pull request #23446 from Luap99/bind-ports
libpod: bind ports before network setup
2024-07-30 14:19:43 +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
openshift-merge-bot[bot] b4d0c95f4e
Merge pull request #23427 from ygalblum/quadlet-pod-service-name
Allow setting the service name of Quadlet .pod units
2024-07-30 12:54:29 +00:00
Paul Holzinger 77081df8cd
libpod: bind ports before network setup
We bind ports to ensure there are no conflicts and we leak them into
conmon to keep them open. However we bound the ports after the network
was set up so it was possible for a second network setup to overwrite
the firewall configs of a previous container as it failed only later
when binding the port. As such we must ensure we bind before the network
is set up.

This is not so simple because we still have to take care of
PostConfigureNetNS bool in which case the network set up happens after
we launch conmon. Thus we end up with two different conditions.

Also it is possible that we "leak" the ports that are set on the
container until the garbage collector will close them. This is not
perfect but the alternative is adding special error handling on each
function exit after prepare until we start conmon which is a lot of work
to do correctly.

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

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-30 14:39:08 +02:00
Petter Mikkelsen cfac059d14 Disable compose-warning-logs if PODMAN_COMPOSE_WARNING_LOGS=false
Fixes: e62c928642 ("Make podman-compose refer to podman-compose(1) when using an external provider")

- test: add coverage for PODMAN_COMPOSE_WARNING_LOGS

Signed-off-by: Petter Mikkelsen <43xhyr9m@anonaddy.me>
2024-07-30 12:06:11 +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
openshift-merge-bot[bot] 2316d914b5
Merge pull request #23428 from Luap99/config-clone
pkg/api: do not leak config pointers into specgen
2024-07-29 19:09:01 +00:00
Ed Santiago 396961069c CI: kube test: fix broken external-storage test
I broke the kube external storage test in the course of my
safename PR: _write_test_yaml() with no command generated
a pod that did not trigger the conditions required for
this test.

Solution: run a container (top). Add new checks to prevent
this gap from happening again.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-29 12:23:35 -06:00
renovate[bot] 8b5b9d0bb5
Update dependency setuptools to v72
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-29 15:45:43 +00:00
openshift-merge-bot[bot] c7f00b6b5b
Merge pull request #23301 from ypu/automount-volume
test/system: Add a test case for automount with multi images
2024-07-29 14:22:40 +00:00
Paul Holzinger 1b91df012d
pkg/api: do not leak config pointers into specgen
The value of the pointer might be changed while creating the container
causing unexpected side effects.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-29 15:12:55 +02: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
renovate[bot] 1d23f3ff11
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.19.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-26 19:48:09 +00:00
Yiqiao Pu a18bd3e9c0 Add test steps for automount with multi images
These test steps check the automount feature with multi images for
following item:
  1. multi images can be auotmounted with yaml file.
  2. if there are same path exist in the images, the last one
should trumps.
  3. the volume is mounted readonly in the container.
  4. the volumes are only mounted in the specific container, but
not the whole pods.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2024-07-26 15:56:33 +08:00
Ed Santiago 25fffdb74f CI: cp tests: use safename
Continuing efforts to make system tests parallel-safe

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-25 11:55:38 -06:00
Ed Santiago fd0ff9060f CI: 700-play: fix a leaked non-safename
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-25 05:49:42 -06: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
openshift-merge-bot[bot] 443b04ba00
Merge pull request #23274 from giuseppe/no-artifacts-composefs
test: disable artifacts cache with composefs
2024-07-24 18:04:37 +00:00
openshift-merge-bot[bot] 1da89dd180
Merge pull request #23249 from giuseppe/play-kube-userns-fixes
kube generate/play restores the user namespace configuration
2024-07-24 17:34:59 +00:00
Giuseppe Scrivano d9c2806461
test: check that kube generate/play restores the userns
validate that a "podman generate" and "podman play" cycle restores the
specified user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-24 17:36:38 +02: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
Paul Holzinger 2e20681f05
test/system: fix borken pasta interface name checks
The tests didn't check anything actually because default_ifname requires
an ip version argument to work. Thus pasta_iface was empty, add new
checks to prevent this kind of error again.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-24 14:56:30 +02:00
Paul Holzinger da3edce4e6
test/system: fix bridge host.containers.internal test
The test assumes that if more than 1 ip on the host we should be able to
set host.containers.internal. This however is not how the logic works in
the code. What it actually does is to check all ips in the
rootless-netns and then it knows that it cannot use any of these ips.
This includes any podman bridge ips.

You can reproduce the error when you have only one ipv4 on the host then
run a container as root in the background and run the test:
hack/bats --rootless 505:host.containers.internal

So the failure here was that there was already a podman container
running as root on the default bridge thus the test saw 2 ips but then
the rootless run also uses the same subnet for its bridge and the code
knew that ip would not work either. I could have made another special
condition in test but the better way to work around it is to create a
new network. A new network will make sure there are no conflicting
subnets assigned so the test will pass.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-24 14:52:53 +02:00
openshift-merge-bot[bot] c804f10686
Merge pull request #23378 from edsantiago/systest-fixes
CI: system tests: instrument to allow failure analysis
2024-07-24 08:29:49 +00:00
openshift-merge-bot[bot] 7b59ad8681
Merge pull request #23380 from edsantiago/safename-log-test
CI: system log test: use safe names
2024-07-24 05:53:01 +00:00
Ed Santiago 64f2d85e4f CI: system log test: use safe names
Continuing efforts on making system tests parallel-safe by
using unique names for containers and pods.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-23 14:47:02 -06: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
Ed Santiago b61667470c CI: system tests: instrument to allow failure analysis
Two tests failing in gating but never CI; add some debug
instrumentation to make it possible to find out what
is going on

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-23 12:58:58 -06:00
Daniel J Walsh 7768cf235e
Run codespell on source
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-23 07:28:23 -04:00
renovate[bot] a493a584c0
chore(deps): update dependency setuptools to ~=71.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-22 16:43:28 +00: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] 8a53e8eb67
Merge pull request #23323 from Luap99/machine-decompress-empty
pkg/machine/compression: skip decompress bar for empty file
2024-07-18 17:51:11 +00:00
openshift-merge-bot[bot] 73986f67a3
Merge pull request #23313 from edsantiago/safename-kube-tests
CI: 700-play.bats: huge cleanup, with goal of making parallel-safe
2024-07-18 17:45:40 +00:00
Paul Holzinger f630eebcfa
pkg/machine/compression: skip decompress bar for empty file
When the file is empty it is possible our code panics as bar.ProxyReader
returns nil when the bar is finished which is the case for 0 size as it
doesn't have to read anything from there. However as this happens on
different goroutines it is race and most of the time still works.

To fix this simply skip the progress bar setup for empty files.

While at it fix the deprecated argument in the tests.

Fixes #23281

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 13:23:00 +02:00
Ed Santiago 7100ead475 nc -p considered harmful
nmap-ncat has been downgraded on Fedora, to 7.92.
nc -l -p PORT requires 7.95. Switch to nc -l ADDR PORT.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-18 05:15:57 -06:00
openshift-merge-bot[bot] 599967bf9f
Merge pull request #23265 from benniekiss/extended_drop_ins
Expand Quadlet drop-in search paths
2024-07-18 09:49:55 +00:00
Ed Santiago 2f7fd64e98 700-play.bats: use unique pod/container/image/volume names
The end goal is making this test file parallel-safe, by:

  1) Having all tests use unique names for all objects; and
  2) Not doing "rm -a" or "expect ps to be empty".

This commit is not enough to make tests parallel-safe. The
rest of the changes are not relevant for now. This set of
changes is _necessary_ for parallelizing, and is _meaningful_
(good practice) for current linear-testing podman without
introducing any unnecessary cruft.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 380ed3a40d safename: consistent within same test, and, dashes
Make safename() invocations consistent within the same
test. This puts the onus on the caller to add a unique
element when calling multiple times, e.g. "ctr1-$(safename)".
This is not too much of a burden. Major benefit is making
it easy for a reader to associate containers, pods, volumes,
images within a given test.

And, use dashes, not underscores. "podman generate kube"
removes underscores, making it very difficult to do
things like "podman inspect $podname" (because we need
to generate "$podname_with_underscores_removed")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 6d01ce417d 700-kube.bats: refactor $PODMAN_TMPDIR/test.yaml
Many instances. Simplify by having _write_test_yaml() define
the variable TESTYAML and make it available to callers.
Global replace, with care taken to undo any instances
where _write_test_yaml() is not invoked first.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 987d15a378 700-play.bats: eliminate $testYaml
Get rid of the last two instances of the clunky $testYaml
writing, by adding a 'volume=' arg to _write_test_yaml()

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 48aea083c0 700-play.bats: refactor clumsy yamlfile creation
Remnant from the very early days of this test file. There's
a boilerplate $testYaml string used in many tests; each
use requires three clunky lines of prep. Most of those
were not needed; we can (and now do) use _write_test_yaml()
instead.

There are still two instances that could not be fixed in
this commit. I will do those next. This commit is kept
relatively simple for ease of review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 517c6e6f10 700-play.bats: move _write_test_yaml up near top
This is almost a NOP; it's needed for making subsequent commits
reviewable.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
renovate[bot] ed71000e6d
chore(deps): update dependency setuptools to v71
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 22:13:43 +00:00
benniekiss 3c52ef43f5 Expand drop-in search paths
* top-level (pod.d)
* truncated (unit-.container.d)

Signed-off-by: Bennie Milburn-Town <63211101+benniekiss@users.noreply.github.com>
2024-07-17 17:43:02 -04:00
Daniel J Walsh 1ec3edd3f6
Do not crash on invalid filters
Vendor in latest containers/common
Fixes #23120

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 10:44:55 -04:00
Ed Santiago b28027148b System tests: safe container/image/volume/etc names
Many system tests use hardcoded names for containers, images,
and everything. This has worked because system tests run
serially. It will not work if we ever run in parallel.

Create a new safename() helper, and use it as follows:

   myctr=c_$(safename)
   myvol1=v1_$(safename)
   ...

Find current instances of hardcoded names, and replace
with safe ones.

Whether or not we ever end up parallelizing system tests,
this is simply good practice.

There are far too many instances to fix in one (reviewable) PR.
This is commit 1 of N.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-15 11:38:00 -06: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
Giuseppe Scrivano 6832a35f65
libpod: cleanup store at shutdown
shutdown the containers store so that the home directory mount is not
leaked when "podman system service" exits.

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
openshift-merge-bot[bot] 58c8803a1e
Merge pull request #22726 from edsantiago/pull-from-local-registry
CI: Use local cache registry
2024-07-11 12:42:04 +00:00
Paul Holzinger 926547f7d3
test/upgrade: fix tests when netavark uses nftables
Old netavark version only supported iptables, however a new version on
th ehost might use nftables. This breaks the networking tests here as
they are not compatible and you would need to reboot to fix that.

Because this is not possible for our tests make sure we force the
iptables driver always to keep the test working.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:10:16 +02:00
Paul Holzinger 5856adb9f8
test/system: fix network reload test with nftables
netavark can use iptables or nftables as firewall driver, thus if we try
to flush rules make sure we try both to keep the test working when we
switch the default to nftables.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:09:59 +02: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
openshift-merge-bot[bot] 1125d4d143
Merge pull request #23228 from Luap99/fix-internal-test
test/system: fix pasta host.containers.internal test
2024-07-11 11:22:20 +00: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