Skip to content

Commit

Permalink
Merge pull request containers#1575 from mtrmac/inspect-expect-config-1.4
Browse files Browse the repository at this point in the history
[release-1.4] Don't expect the config blob to be listed in (skopeo inspect)
  • Loading branch information
rhatdan authored Feb 28, 2022
2 parents 92a1b29 + d18c376 commit c5b6140
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions systemtest/010-inspect.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ load helpers
# Now run inspect locally
run_skopeo inspect dir:$workdir
inspect_local=$output

# Each SHA-named file must be listed in the output of 'inspect'
run_skopeo inspect --raw dir:$workdir
inspect_local_raw=$output
config_digest=$(jq -r '.config.digest' <<<"$inspect_local_raw")

# Each SHA-named layer file (but not the config) must be listed in the output of 'inspect'.
# In all existing versions of Skopeo (with 1.6 being the current as of this comment),
# the output of 'inspect' lists layer digests,
# but not the digest of the config blob ($config_digest), if any.
layers=$(jq -r '.Layers' <<<"$inspect_local")
for sha in $(find $workdir -type f | xargs -l1 basename | egrep '^[0-9a-f]{64}$'); do
expect_output --from="$inspect_local" --substring "sha256:$sha" \
"Locally-extracted SHA file is present in 'inspect'"
if [ "sha256:$sha" != "$config_digest" ]; then
expect_output --from="$layers" --substring "sha256:$sha" \
"Locally-extracted SHA file is present in 'inspect'"
fi
done

# Simple sanity check on 'inspect' output.
Expand Down

0 comments on commit c5b6140

Please sign in to comment.