Commit Graph

5142 Commits

Author SHA1 Message Date
OpenShift Merge Robot 7430d9d777
Merge pull request #18364 from containers/renovate/requests-2.x
chore(deps): update dependency requests to ~=2.29.0
2023-04-27 07:31:50 -04:00
OpenShift Merge Robot c50d223b84
Merge pull request #18327 from rhatdan/docker
Add sha256: to images history id for docker compatibility
2023-04-27 06:14:12 -04:00
Daniel J Walsh edaf3b4d5e
Add sha256: to images history id for docker compatibility
Fixes: https://github.com/containers/podman/issues/17762

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-26 14:38:07 -04:00
Daniel J Walsh d51911f7b0
Support systemd optional prefix '-' for devices.
Systemd supports unit files with a prefix '-' which
tells the system to check if the content exists before
using it. This would allow the QM project to specify
AddDevice=-/dev/kvm, which would add the /dev/kvm device
to the container iff it exists on the host.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-26 14:22:57 -04:00
renovate[bot] ba45863753
chore(deps): update dependency requests to ~=2.29.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-26 16:38:23 +00:00
OpenShift Merge Robot 846e7aa21b
Merge pull request #18342 from edsantiago/aardvarks_are_slow
Netavark userns test: give aardvark time to come up
2023-04-26 08:51:47 -04:00
OpenShift Merge Robot 931447b995
Merge pull request #18344 from Luap99/container-ns
rootless: support joining containers that use host ns
2023-04-26 04:06:57 -04:00
Ed Santiago bdf367958e Netavark userns test: give aardvark time to come up
Nasty test flake, "bad address nc-server.dns.podman"

Cause: "There is absolutely no guarantee that aardvark-dns
is ready before the container is started." (source: Paul).

Workaround (not a real solution): wait before doing a host lookup.

Also: remove a 99%-duplicate test.

Closes: #16272   (I hope)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-25 10:54:01 -06:00
Paul Holzinger d222a392cd
rootless: support joining contianers that use host ns
The problem right now is that --ns contianer: syntax causes use to add
the namespace path to the spec which means the runtime will try to call
setns on that. This works fine for private namespaces but when the host
namspace is used by the container a rootless user is not allowed to
join that namespace so the setns call will return with permission
denied.

The fix is to effectively switch the container to the `host` mode
instead of `container:` when the mention container used the host ns. I
tried to fix this deep into the libpod call when we assign these
namespaces but the problem is that this does not work correctly because
these namespace require much more setup. Mainly different kind of mount
points to work correctly.

We already have similar work-arounds in place for pods because they also
need this.

For some reason this does not work with the user namespace, I don't know
why and I don't think it is really needed so I left this out just to get
at least the rest working. The original issue only reported this for the
network namespace.

Fixes #18027

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-25 15:21:31 +02:00
OpenShift Merge Robot 0a8113be7b
Merge pull request #18323 from edsantiago/container_exit_signaling
system tests: safer container-stop signaling
2023-04-25 05:07:29 -04:00
Ed Santiago ae5ed6d851 e2e create same-IP: try to fix flake
Our friend #7096 is still not fixed: it continues to flake,
singletons only, and only in the "create" test (not "run").

My guess: maybe there's a race somewhere in IP assignment,
such that container1 can have an IP, but not yet be running,
and a container2 can sneak in and start with that IP, and
container1 is the one that fails?

Solution: tighten the logic so we wait for container1 to
truly be running before we start container2. And, when we
start container2, do so with -a so we get to see stdout.
(Am not expecting it to be helpful, but who knows).

Also very minor cleanup

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-24 14:09:52 -06:00
openshift-ci[bot] 3ecb174eee
Merge pull request #18320 from Luap99/ps-state
ps: --format {{.State}} match docker output
2023-04-24 19:56:32 +00:00
Ed Santiago faeed14f61 system tests: safer container-stop signaling
Having a container spin-wait on a /stop file, then exit, is
unsafe: 'podman exec $ctr touch /stop' can get sucked into
container cleanup before the exec terminates, resulting in
the podman-exec failing and hence the test failing.

Most existing instances of this pattern are unnecessary.
Replace those with just 'podman rm -f'.

When necessary, use a variety of safer alternatives.

Re-Closes: #10825 (already closed; this addresses remaining cases)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-24 11:35:49 -06:00
Paul Holzinger c5a928c5b7
ps: --format {{.State}} match docker output
We should return the raw state string without any extra formatting in
this case.
`{{.Status}}` returns the nicely formatted string used in the default ps
output, e.g. `Up 2 seconds ago`, while `{{.State}}` returns the state as
string, e.g. `running`.

This matches the docker output and allows better use in scripts.

Fixes #18244

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-24 14:18:26 +02:00
Valentin Rothberg b4eecd908a test/system/260-sdnotify.bats: fix test flake
The `exec` session somestimes exits with 137 as the exec session races
with the cleanup process of the exiting container.  Fix the flake by
running a detached exec session.

Fixes: #10825
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-24 14:09:09 +02:00
openshift-ci[bot] e9c13354eb
Merge pull request #18276 from sstosh/e2e-journald
e2e: skip journald test if journald is unavailable
2023-04-21 11:05:20 +00:00
openshift-ci[bot] 1821f97ade
Merge pull request #18284 from vrothberg/fix-18216
support `--digestfile` for remote push
2023-04-21 10:24:15 +00:00
Valentin Rothberg 1f1525f2e1 support `--digestfile` for remote push
Wire in support for writing the digest of the pushed image to a
user-specified file.  Requires some massaging of _internal_ APIs
and the extension of the push endpoint to integrate the raw manifest
(i.e., in bytes) in the stream.

Closes: #18216
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-21 10:28:40 +02:00
Toshiki Sonoda d640461ced e2e: skip journald test if journald is unavailable
If journald is unavailable, journald logging driver tests
should be skipped.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-04-21 11:16:18 +09:00
openshift-ci[bot] 69ec2d6ae6
Merge pull request #18213 from rbagd/main
Fixes format inconsistencies with docker for certain history fields
2023-04-20 23:13:21 +00:00
openshift-ci[bot] f21388c51d
Merge pull request #18291 from containers/renovate/setuptools-67.x
chore(deps): update dependency setuptools to ~=67.7.0
2023-04-20 23:08:27 +00:00
Matt Heon 147f1987fc
Merge pull request #18283 from Luap99/e2e-fixes
Several e2e fixes
2023-04-20 15:05:21 -04:00
openshift-ci[bot] 9a750045ea
Merge pull request #18212 from rhatdan/docker
Specify format to buildah before commit
2023-04-20 17:12:29 +00:00
Ed Santiago 252959879b
Merge pull request #18281 from Luap99/e2e-network-prune
test/e2e: use custom network config v2
2023-04-20 10:15:06 -06:00
renovate[bot] 77f86f48ef
chore(deps): update dependency setuptools to ~=67.7.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-20 15:40:33 +00:00
Paul Holzinger 15664b4b02
test/e2e: correctly reap service process
When running the remote integration test I have over 1000 zombies
because each test creates a single service process. Only after ginkgo
exists they get finally reaped by the init process. This only effected
the rootless runs.

For some reason the test use different logic between root and rootless.
This doesn't make much sense. I also see no reason to manually kill
child processes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:56 +02:00
Paul Holzinger c9d8610239
test/e2e: add missing options to remote service
This is a rather big deal. All system services shared the same tmpdir
which causes big issues for the rootless netns setup.
Also use --events-backend file like the local ones. This is important
otherwise reading events and takes ages as the jounal is shared for all
tests.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 1f45c715df
test/e2e: fix incorrect usage of CreateTempDirInTempDir()
Creating a new diretory results in the test leaking it when it is not
removed via a defer call. All tests have already access to
`podmanTest.TempDir` which will be automatically removed in the
`AfterEach()` block.

While some test were fine other forgot the defer call. To keep the test
consitent and prevent other from making the same mistake convert all
users to `podmanTest.TempDir`. `CreateTempDirInTempDir()` is only used
for the `podmanTest.Setup()` call.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 601d228cae
test/e2e: "podman-remote send correct path to copier" do not leak file
Remove the file from the cwd after the test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 08c651016f
test/e2e: fix network create flake due same subnet
Some network test use the same subnet as others, because the network
config direcory is shared we must ensure subnets do not conflict as
tests are run in parallel. I see this locally when running with 12
threads.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 525c27fe1d
test/e2e: fix SkipIfNotActive()
If a unit is not active the exit code from systemctl is 3. Thus this
test always failed because it checked the error.

Fix this by checking the exit code and remove the unnecessary output
parsing.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 01d518a975
test/e2e: do not try to use docker as rootless
Running these locally always created a popup to ask me for my password
as I am in the wheel group.
I would also argue that such a test should not be run on any local
system ever even as root. First docker could be a symlink to podman so
the check if the image is there would fail. Second starting the docker
deamon in a podman test suite just feels very unexpected.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:55 +02:00
Paul Holzinger 6e97976ad4
test/e2e: do not leak "hello" file
Because the test mounts the current dir it does not need to create a new
file in it. Just check if the current test file is there should fulfill
the same purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 16:26:54 +02:00
Paul Holzinger 08d6b7b27e
Merge pull request #18282 from Luap99/remote-logs-fix
podman-remote logs: handle server error correctly
2023-04-20 16:25:52 +02:00
OpenShift Merge Robot 653261aa2c
Merge pull request #18278 from vrothberg/fix/compat-image-remove-noprune
compat: Translate `noprune` into ImageRemoveOptions.NoPrune
2023-04-20 09:30:57 -04:00
Paul Holzinger 750442d093
podman-remote logs: handle server error correctly
If the server responds with an error we must report it correct back to
the user.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 14:11:03 +02:00
Paul Holzinger 3aaa2793da
test/e2e: use custom network config v2
Adds two custom config dirs to tests that were missed in
commit dc9a65e348.

Fixes #17946 (hopefully finally)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 13:34:47 +02:00
OpenShift Merge Robot 85d383bb35
Merge pull request #18277 from giuseppe/fix-race-test-rm-cgroup
test: fix race when listing cgroups
2023-04-20 07:03:41 -04:00
Daniel J Walsh 81621ce8af
Specify format to buildah before commit
If user specifies commit --format, we were not setting it before
commit, this caused warning messages that made no sense to be
printed that made no sense.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-20 06:24:35 -04:00
Giuseppe Scrivano 0364aef1e0
test: fix race when listing cgroups
A cgroup could have been deleted by the time WalkDir is trying to
access it.  Ignore the error and continue.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-04-20 11:21:10 +02:00
Andreas Kohn b65ab52d8d compat: Translate `noprune` into ImageRemoveOptions.NoPrune
PR #15093 implemented support for NoPrune in the ImageRemoveOptions,
this PR simply brings that also to the compat API along with
regression tests.

Signed-off-by: Andreas Kohn <andreas.kohn@gmail.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-20 11:11:19 +02:00
Ed Santiago a089f1b5c3 e2e networking test: better way to get host IP
uber/jaeger-client-go library is deprecated. Remove it.

Only place it's used is in one e2e test, a test that is flaking
in a way that suggests that the HostIP() weighting heuristic from
that module was not actually getting the best outgoing IP address.
So, switch to using what seems to be the current best practice.
No need to make it reusable, since it's only used in one place.

Oh, also remove undesired "-dt" from two "podman run"s. In one
it's harmless, in the other it would cause a test failure under
some circumstances.

Closes: #18269   (optimistic, aren't I?)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-19 13:35:32 -06:00
rbagd bce38c1afb Updated system test to be easier to read
Following @edsantiago guidance,

* Additional explanations for each step of the test
* Timezone for tests normalized to UTC
* Smarter choice of separator and use of shell substring extraction

Signed-off-by: rbagd <mail@rbagd.eu>
2023-04-19 21:10:40 +02:00
OpenShift Merge Robot 190fb30dd1
Merge pull request #18166 from containers/renovate/setuptools-67.x
chore(deps): update dependency setuptools to v67
2023-04-19 11:10:57 -04:00
OpenShift Merge Robot 339344c50e
Merge pull request #18198 from vrothberg/fix-18153
fix remote start --filter
2023-04-19 05:19:06 -04:00
OpenShift Merge Robot 8de9014ff5
Merge pull request #18246 from sstosh/fix-quadlet-test
e2e: quadlet uses PODMAN env for podman binary path
2023-04-19 04:48:56 -04:00
renovate[bot] 8125bab9b8
chore(deps): update dependency setuptools to v67
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-19 08:46:21 +00:00
Toshiki Sonoda da83364eb0 e2e: quadlet uses PODMAN env for podman binary path
Adapts to pass the test even if
podman binary path is not `/usr/local/bin/podman`.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-04-19 16:17:57 +09:00
rbagd 6e0cf93447 Fixes format inconsistencies with docker for certain history fields
Closes #17767
Closes #17768

System test for image list and history dates

* Changed field separator in the test to `;` for easier parsing
* Converted date output from image history and image list to be comparable

Signed-off-by: rbagd <mail@rbagd.eu>
2023-04-19 00:20:47 +02:00
Valentin Rothberg 41d5164125 fix remote start --filter
Fix a number of bugs wrt. filtering remote containers and how to
process specified names or IDs.  I _really_ do not like the duplication
between remote and local Podman but want to focus on fixing #18153
for now.

What I desire in the future is to consolidate all functionality of
looking up containers (all, latest, filters, specified names/IDs, etc.)
and for remote clients to just call containers/list etc.

Fixes: #18153
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-17 15:11:40 +02:00