tests: add basic zstd:chunked system test#24413
tests: add basic zstd:chunked system test#24413openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
Conversation
edsantiago
left a comment
There was a problem hiding this comment.
Thank you! I'm OOTO tomorrow all day so this is a very cursory first pass with some suggestions
test/system/150-login.bats
Outdated
| } | ||
|
|
||
| @test "push and pull zstd chunked image" { | ||
| iid=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z) |
There was a problem hiding this comment.
Could you rename this please? To me, iid refers to a sha.
And, there's a new helper in town, safename. The preferred way to do that now would be
.../img-$(safename)
test/system/150-login.bats
Outdated
| iid2=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z) | ||
| iid3=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/$(random_string 10 | tr A-Z a-z) |
There was a problem hiding this comment.
when using safename multiple times, I've found it best to differentiate in the prefix:
.../img2-$(safename)
.../img3-$(safename)
test/system/150-login.bats
Outdated
| $iid3 | ||
|
|
||
| run_podman diff $iid3 $iid2 | ||
| sorted_output=$(echo $output | sort) |
There was a problem hiding this comment.
I didn't expect this to work, and it doesn't, and for many reasons. First and most important, echo is weird in ways that one has no choice but to shrug and accept:
echo $multilinestring <<<---- collapses to just one line!
echo "$multilinestring" <<<---- with quotes, it preserves newlines
so anyhow, the sort there is a NOP. I'm not sure what it is you're trying to check, and it's late in my day, so I'm sorry not to be able to offer a suggestion for how to solve this.
test/system/150-login.bats
Outdated
| $iid3 | ||
|
|
||
| run_podman diff $iid3 $iid2 | ||
| sorted_output=$(echo $output | sort) |
There was a problem hiding this comment.
Same as above re: echo and newlines and sort
test/system/150-login.bats
Outdated
| --cert-dir ${PODMAN_LOGIN_WORKDIR}/trusted-registry-cert-dir \ | ||
| --creds ${PODMAN_LOGIN_USER}:${PODMAN_LOGIN_PASS} \ |
There was a problem hiding this comment.
These two lines are a great candidate for refactoring into $pushpullargs or somesuch
f69b757 to
c69fda7
Compare
|
@edsantiago thanks for the review. I changed the original tests, the test is just a starting point |
d9b1465 to
b660ac5
Compare
edsantiago
left a comment
There was a problem hiding this comment.
Minor suggestions inline, and one major request: please move this out of 150-login.bats. None of this has anything to do with credential testing. Maybe a new zstd-chunked file? Or a more generic compression? I think we're going to need to add more tests to handle more subtle cases.
Many, many thanks for this. It would never have occurred to me that podman diff would be useful in some way. Your in-depth expertise is exactly what we need to write tests and develop confidence in this new feature.
test/system/150-login.bats
Outdated
| run_podman push $image dir:$push_dir | ||
|
|
||
| run_podman inspect $image | ||
| for layer in $(jq '.[].RootFS.Layers.[] | gsub("^sha256:"; "")' <<< $output | tr -d \"); do |
There was a problem hiding this comment.
jq -r will emit output without doublequotes
test/system/150-login.bats
Outdated
| # the checksum for the layer is already validated, but for the sake | ||
| # of the test let's check it again | ||
| run -0 sha256sum < $layer_file | ||
| assert "$output" = "$layer -" "digest mismatch for layer $layer" |
There was a problem hiding this comment.
suggestion for error message: include $image in the string.
b660ac5 to
e53f0f8
Compare
edsantiago
left a comment
There was a problem hiding this comment.
Test LGTM with one big question. I'll defer to others on the vendoring.
| # replace the image with a "podman load" from what was stored | ||
| run_podman rmi $image | ||
| run_podman load < $PODMAN_TMPDIR/image.tar |
There was a problem hiding this comment.
wait, doesn't this completely change what is being tested?
62de9bf to
df71e86
Compare
|
@edsantiago I've added a new test to make sure the image content doesn't change after a push/pull |
|
LGTM |
|
/lgtm |
|
int remote rawhide root has timed out three times. I'm not liking this. /hold |
also got a timeout in #24447 but didn't think to much of it as I did not try to rerun it yet as I knew it was broken anyway |
|
Thank you! That's good news. In the other log, it looks like all Something is definitely broken with remote root. |
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
df71e86 to
30a82ca
Compare
|
rebased |
|
tests are green now /hold cancel |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, giuseppe, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| @test "push and pull zstd chunked image" { | ||
| image1=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/img1-$(safename) | ||
|
|
||
| globalargs="--pull-option enable_partial_pulls=true" |
There was a problem hiding this comment.
@giuseppe I can’t see any consumer of this option (set twice in this PR). I know about enable_partial_images .
Is this a typo, or am I missing something?
Does this PR introduce a user-facing change?