-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add check-data-keys test for stripping .git
Signed-off-by: Johnny Bieren <[email protected]>
- Loading branch information
1 parent
631c156
commit 9fd84e4
Showing
2 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
tasks/check-data-keys/tests/test-check-data-keys-strip-git-suffix.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: test-check-data-keys-strip-git-suffix | ||
spec: | ||
description: | | ||
Run the check-data-keys task with a schema file that erroneously has .git/ in it. The task should strip that | ||
and properly download the schema file. | ||
workspaces: | ||
- name: tests-workspace | ||
tasks: | ||
- name: setup | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
taskSpec: | ||
workspaces: | ||
- name: data | ||
steps: | ||
- name: setup | ||
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
cat > "$(workspaces.data.path)/data.json" << EOF | ||
{ | ||
"releaseNotes": { | ||
"product_id": 123, | ||
"product_name": "Red Hat Openstack Product", | ||
"product_version": "1.2.3", | ||
"product_stream": "rhtas-tp1", | ||
"cpe": "cpe:/a:example:openstack:el8", | ||
"type": "RHSA", | ||
"cves": [ | ||
{ | ||
"key": "CVE-123", | ||
"component": "my-component-1" | ||
}, | ||
{ | ||
"key": "CVE-456", | ||
"component": "my-component-2", | ||
"packages": [ | ||
"my-package1", | ||
"my-package2" | ||
] | ||
}, | ||
{ | ||
"key": "CVE-789", | ||
"component": "my-component-3", | ||
"packages": [ | ||
] | ||
} | ||
], | ||
"issues": { | ||
"fixed": [ | ||
{ | ||
"id": "RHOSP-12345", | ||
"source": "issues.example.com" | ||
}, | ||
{ | ||
"id": "1234567", | ||
"source": "bugzilla.example.com" | ||
} | ||
] | ||
}, | ||
"content": { | ||
"images": [ | ||
{ | ||
"containerImage": "quay.io/example/openstack@sha256:abcde", | ||
"repository": "rhosp16-rhel8/openstack", | ||
"tags": [ | ||
"latest" | ||
], | ||
"architecture": "amd64", | ||
"signingKey": "abcde", | ||
"purl": "pkg:example/openstack@sha256:abcde?repository_url=quay.io/example/rhosp16-rhel8", | ||
"cves": { | ||
"fixed": { | ||
"CVE-2022-1234": { | ||
"packages": [ | ||
"pkg:golang/golang.org/x/net/[email protected]" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"synopsis": "test synopsis", | ||
"topic": "test topic", | ||
"description": "test description", | ||
"solution": "test solution", | ||
"references": [ | ||
"https://docs.example.com/some/example/release-notes" | ||
] | ||
}, | ||
"cdn": { | ||
"env": "qa" | ||
} | ||
} | ||
EOF | ||
- name: run-task | ||
taskRef: | ||
name: check-data-keys | ||
params: | ||
- name: dataPath | ||
value: "data.json" | ||
- name: systems | ||
value: | ||
- releaseNotes | ||
- cdn | ||
- name: schema | ||
value: "https://github.com/konflux-ci/release-service-catalog.git/raw/development/schema/dataKeys.json" | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
runAfter: | ||
- setup |