13987 Commits

Author SHA1 Message Date
aafbaa4975 [CI:DOCS] logformatter: fix corner case with links
A test name beginning with non-alpha, e.g., "--build should ...",
was not being recognized and linkified:

   https://storage.googleapis.com/cirrus-ci-6707778565701632-fcae48/artifacts/containers/podman/6500723916537856/html/int-podman-fedora-34-rootless-host.log.html

Fix that. Also fix two other cases (single/double quotes) that were
resulting in weird unreliable links.

While I'm at it, add a few usability enhancements:

  * Colorize [SKIPPING] and [SLOW TEST]
  * Deemphasize '[It] testname' when it appears mid-test
  * Replace 'Running:' with a (deemphasized) '#' or '$' prompt

Add regression tests

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 12:28:13 -07:00
87de344eeb Merge pull request #12482 from edsantiago/e2e_have
e2e tests: use HaveKey() and HaveLen() when possible
2021-12-02 20:06:47 +01:00
ecd48325f6 UPdate vendor of image-spec and containers/storage
This should get rid of the nasty warning on the github site.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-02 14:04:24 -05:00
8bce756df9 Merge pull request #12445 from wilbeibi/main
[CI:DOCS] Update doc to explictly mention using ed25519 in ssh keys
2021-12-02 20:02:48 +01:00
b203e6d0f0 Merge pull request #12365 from mtrmac/random
Don't use a global RNG, and avoid conflicts, when generating NodePorts
2021-12-02 20:00:48 +01:00
4ff0ba4c87 Merge pull request #12455 from jwhonce/issues/10974
Refactor podman image command output
2021-12-02 19:28:48 +01:00
fe1cdab59f vendor: update containers/common
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-02 18:32:13 +01:00
babc693670 Update doc to explictly mention using ed25519 in ssh keys
Signed-off-by: Hongyi Shen <wilbeibi@gmail.com>
2021-12-02 09:20:13 -08:00
61792de36e Refactor podman image command output
Leverage new report.Formatter allowing better compatibility from
podman command output.

Follow on PR's will cover containers, etc.

See #10974

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-12-02 09:07:27 -07:00
ee39281c35 Merge pull request #12480 from vrothberg/fix-12453
compat: images/json
2021-12-02 16:12:47 +01:00
6cb25b3d14 Manual fixes
Fix a handful of instances not covered by earlier automated
replacements. Found via:

   ack 'Expect\(len' test/e2e

There are still a bunch of BeNumerically(">", ...) that cannot (yet)
be handled by HaveLen(). Leave those as they are.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
eb1212bed9 Same thing, with BeNumerically("==", x)
sed -i -e 's/Expect(len(\(.*\)))\.To(BeNumerically("==", \(.*\)))/Expect(\1).To(HaveLen(\2))/' test/e2e/*.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
c0a8814fb4 Use HaveLen(x) instead of Expect(len(y)).To(Equal(x))
sed -i -e 's/Expect(len(\(.*\)))\.To(Equal(\(.*\)))/Expect(\1).To(HaveLen(\2))/' test/e2e/*.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
92f9e11767 Same thing, for BeNumerically("==", 0)
sed -i -e 's/Expect(len(\(.*\)))\.To(BeNumerically("==", 0))/Expect(\1).To(BeEmpty())/' test/e2e/*.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
7c6123f8e1 Use BeEmpty() instead of len(x).To(Equal(0))
sed -i -e 's/Expect(len(\(.*\)))\.To(Equal(0))/Expect(\1).To(BeEmpty())/' test/e2e/*.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
c676495468 Same as previous, for assertions other than Equal()
sed -i -e 's/Expect(\(.*\)\[\(\".*\"\)\])\.To(\(.*\)/Expect(\1).To(HaveKeyWithValue(\2, \3)/' test/e2e/*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
478f2da5d6 e2e tests: a little more minor cleanup
sed -i -e 's/Expect(\(.*\)\[\(\".*\"\)\])\.To(Equal(/Expect(\1).To(HaveKeyWithValue(\2, /' test/e2e/*_test.go

...with two manual tweaks, because this converted:

    Expect(foo["bar"]).To(Equal(""))
 -> Expect(foo).To(HaveKeyWithValue("bar",""))

It looks like the intention of the test was, instead:

    ...To(Not(HaveKey("bar")))

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-02 07:54:53 -07:00
8d6d9df407 compat API: push: report size of manifest
We don't yet have a local registry running in the APIv2 tests.
Tested manually.

[NO NEW TESTS NEEDED]

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-02 15:34:03 +01:00
b41026aec7 Merge pull request #12469 from Luap99/ns-teardown-flake
Fix possible rootless netns cleanup race
2021-12-02 14:40:48 +01:00
2683ecbbcd compat: images/json
Do not list manifest lists.  Docker doesn't either.

Fixes: #12453
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-02 14:29:17 +01:00
6b5ecde76e Merge pull request #12471 from edsantiago/e2e_tmpdir_cleanup
e2e tmpdir cleanup
2021-12-02 14:28:46 +01:00
eeb71490e5 Merge pull request #12425 from tnk4on/remote-build-eval-containerfile
Fixed the containerfile not found during remote build
2021-12-02 10:30:48 +01:00
c70878603a Merge pull request #12472 from rhatdan/owners
[CI:DOCS] Add ashley-cui, lsm5 and floutoc to owners
2021-12-01 23:37:11 +01:00
fbcebcb46a Merge pull request #12458 from edsantiago/remove_betrue
e2e: yet more cleanup of BeTrue/BeFalse
2021-12-01 22:41:11 +01:00
a0e6964111 Add ashley-cui, lsm5 and floutoc to owners
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-01 16:32:12 -05:00
65109494bc remove ARTIFACT_DIR and ArtifactPath
...they're not actually used for anything

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-01 14:06:22 -07:00
3ac1b9bc0f Image caches: allow overriding cache dir
Images were being cached in /tmp, with no option to
override. Now $PODMAN_TEST_IMAGE_CACHE_DIR can be
used to point to a user-preferred location. If unset,
try $TMPDIR before settling on /tmp.

Also: refactor the logic for determining the tarball name.
Also: include registry name in tarball name.
Also: clean up unused/unnecessary code
Also: do not echo "Restoring..." if we're not actually restoring.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-01 14:06:22 -07:00
5ac66e2aab Rename CrioRoot as just Root
...and remove other uses of "crio". They're confusing
and misleading. (I'm sure it made sense at one time)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-01 14:06:22 -07:00
1422cdbac1 Merge pull request #12460 from jwhonce/issues/10974-1
[NO NEW TESTS NEEDED] Refactor podman container command output
2021-12-01 22:05:12 +01:00
4aeac1195a Merge pull request #12307 from hshiina/device-weight
Implement 'podman run --blkio-weight-device'
2021-12-01 21:37:09 +01:00
5d91edc78d Merge pull request #12450 from giuseppe/compression-format
podman, push: expose --compression-format
2021-12-01 21:01:15 +01:00
ecc663097a Merge pull request #12464 from giuseppe/fix-race-reading-cgroup-file
container, cgroup: detect pid termination
2021-12-01 20:59:10 +01:00
3ff47748de Fix possible rootless netns cleanup race
rootlessNetNS.Cleanup() has an issue with how it detects if cleanup
is needed, reading the container state is not good ebough because
containers are first stopped and than cleanup will be called. So at one
time two containers could wait for cleanup but the second one will fail
because the first one triggered already the cleanup thus making rootless
netns unavailable for the second container resulting in an teardown
error. Instead of checking the container state we need to check the
netns state.

Secondly, podman unshare --rootless-netns should not do the cleanup.
This causes more issues than it is worth fixing. Users also might want
to use this to setup the namespace in a special way. If unshare also
cleans this up right away we cannot do this.

[NO NEW TESTS NEEDED]

Fixes #12459

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-01 19:19:44 +01:00
db3a4c070f [NO NEW TESTS NEEDED] Refactor podman container command output
Leverage new report.Formatter allowing better compatibility from
podman command output.

See #10974
See #12455

Depends on containers/common#831

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-12-01 11:17:40 -07:00
078e633294 Merge pull request #12462 from vrothberg/fix-12452
top: parse ps(1) args correctly
2021-12-01 18:19:11 +01:00
4e63f9192d Hostname in spec.hostname should be passed to infra ctr init opt
Fixes https://github.com/containers/podman/issues/12393

Signed-off-by: Qiang Wang <sunsetmask@gmail.com>
2021-12-01 21:03:25 +08:00
0afaf78378 container, cgroup: detect pid termination
If the /proc/$PID/cgroup file doesn't exist, then it is likely the
container was terminated in the meanwhile so report ErrCtrStopped that
is already handled instead of ENOENT.

commit a66f40b4df039e94572fa38c070207a435cfa466 introduced the regression.

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

[NO NEW TESTS NEEDED] it solves a race in the CI that is difficult to reproduce.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-01 13:42:59 +01:00
e2b344728c top: parse ps(1) args correctly
The arguments of ps(1) should be shlexed.

Fixes: #12452
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-01 11:42:37 +01:00
6673ff78d3 podman, push: expose --compression-format
support overriding the compression format at push time.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-01 09:39:03 +01:00
9ce7ade8c8 e2e: yet more cleanup of BeTrue/BeFalse
Thanks to Paul for teaching me about HaveKey()

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-30 15:19:57 -07:00
f415b30552 Ensure the generated NodePort values are unique
... at least within a single service.

[NO NEW TESTS NEEDED]
because testing RNGs is problematic. (We _could_
probably inject a mock RNG implementation that always
returns the same value, or something like that.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-11-30 22:13:52 +01:00
a948ecbb9c Allow containerPortsToServicePorts to fail
Add an error return to it and affected callers.

Should not affect behavior, the function can't currently fail.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-11-30 22:13:52 +01:00
ec686d68dd Don't use the global math/rand RNG for service ports
Use a private RNG with the desired seed, don't interfere
with the other uses.

Introducing the servicePortState type is rather overkill
for the single member, but we'll add another one immediately.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-11-30 22:13:52 +01:00
d48c00418a Move a comment to the relevant place
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-11-30 22:13:52 +01:00
295a6f7dd0 Merge pull request #12454 from edsantiago/remove_betrue
More BeTrue cleanup
2021-11-30 21:03:32 +01:00
85101f69d8 Merge pull request #12414 from flouthoc/api-allow-secrets
tunnel: allow `remote` and `API` to accept `--secrets`
2021-11-30 19:29:33 +01:00
8eb0be0a29 a few more manual BeTrue cleanups
Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-30 10:13:16 -07:00
f7cbb1d845 Convert strings.Contains() to Expect(ContainSubstring)
...done manually, not via sed, because some of the inner
expressions include nested commas.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-30 09:53:15 -07:00
12787963b0 e2e tests: more cleanup of BeTrue()s
Write a BeValidJSON() matcher, and replace IsJSONOutputValid():

  sed -i -e 's/Expect(\(.*\)\.IsJSONOutputValid()).To(BeTrue())/Expect(\1.OutputToString())\.To(BeValidJSON())/' test/e2e/*_test.go

(Plus a few manual tweaks)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-30 09:51:06 -07:00
3fac03cf04 Merge pull request #12449 from vrothberg/fix-12438
systemd: replace multi-user with default.target
2021-11-30 17:09:33 +01:00