Skip to content

Commit

Permalink
add unit test for kyeless verification
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S <dsavints@gmail.com>
  • Loading branch information
dmitris committed Apr 20, 2023
1 parent 62d77a4 commit 8ebdf9c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/cosign/cli/verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,20 @@ func TestVerifyCertMissingIssuer(t *testing.T) {
t.Fatal("verify expected 'need --certificate-oidc-issuer'")
}
}

func TestVerifyKeylessVerification(t *testing.T) {
ctx := context.Background()
verifyCommand := VerifyCommand{
CertRef: "cert.pem",
CertVerifyOptions: options.CertVerifyOptions{
CertIdentity: "identity",
CertOidcIssuerRegexp: ".*",
},
}

err := verifyCommand.Exec(ctx, []string{"foo", "bar", "baz"})
t.Logf("INFO: verifyCommand error: %v", err)
if err == nil {
t.Fatal("verify expected 'need --certificate-oidc-issuer'")
}
}

0 comments on commit 8ebdf9c

Please sign in to comment.