Skip to content

Commit

Permalink
test: extend lint tests to include cosign signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwashburn committed Jun 29, 2024
1 parent e95df60 commit e2bb852
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pkg/packager/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ func TestValidateComponent(t *testing.T) {
t.Parallel()
unpinnedImage := "registry.com:9001/whatever/image:1.0.0"
badImage := "badimage:badimage@@sha256:3fbc632167424a6d997e74f5"
cosignedImage := "ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8sig"
component := types.ZarfComponent{Images: []string{
unpinnedImage,
"busybox:latest@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79",
badImage,
cosignedImage,
}}
findings := checkForUnpinnedImages(component, 0)
expected := []types.PackageFinding{
Expand Down Expand Up @@ -333,6 +335,11 @@ func TestValidateComponent(t *testing.T) {
expected: true,
err: nil,
},
{
input: "ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8.sig",
expected: true,
err: nil,
},
}
for _, tc := range tests {
t.Run(tc.input, func(t *testing.T) {
Expand Down

0 comments on commit e2bb852

Please sign in to comment.