Test/koji.sh: adjust for SBOM documents
Adjust the test case to cope with the SPDX SBOM documents uploaded to the Koji. Also explicitly check that there is the expected number of SBOM documents uploaded as the image build output. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
71a12742d4
commit
fd33a37366
1 changed files with 11 additions and 1 deletions
|
|
@ -185,7 +185,7 @@ function verify_buildinfo() {
|
|||
fi
|
||||
|
||||
local outputs_manifests
|
||||
outputs_manifests="$(koji -s "${KOJI_HUB_URL}" --noauth call --json listArchives "${buildid}" | jq -r 'map(select(.btype == "image" and .type_name == "json"))')"
|
||||
outputs_manifests="$(koji -s "${KOJI_HUB_URL}" --noauth call --json listArchives "${buildid}" | jq -r 'map(select(.btype == "image" and .type_name == "json" and (.filename | contains(".manifest."))))')"
|
||||
local outputs_manifests_count
|
||||
outputs_manifests_count="$(echo "${outputs_manifests}" | jq 'length')"
|
||||
if [ "${outputs_manifests_count}" -ne "${outputs_images_count}" ]; then
|
||||
|
|
@ -193,6 +193,16 @@ function verify_buildinfo() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
local outputs_sboms
|
||||
outputs_sboms="$(koji -s "${KOJI_HUB_URL}" --noauth call --json listArchives "${buildid}" | jq -r 'map(select(.btype == "image" and .type_name == "json" and (.filename | contains(".spdx."))))')"
|
||||
local outputs_sboms_count
|
||||
outputs_sboms_count="$(echo "${outputs_sboms}" | jq 'length')"
|
||||
# there should be two SPDX files for each image, one for the image payload and one for the buildroot
|
||||
if [ "${outputs_sboms_count}" -ne $((outputs_images_count * 2)) ]; then
|
||||
echo "Mismatch between the number of image archives and SPDX SBOM files in the buildinfo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local outputs_logs
|
||||
outputs_logs="$(koji -s "${KOJI_HUB_URL}" --noauth call --json getBuildLogs "${buildid}" | jq -r 'map(select(.name != "cg_import.log"))')"
|
||||
local outputs_logs_count
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue