[bitnami/telegraf] Add VIB tests (#26723)

* [bitnami/telegraf] Add VIB tests

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

* Modify runtime_params

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

* Remove VIB trigger

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

* Update spdx test name

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

* Apply suggestions from code review

Co-authored-by: Jose Antonio Carmona <jcarmona@vmware.com>
Signed-off-by: Francisco de Paz Galan <fdepaz@vmware.com>

---------

Signed-off-by: FraPazGal <fdepaz@vmware.com>
Signed-off-by: Francisco de Paz Galan <fdepaz@vmware.com>
Co-authored-by: Jose Antonio Carmona <jcarmona@vmware.com>
This commit is contained in:
Francisco de Paz Galan
2023-03-09 09:42:53 +01:00
committed by GitHub
co-authored by Jose Antonio Carmona
parent 8497685c69
commit 361eecf901
6 changed files with 65 additions and 3 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
mapfile -t files < <( find /bitnami "$BITNAMI_ROOT_DIR" -name '.spdx-*.json' )
[[ ${#files[@]} -eq 0 ]] && exit 1
@@ -0,0 +1,10 @@
########################
# Checks there is at least a spdx file
# included in the bitnami directories
# Needed vars:
# - .Vars.root_dir
########################
command:
check-spdx:
exec: export BITNAMI_ROOT_DIR={{ .Vars.root_dir }} && ./common/goss/scripts/check-spdx.sh
exit-status: 0
+9
View File
@@ -0,0 +1,9 @@
gossfile:
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-app-version.yaml: {}
../../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: {}
+6
View File
@@ -0,0 +1,6 @@
binaries:
- telegraf
root_dir: /opt/bitnami
version:
bin_name: telegraf
flag: version
+15 -1
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": "telegraf/goss/goss.yaml",
"vars_file": "telegraf/goss/vars.yaml",
"remote": {
"workload": "deploy-telegraf"
}
}
},
{
"action_id": "trivy",
"params": {
+16 -2
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": "telegraf/goss/goss.yaml",
"vars_file": "telegraf/goss/vars.yaml",
"remote": {
"workload": "deploy-telegraf"
}
}
},
{
"action_id": "trivy",
"params": {
@@ -50,4 +64,4 @@
]
}
}
}
}