From 48ec1b0c13bb6e864e055961c8d1f570a8b545db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 15 Feb 2022 12:17:45 +0100 Subject: [PATCH 1/3] Don't expect the config blob to be listed in (skopeo inspect) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... because it currently isn't. Signed-off-by: Miloslav Trmač --- systemtest/010-inspect.bats | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/systemtest/010-inspect.bats b/systemtest/010-inspect.bats index 69370db3..91ef26a4 100644 --- a/systemtest/010-inspect.bats +++ b/systemtest/010-inspect.bats @@ -27,11 +27,18 @@ load helpers # Now run inspect locally run_skopeo inspect dir:$workdir inspect_local=$output + run_skopeo inspect --raw dir:$workdir + inspect_local_raw=$output + config_digest=$(jq -r '.config.digest' <<<"$inspect_local_raw") - # Each SHA-named file must be listed in the output of 'inspect' + # Each SHA-named layer file (but not the config) must be listed in the output of 'inspect'. + # As of Skopeo 1.6, (skopeo inspect)'s output lists layer digests, + # but not the digest of the config blob ($config_digest), if any. 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="$inspect_local" --substring "sha256:$sha" \ + "Locally-extracted SHA file is present in 'inspect'" + fi done # Simple sanity check on 'inspect' output. From 7e1ded5077e94fc8a175f89dc1b791a25b71327f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 15 Feb 2022 16:07:54 +0100 Subject: [PATCH 2/3] Only look for the layer digests in the Layers field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- systemtest/010-inspect.bats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systemtest/010-inspect.bats b/systemtest/010-inspect.bats index 91ef26a4..ba530c52 100644 --- a/systemtest/010-inspect.bats +++ b/systemtest/010-inspect.bats @@ -34,9 +34,10 @@ load helpers # Each SHA-named layer file (but not the config) must be listed in the output of 'inspect'. # As of Skopeo 1.6, (skopeo inspect)'s output 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 if [ "sha256:$sha" != "$config_digest" ]; then - expect_output --from="$inspect_local" --substring "sha256:$sha" \ + expect_output --from="$layers" --substring "sha256:$sha" \ "Locally-extracted SHA file is present in 'inspect'" fi done From d18c376a5d304af18f66c5ebb21a96ad2911847f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 22 Feb 2022 19:44:14 +0100 Subject: [PATCH 3/3] Improve a comment in the 010-inspect.bats test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- systemtest/010-inspect.bats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systemtest/010-inspect.bats b/systemtest/010-inspect.bats index ba530c52..28e0f0be 100644 --- a/systemtest/010-inspect.bats +++ b/systemtest/010-inspect.bats @@ -32,7 +32,8 @@ load helpers 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'. - # As of Skopeo 1.6, (skopeo inspect)'s output lists layer digests, + # 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