Commit graph

2964 commits

Author SHA1 Message Date
Lokesh Mandvekar
5bbbbb1eee
test/e2e: skip "podman cp --pid=host file" for remote
Same issue as "podman cp from ctr chown" - the test fails when copying
a file from a container to an existing file on the host. Remote cp
tries to create a directory at the destination, resulting in:
  Error: mkdir /tmp/746758151: not a directory

This is the same bug in the remote cp implementation where it doesn't
handle copying to an existing file path. Fix exists in commit
b0836ab624 but hasn't been merged yet.

Skip the test for remote until the fix is integrated.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 18:39:02 +05:30
Lokesh Mandvekar
1655f22451
test/e2e: skip "podman cp from ctr chown" for remote
The test fails in podman-remote when copying a file from a container
to an existing file on the host. The remote cp implementation tries
to create a directory at the destination path, resulting in:
  Error: mkdir /tmp/1457882724: not a directory

This is a bug in the remote cp implementation where it doesn't
properly handle copying to an existing file. A fix exists in commit
b0836ab624 (branch cve-441-crio) but hasn't been merged yet.

Skip the test for remote until the fix is integrated.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 18:38:54 +05:30
Lokesh Mandvekar
04ee7173b5
test/e2e: skip "podman rmi with cached images" for remote
Remote builds don't reuse cache layers the same way as local builds.
The test builds two images where the second image shares some steps
with the first, expecting cache layers to be shared. When the second
image is removed, only 2 images should be deleted (the final image +
one unique intermediate layer). However, in remote mode, cache isn't
shared, so 4 images are deleted instead.

This test was originally skipped for remote (commit pre-4b8df5903f)
with the note "FIXME This should work on podman-remote, problem is
with podman-remote build". It was enabled in commit 4b8df5903f
assuming the issue was fixed, but the underlying cache reuse problem
persists.

Re-add SkipIfRemote until the cache layer sharing issue is resolved.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 18:38:48 +05:30
Lokesh Mandvekar
2be8e4761d
test/e2e: skip "podman image prune dangling images" for remote
Remote builds don't reuse cache layers the same way as local builds.
When building with --layers=true, the test expects intermediate cache
layers to be reused between builds, resulting in only 2 dangling images.
However, in remote mode, cache isn't reused properly, creating duplicate
intermediate images (5 total instead of 2).

This test was originally skipped for remote (commit d832136349) with
the note "podman-remote build is not working the same as local build".
It was enabled in commit 4b8df5903f assuming the issue was fixed, but
the underlying cache reuse problem persists.

Re-add SkipIfRemote until the cache layer reuse issue is resolved.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 18:38:38 +05:30
Lokesh Mandvekar
166b7bea75
test/e2e: fix "Too many RemoteSocket collisions" panic
The panic occurred because PodmanTestCreateUtil tried to create lock
files in /run/podman before the directory existed. The directory was
only created later in StartRemoteService(), causing all 1000 create
attempts to fail with "no such file or directory" rather than the
expected "file exists" collision error.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 17:40:27 +05:30
Lokesh Mandvekar
5b8bf77136
test/e2e: exclude build_test from remote testing
Add //go:build !remote_testing constraint to build_test.go since it
imports buildah, which depends on libimage. The libimage package has
!remote build constraints, causing compilation failures when this test
is included in remote integration tests.

Fixes the "build constraints exclude all Go files" error in
make remoteintegration.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-02-02 17:40:20 +05:30
Lokesh Mandvekar
12b2d861d0
test/e2e: add delay after WaitForFile for volume plugin sockets
WaitForFile only checks if the socket file exists on the filesystem, but
the plugin may not be listening yet. Add a small delay after WaitForFile
to ensure the plugin is actually ready to accept connections.

This fixes flaky volume plugin tests that fail with 'connection refused'
even though the socket file exists.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 20:04:59 +05:30
Valentin Rothberg
36d9075bf9
fix volume-plugin-test flake
Wait for the socket to be ready befor trying to create a volume with the
driver.

Fixes: #17956

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
(cherry picked from commit 70abb4ae5b)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 19:58:46 +05:30
Lokesh Mandvekar
19af2903da
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

(partial cherry-pick from commit 57016f5cc3)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 19:54:40 +05:30
Lokesh Mandvekar
82434d00d9
test/e2e: fix "podman load localhost registry from dir" test
When loading from an OCI directory without an explicit image name, the
image is now stored by digest instead of using the path as the name.

Update the test to verify the load succeeded and output contains the
sha256 digest, rather than checking for a specific image name.

This aligns with the behavior change from containers/common and fixes
the rootful localintegration test failure.

(partial cherry-pick from commit e66c04c1f7)

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 19:09:26 +05:30
Lokesh Mandvekar
a7b2b9da8c
test/e2e: skip wildcard search test due to unreliable registry
The wildcard search test uses registry.access.redhat.com which has been
historically unreliable and often returns no results for wildcard
searches.

In v5+, this test was replaced with a mock registry server (commit
d6f660076b in Oct 2025), but that infrastructure is not available on
v4.4.1-rhel.

Skip the test to avoid flakes from external registry unavailability.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:59:04 +05:30
Nalin Dahyabhai
02e250f3d2
"podman pull by digest and list --all" test: untag instead of rmi
The "podman pull by digest and list --all" e2e test pulls an image using
a tagged reference when an image with the same ID is already present in
a read-only additional image store.
This causes a new image record to be created in read-write storage.
The test then removes this entry, pulls the image again using a digested
reference, and then expects the image to not have any tagged names in it
when it goes to look at it again.
Newer containers/storage will ensure that at the point when the
read-write image record is created, that it includes all of the data
items and naming information from the read-only copy of the image, so
that this information doesn't appear to be lost.
Change the test to use "untag" instead of "rmi", which should pass with
either the older or newer containers/storage.
The test is checking that `podman images` doesn't choke when it
encounters a digested name attached to an image, so the difference in
behavior between containers/storage versions is irrelevant.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
(cherry picked from commit a428555e3e)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
0a9a5614c6
build(deps): bump CDI spec version to 0.3.0
The vendoring of Buildah dragged in a bump of container-device-interface
from v0.5.3 to v0.5.4 which requires CDI spec version 0.3.0.

(partial cherry-pick from commit e9942c61dd)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Paul Holzinger
e1a176acf1
test/e2e: fix network ID test
We no longer allow to match ids in the middle, this makes no realy
sense. ID matches should always be by prefix.

https://github.com/containers/podman/issues/18471

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 63f5116ad3)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
e3fc77e3c3
test/e2e: fix secret bad name validation test
Update the secret name validation test to use names that actually
violate the validation rules. The previous test used "?!" which is
not actually invalid.

Secret names cannot include '=', '/', ',', or '\0' (NULL) characters.
Update to use "foo/bar" and "foo=bar" as test cases.

This is a partial cherry-pick of the test changes from the vendor
update commit that fixed secret name validation.

(partial cherry-pick from commit 13a9500166)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
5c77446b8d
Fix nc listen command for ncat compatibility
On RHEL 9, 'nc' is a symlink to 'ncat' (from nmap). With ncat, the -p
flag is for source port (outgoing connections), not the listening port.
For listening, the port is specified as a positional argument.

This fixes the error: "nc: cannot use -p and -l"

Changes:
- nc -v -n -l -p <port> → nc -v -n -l <port>

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
04b606b6e9
Fix OCI directory pull tests for vendored libimage behavior
The OCI directory pull behavior changed in containers/common (Aug 2023)
to require explicit image names. Without an explicit name, images are
now stored by digest and appear as <none>:<none> in podman images.

Update two test cases to use the new syntax:
- "podman pull from local OCI directory"
- "podman pull and decrypt / From oci"

Changes:
- Use oci:/path:imagename instead of oci:/path
- Check for explicit image name instead of auto-generated path-based name
- Add -q flags for quieter test output

This aligns the tests with the main branch and fixes rootful
localintegration test failures.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
e14a819525
Fix integration test build failures
The ginkgo-run target was unconditionally adding the "remote" build tag
to all integration tests, which excluded all libimage source files (they
have "// +build !remote" constraints). This caused localintegration
tests to fail with "build constraints exclude all Go files" errors.

Also fix test compilation errors introduced in commit 0cdddfa8f7:
- Update libimage import to libimage/define for ManifestListData type
- Replace undefined CITEST_IMAGE with ALPINE constant
- Fix getConfigMapVolume call signature (3 params, not 4)
- Replace non-existent PodmanExitCleanly with standard test pattern
- Fix ExitWithError assertion to use Exit() and ContainSubstring()

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:51 +05:30
Lokesh Mandvekar
36c1973661
tests: fix "Storing signatures" check
After[1] c/image no longer prints "Storing signatures" so we should
not check for it.

[1] https://github.com/containers/image/pull/2001

(partial cherry-pick from commit 6eaf8a271d)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-29 18:41:43 +05:30
Paul Holzinger
0cdddfa8f7 [v4.4.1-rhel] test/e2e: add CVE-2025-9566 regression test
Ensure we do not regress again.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-09-09 20:03:19 -04:00
tomsweeneyredhat
32c1c30af0 [v4.4.1-rhel] Change images_test expect from 10 to 9
I'm not exactly sure what is happening here, but this call
```
result := podmanTest.Podman([]string{"images", "-q", "-f", "reference=quay.io/libpod/*"})
```
in the test/e2e/images-test.go in this test
```
It("podman images filter reference", func()
```

is now sending back 10 instead of 9 objects.  This was a change
that @edsantiago also made in https://github.com/containers/podman/pull/21356

After the other adjustments I made to the tests to right them,
this seemed to be the last issue.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-07-20 16:50:49 -04:00
Ed Santiago
54326f49e4 [v4.4.1-rhel] CI: stop using registry.k8s.io
It's flaky.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-20 16:44:53 -04:00
Sohan Kunkerkar
cbe3e18798 [v4.4.1-rhel] *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-07-20 16:44:53 -04:00
Aditya R
0ef28c0dad
remote,test: remove .dockerignore which is a symlink
It seems certain test infrastructure prevents cloning repo which
contains symlink outside of the repo itself, generate symlink for such
test by the testsuite itself just before running test and remove it when
test is completed.

Signed-off-by: Aditya R <arajan@redhat.com>
(cherry picked from commit 607aff55fa)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-04-16 09:05:59 -04:00
Aditya R
284c44d04f
remote,build: error if containerignore is symlink
Drop support for remote use-cases when `.containerignore` or
`.dockerignore` is a symlink pointing to arbitrary location on host.

Signed-off-by: Aditya R <arajan@redhat.com>
2024-03-13 20:02:10 +05:30
Ed Santiago
2fe6265079
(Temporary) Emergency CI fix: quay search is broken
Someone please revert this once quay search is fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
(cherry picked from commit 047da19b5f)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-01-04 18:48:28 +05:30
Daniel J Walsh
e0654150d0 Support podman --remote when Containerfile is not in context directory
Fixes: https://github.com/containers/podman/issues/18239

[NO NEW TESTS NEEDED]

@test "podman build -f test" in test/system/070-build.bats

Will test this.  This was passing when run on a local system since
the remote end was using the clients path to read the Containerfile
The issue is it would not work in a podman machine since the
Containerfile would/should be a different path.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

<MH: Cherry-pick to v4.4.1-rhel>

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-08-15 09:46:28 -04:00
Valentin Rothberg
3101c8be24 [v4.4.1-rhel] compat: /auth: parse server address correctly
Use `auth.Login` as `podman login` does which parses and normalizes the
input addresses correctly, especially for docker.io.

This Cherry Picks https://github.com/containers/podman/pull/17581 and
brings in necessary changes to run_test.go from i
5f86fae71f

Addreses: https://bugzilla.redhat.com/show_bug.cgi?id=2183601 and
https://bugzilla.redhat.com/show_bug.cgi?id=2183602 for the RHEL 8.8 and
9.2 ZeroDay

The original Fixed: #17571
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-31 16:10:16 -04:00
Valentin Rothberg
9ca3d1c28e kube play: only enforce passthrough in Quadlet
Only enforce the passthrough log driver for Quadlet. Commit 68fbebf
introduced a regression on the `podman-kube@` template as `podman logs`
stopped working and settings from containers.conf were ignored.

Fixes: #17482
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-20 07:53:56 +00:00
Valentin Rothberg
52ae4a2c40 Quadlet: exit 0 when there are no files to process
Quadlet should not exit with failure if no files to process have been
found.  Otherwise, even simple operations such as reloading systemd
will fail as it retriggers generators.

Fixes: #17374
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 15:18:03 -05:00
Jason T. Greene
322802e409 Fix default handling of pids-limit
Add test to verify that updates without a pids-limit specified no longer
overwrite the previous value.

Also fixes erroneous warning generated by remote clients:

"Resource limits are not supported and ignored on cgroups V1 rootless
systems"

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-02-03 16:13:22 +00:00
OpenShift Merge Robot
1f96d03458
Merge pull request #17258 from openshift-cherrypick-robot/cherry-pick-17213-to-v4.4
[v4.4] Set runAsNonRoot=true in gen kube
2023-01-29 13:38:15 -05:00
OpenShift Merge Robot
cc91db6131
Merge pull request #17259 from TomSweeneyRedHat/dev/tsweeney/fixlang4.4
[v4.4] Clean up more language for inclusiveness (cherry-pick from main)
2023-01-29 11:17:01 -05:00
OpenShift Merge Robot
492e7aa5a7
Merge pull request #17257 from openshift-cherrypick-robot/cherry-pick-17217-to-v4.4
[v4.4] quadlet: Add device support for .volume files
2023-01-29 11:14:09 -05:00
tomsweeneyredhat
605079dc8f Clean up more language for inclusiveness
We had a number of references, mostly in docs, to the word master that
can now be changed to main.  This PR does that and makes the project a
bit more inclusive.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-01-27 18:00:59 -05:00
Urvashi Mohnani
f4bf448d85 Set runAsNonRoot=true in gen kube
If the image being used has a user set that is a positive
integer greater than 0, then set the securityContext.runAsNonRoot
to true for the container in the generated kube yaml.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-01-27 19:48:26 +00:00
Ingo Becker
45b9e17d7c quadlet: Add device support for .volume files
The Device, Type, Copy and Options keys are now supported in
quadlet  .volume files. This allows users to create filesystem
based volumes with quadlets .volume files.

Signed-off-by: Ingo Becker <ingo@orgizm.net>
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-27 19:48:04 +00:00
Daniel Lublin
edb7779cdf fix: don't output "ago" when container is currently up and running
Closes #17250

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-01-27 19:47:33 +00:00
Miloslav Trmač
097ca60568 Add (podman {image,manifest} push --sign-by-sigstore=param-file.yaml)
(podman push) and (podman manifest push) now support --sign-by-sigstore=param-file,
using the containers-sigstore-signing-params.yaml(5) file format.

That notably adds support for Fulcio and Rekor signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-01-27 16:46:28 +01:00
Daniel J Walsh
c4aae9b47e
Get correct username in pod when using --userns=keep-id
Fixes: https://github.com/containers/podman/issues/17148

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-24 11:06:06 -05:00
Aditya R
06241077cc
libpod,netavark: correctly populate /etc/resolv.conf with custom dns server
After https://github.com/containers/netavark/pull/452 `netavark` is
incharge of deciding `custom_dns_servers` if any so lets honor that and
libpod should not set these manually.

This also ensures docker parity
Podman populates container's `/etc/resolv.conf` with custom DNS servers ( specified via `--dns` or `dns_server` in containers.conf )
even when container is connected to a network where `dns_enabled` is `true`.

Current behavior does not matches with docker, hence following commit ensures that podman only populates custom DNS server when container is not connected to any network where DNS is enabled and for the cases where `dns_enabled` is `true`
the resolution for custom DNS server will happen via ( `aardvark-dns` or `dnsname` ).

Reference: https://docs.docker.com/config/containers/container-networking/#dns-services
Closes: containers#16172

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-22 12:48:55 +05:30
OpenShift Merge Robot
8252dcceb3
Merge pull request #17168 from danishprakash/add-host-pid
kube-play: add support for HostPID
2023-01-20 11:57:14 -05:00
OpenShift Merge Robot
4f4dce166c
Merge pull request #17175 from Luap99/default-invalid-netname
network create: do not allow `default` as name
2023-01-20 11:18:01 -05:00
OpenShift Merge Robot
9c79e3bbb0
Merge pull request #17124 from sstosh/e2e-rootless
e2e: use isRootless() instead of rootless.IsRootless()
2023-01-20 09:04:25 -05:00
Paul Holzinger
86699954b1
network create: do not allow default as name
`default` is already used as network mode, i.e. podman run --network
default will choose the default mode not a network named `default`.

We already block names from other network modes, default was forgotten.

Fixes #17169

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-20 14:52:07 +01:00
danishprakash
3ae84fe0a3
kube-play: add support for HostPID in podSpec
* test/play_kube: add tests for hostPID

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-01-20 17:32:59 +05:30
Ed Santiago
ca91cf416f Let's see if #14653 is fixed or not
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-19 12:20:56 -07:00
Paul Holzinger
7be8ff5644
unskip network update test
They should work with the new VM images.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-19 15:44:17 +01:00
Ed Santiago
51836aa47c e2e tests: reenable long-skipped build test
July 2022: test was flaking on new VM images. We needed new
images, so I filed #15014 and skipped the test.

January 2023: no attention from anyone, so I'll try bumping up
a dd timeout from 10s to 30s. But in the interim, the test
has broken: it used to expect "Containerfile" in output (this
was deliberately added in #13655)... but #16810 changed that
so Containerfile no longer appears. @flouthoc argues that
this too is deliberate (#17059). Okay, so let's change the
test then. All I care about is not adding more regressions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-18 17:31:03 -07:00
Daniel J Walsh
ef3f098796
Remove ReservedAnnotations from kube generate specification
Reserved annotations are used internally by Podman and would effect
nothing when run with Kubernetes so we should not be generating these
annotations.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-18 08:46:24 -05:00