Skip to content

Commit

Permalink
Update tests with new results
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfeidau committed Sep 6, 2024
1 parent d4b6d14 commit 1bd8d64
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions agent/integration/job_verification_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,32 @@ func TestJobVerification(t *testing.T) {
},
{
name: "when the step has a signature, but the JobRunner doesn't have a verification key, it fails signature verification",
agentConf: agent.AgentConfiguration{},
agentConf: agent.AgentConfiguration{VerificationFailureBehaviour: agent.VerificationBehaviourBlock},
job: job,
repositoryURL: defaultRepositoryURL,
signingKey: symmetricJWKFor(t, signingKeyLlamas),
verificationJWKS: nil,
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().NotCalled() },
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectedSignalReason: agent.SignalReasonUnableToVerifySignature,
expectLogsContain: []string{
"+++ ⛔",
"cannot verify signature. JWK for pipeline verification is not configured",
},
},
{
name: "when the step has a signature, but the JobRunner doesn't have a verification key, and JobVerificationFailureBehaviour is warn, it warns and runs the job",
agentConf: agent.AgentConfiguration{VerificationFailureBehaviour: agent.VerificationBehaviourWarn},
job: job,
repositoryURL: defaultRepositoryURL,
signingKey: symmetricJWKFor(t, signingKeyLlamas),
verificationJWKS: nil,
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().Once().AndExitWith(0) },
expectedExitStatus: "0",
expectedSignalReason: "",
expectLogsContain: []string{
"+++ ⛔",
"but no verification key was provided",
"cannot verify signature. JWK for pipeline verification is not configured",
},
},
{
Expand Down

0 comments on commit 1bd8d64

Please sign in to comment.