Skip to content

Commit

Permalink
Update tests for new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Nov 1, 2023
1 parent 2089d31 commit 86f16ad
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions agent/integration/job_verification_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func TestJobVerification(t *testing.T) {
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().NotCalled() },
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{"⚠️ ERROR"},
expectLogsContain: []string{"+++ ⛔"},
},
{
name: "when job signature is invalid, and JobVerificationFailureBehaviour is warn, it warns and runs the job",
Expand All @@ -275,7 +275,7 @@ func TestJobVerification(t *testing.T) {
verificationJWKS: jwksFromKeys(t, symmetricJWKFor(t, signingKeyAlpacas)),
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().Once().AndExitWith(0) },
expectedExitStatus: "0",
expectLogsContain: []string{"⚠️ WARNING"},
expectLogsContain: []string{"+++ ⚠️"},
},
{
name: "when job signature is valid, it runs the job",
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestJobVerification(t *testing.T) {
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().NotCalled() },
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{"⚠️ ERROR"},
expectLogsContain: []string{"+++ ⛔"},
},
{
name: "when job signature is missing, and JobVerificationFailureBehaviour is warn, it warns and runs the job",
Expand All @@ -331,7 +331,7 @@ func TestJobVerification(t *testing.T) {
verificationJWKS: jwksFromKeys(t, symmetricJWKFor(t, signingKeyLlamas)),
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().Once().AndExitWith(0) },
expectedExitStatus: "0",
expectLogsContain: []string{"⚠️ WARNING"},
expectLogsContain: []string{"+++ ⚠️"},
},
{
name: "when the step signature matches, but the job doesn't match the step, it fails signature verification",
Expand All @@ -344,7 +344,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand All @@ -359,7 +359,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand All @@ -374,7 +374,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand All @@ -389,8 +389,8 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"but no verification key was provided, so the job can't be verified",
"+++ ⛔",
"but no verification key was provided",
},
},
{
Expand All @@ -404,7 +404,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"signature verification failed",
},
},
Expand All @@ -419,7 +419,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand All @@ -434,7 +434,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"signature verification failed",
},
},
Expand All @@ -460,7 +460,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand All @@ -475,7 +475,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"job does not match signed step",
},
},
Expand Down Expand Up @@ -509,7 +509,7 @@ func TestJobVerification(t *testing.T) {
expectedExitStatus: "-1",
expectedSignalReason: agent.SignalReasonSignatureRejected,
expectLogsContain: []string{
"⚠️ ERROR",
"+++ ⛔",
"signature verification failed",
},
},
Expand Down

0 comments on commit 86f16ad

Please sign in to comment.