mirror of
https://github.com/bitnami/containers.git
synced 2026-03-29 16:27:49 +08:00
[bitnami/golang] Add VIB tests (#24157)
* [bitnami/golang] Add VIB tests Signed-off-by: FraPazGal <fdepaz@vmware.com> * Remove VIB trigger Signed-off-by: FraPazGal <fdepaz@vmware.com> * Update pipelines' DSL definitions Signed-off-by: FraPazGal <fdepaz@vmware.com> * Remove VIB trigger Signed-off-by: FraPazGal <fdepaz@vmware.com> * Apply suggestions and launch verification Signed-off-by: FraPazGal <fdepaz@vmware.com> * Remove VIB trigger Signed-off-by: FraPazGal <fdepaz@vmware.com> --------- Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
committed by
GitHub
parent
fded8c3d26
commit
1d5b98b524
14
.vib/golang/goss/golang.yaml
Normal file
14
.vib/golang/goss/golang.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
command:
|
||||
# Major and Minor versions are often shown as "x.0" and "x.y" instead of "x.0.0" and "x.y.0"
|
||||
check-app-version:
|
||||
exec: go version | grep "$(echo $APP_VERSION | sed -E 's|([0-9]+\.[0-9]+)\.0$|\1|g')"
|
||||
exit-status: 0
|
||||
check-go-build:
|
||||
{{- $filename := printf "test_%s" (randAlpha 5) }}
|
||||
exec: |
|
||||
echo 'package main; import "fmt"; func main() { fmt.Println("Hello VIB") }' > {{ $filename }}.go && \
|
||||
go build {{ $filename }}.go && \
|
||||
./{{ $filename }}
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- Hello VIB
|
||||
9
.vib/golang/goss/goss.yaml
Normal file
9
.vib/golang/goss/goss.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
gossfile:
|
||||
# Goss tests exclusive to the current container
|
||||
../../golang/goss/golang.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: {}
|
||||
3
.vib/golang/goss/vars.yaml
Normal file
3
.vib/golang/goss/vars.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
binaries:
|
||||
- go
|
||||
root_dir: /opt/bitnami
|
||||
@@ -3,7 +3,8 @@
|
||||
"resources": {
|
||||
"url": "{VIB_ENV_CONTAINER_URL}",
|
||||
"path": "{VIB_ENV_PATH}"
|
||||
}
|
||||
},
|
||||
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
|
||||
},
|
||||
"phases": {
|
||||
"package": {
|
||||
@@ -33,6 +34,21 @@
|
||||
},
|
||||
"verify": {
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib"
|
||||
},
|
||||
"tests_file": "golang/goss/goss.yaml",
|
||||
"vars_file": "golang/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-golang"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"resources": {
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "{VIB_ENV_PATH}"
|
||||
}
|
||||
},
|
||||
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
|
||||
},
|
||||
"phases": {
|
||||
"package": {
|
||||
@@ -29,6 +30,21 @@
|
||||
},
|
||||
"verify": {
|
||||
"actions": [
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib"
|
||||
},
|
||||
"tests_file": "golang/goss/goss.yaml",
|
||||
"vars_file": "golang/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-golang"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
|
||||
Reference in New Issue
Block a user