[bitnami/cosign] Add VIB tests (#26789)

* [bitnami/cosign] Add VIB tests

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Use custom version check and fix spdx test

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Improve spdx test sintax

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Remove VIB trigger

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Remove ending newlines

Signed-off-by: FraPazGal <fdepaz@vmware.com>

---------

Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
Francisco de Paz Galan
2023-03-09 13:00:26 +01:00
committed by GitHub
parent 907ffda97e
commit bd72e47e71
6 changed files with 54 additions and 4 deletions

View File

@@ -6,4 +6,4 @@ set -o pipefail
mapfile -t files < <( find /bitnami "$BITNAMI_ROOT_DIR" -name '.spdx-*.json' )
[[ ${#files[@]} -eq 0 ]] && exit 1
[[ ${#files[@]} -gt 0 ]]

View File

@@ -0,0 +1,9 @@
command:
check-app-version:
exec: cosign version 2>&1
exit-status: 0
stdout:
- {{ .Env.APP_VERSION }}
initialize-sigstore:
exec: cosign initialize
exit-status: 0

View File

@@ -0,0 +1,10 @@
gossfile:
# Goss tests exclusive to the current container
../../cosign/goss/cosign.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-binaries.yaml: {}
../../common/goss/templates/check-broken-symlinks.yaml: {}
../../common/goss/templates/check-ca-certs.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

View File

@@ -0,0 +1,3 @@
binaries:
- cosign
root_dir: /opt/bitnami

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -33,6 +34,19 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "cosign/goss/goss.yaml",
"vars_file": "cosign/goss/vars.yaml",
"remote": {
"workload": "deploy-cosign"
}
}
},
{
"action_id": "trivy",
"params": {

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -29,6 +30,19 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "cosign/goss/goss.yaml",
"vars_file": "cosign/goss/vars.yaml",
"remote": {
"workload": "deploy-cosign"
}
}
},
{
"action_id": "trivy",
"params": {
@@ -50,4 +64,4 @@
]
}
}
}
}