Add a kola test asserting the SPDX package manifests ship in the image - #35
Conversation
2b842f9 to
cc5093d
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new kola test to verify that Azure Container Linux images include SPDX package manifest(s) under /usr/share/os-manifests, and that the base image’s package-manifest.spdx.json is present.
Changes:
- Register a new kola test
packages.package-manifest(ACL-only) forqemu,qemu-unpriv, andazure. - Implement the test logic to discover
*.spdx.jsonfiles in/usr/share/os-manifestsand assert the image manifest exists.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
kola/tests/packages/package_manifest.go:27
- Test names in this repo use a distro prefix (e.g.,
acl./cl.). Since this test is restricted toaclonly, naming it without the prefix makes it inconsistent with existing ACL-only tests and can make selection/filtering less clear.
Name: "packages.package-manifest",
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
kola/tests/packages/package_manifest.go:31
- The PR description/changelog refers to the test as
packages.package-manifest, but the code registers it asacl.packages.package-manifest. Since acl-only tests elsewhere consistently use theacl.prefix (e.g.,kola/tests/misc/kdump.go:26,kola/tests/ignition/passwd.go:147), please align the PR description (or rename the test) so users can reliably discover/run it by name.
register.Register(®ister.Test{
Run: packageManifestTest,
ClusterSize: 1,
Name: "acl.packages.package-manifest",
// Written by write_package_manifest in azure-container-linux, so
// upstream Container Linux images do not carry these files.
Distros: []string{"acl"},
Platforms: []string{"qemu", "qemu-unpriv", "azure"},
d45e1fe to
650abf9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
kola/tests/packages/package_manifest.go:49
- If /usr/share/os-manifests is missing, the current
findcall will fail viaMustSSH, but the fatal message won’t include stderr (wherefindreports the missing directory). Adding an explicit directory existence check makes the failure clearer, and quoting the path in thefindcommand makes it more robust if the constant ever changes.
findCmd := fmt.Sprintf("find %s -maxdepth 1 -type f -size +0c -name '*.spdx.json'", manifestDir)
out := c.MustSSH(m, findCmd)
1553598 to
e0bed27
Compare
7ec8a34 to
f36839a
Compare
Summary
Adds
acl.packages.package-manifest, which checks that/usr/share/os-manifestscontains at least one*.spdx.jsonand that one of them is for the image,package-manifest.spdx.json. Sysext manifests are counted but not required.Presence is all this checks. The documents' contents are compared against a checked-in golden SPDX 2.2 document by
build_library/rpm/tests/test_generate_package_manifest.shin azure-container-linux, run as a step in the Build RPMs job of the ACL GitHub PR pipeline.Change Log
kola/tests/packages/package_manifest.gowhich registersacl.packages.package-manifest.Type of Change
Merge order
generate_package_manifest.pyto acl-scripts.Test Methodology
acldevel1192360.Merge Checklist
go build ./...passes (basic validation)docker build -t mantle .succeeds (full multi-arch build; required for build-affecting changes)go test ./...passesgo vet ./...reports no issues