Skip to content

Commit

Permalink
Merge pull request #1891 from lcarva/EC-732
Browse files Browse the repository at this point in the history
Add acceptance test for TIMEOUT Task param
  • Loading branch information
lcarva authored Aug 29, 2024
2 parents 6fb93b0 + f6f843b commit 9160ce6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/root/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func NewRootCmd() *cobra.Command {
// Create a new context now that flags have been parsed so a custom timeout can be used.
ctx, cancel := context.WithTimeout(cmd.Context(), globalTimeout)
cmd.SetContext(ctx)
log.Debugf("globalTimeout is %d", globalTimeout)

// if trace is enabled setup CPU profiling
var cpuprofile *os.File
Expand Down
18 changes: 18 additions & 0 deletions features/task_validate_image.feature
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,24 @@ Feature: Verify Enterprise Contract Tekton Tasks
Then the task should succeed
And the task logs for step "debug-log" should contain "Using provided effective time 2020-01-01T00:00:00Z"

Scenario: Timeout is honored
Given a working namespace
And a key pair named "known"
And an image named "acceptance/timeout"
And a valid image signature of "acceptance/timeout" image signed by the "known" key
And a valid attestation of "acceptance/timeout" signed by the "known" key
And a cluster policy with content:
```
{"publicKey": ${known_PUBLIC_KEY}}
```
When version 0.1 of the task named "verify-enterprise-contract" is run with parameters:
| IMAGES | {"components": [{"containerImage": "${REGISTRY}/acceptance/timeout"}]} |
| POLICY_CONFIGURATION | ${NAMESPACE}/${POLICY_NAME} |
| IGNORE_REKOR | true |
| TIMEOUT | 666s |
Then the task should succeed
And the task logs for step "debug-log" should contain "globalTimeout is 666000000000"

Scenario: SSL_CERT_DIR environment variable is customized
Given a working namespace
And a key pair named "known"
Expand Down

0 comments on commit 9160ce6

Please sign in to comment.