[bitnami/parse-dashboard] Add VIB tests (#30863)

* [bitnami/parse-dashboard] Add VIB tests

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

* Support owner and group as optional params for check-files

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

* Add VIB triggers

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

* Use grep instead of rgrep

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

* Fix app-version typo

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

* Simplify goss dirs and files templates

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>

* Apply suggestions

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

* Remove VIB trigger

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

* Remove testing file

Signed-off-by: FraPazGal <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-05-18 09:37:35 +02:00
committed by GitHub
co-authored by Jose Antonio Carmona
parent a9db986021
commit e48696b784
7 changed files with 99 additions and 23 deletions
@@ -6,19 +6,23 @@
# - .Vars.directories.paths (Array)
# Optional vars:
# - .Vars.directories.mode (String)
# - .Vars.directories.owner (String)
# - .Vars.directories.group (String)
########################
file:
{{ range .Vars.directories }}
{{ $mode := "" }}
{{ if contains "mode:" (. | toString) }}
{{ $mode = .mode }}
{{ end }}
{{ range $directory := .paths }}
{{ $directory }}:
{{ range $dirs := .Vars.directories }}
{{ range $path := .paths }}
{{ $path }}:
exists: true
filetype: directory
{{ if $mode }}
mode: "{{ $mode }}"
{{ if and (index $dirs "mode") }}
mode: "{{ printf "%s" $dirs.mode }}"
{{ end }}
{{ if and (index $dirs "owner") }}
owner: {{ printf "%s" $dirs.owner }}
{{ end }}
{{ if and (index $dirs "group") }}
group: {{ printf "%s" $dirs.group }}
{{ end }}
{{ end }}
{{ end }}
+13 -9
View File
@@ -6,19 +6,23 @@
# - .Vars.files.paths (Array)
# Optional vars:
# - .Vars.files.mode (String)
# - .Vars.files.owner (String)
# - .Vars.files.group (String)
########################
file:
{{ range .Vars.files }}
{{ $mode := "" }}
{{ if contains "mode:" (. | toString) }}
{{ $mode = .mode }}
{{ end }}
{{ range $file := .paths }}
{{ $file }}:
{{ range $files := .Vars.files }}
{{ range $path := .paths }}
{{ $path }}:
exists: true
filetype: file
{{ if $mode }}
mode: "{{ $mode }}"
{{ if and (index $files "mode") }}
mode: "{{ printf "%s" $files.mode }}"
{{ end }}
{{ if and (index $files "owner") }}
owner: {{ printf "%s" $files.owner }}
{{ end }}
{{ if and (index $files "group") }}
group: {{ printf "%s" $files.group }}
{{ end }}
{{ end }}
{{ end }}
+11
View File
@@ -0,0 +1,11 @@
gossfile:
# Goss tests exclusive to the current container
../../parse-dashboard/goss/parse-dashboard.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-directories.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
@@ -0,0 +1,12 @@
group:
parsedashboard:
exists: true
user:
parsedashboard:
exists: true
command:
check-app-version:
exec: grep "version" /opt/bitnami/parse-dashboard/package.json
exit-status: 0
stdout:
- {{ .Env.APP_VERSION }}
+13
View File
@@ -0,0 +1,13 @@
binaries:
- node
- python
directories:
- mode: "0775"
owner: "parsedashboard"
group: "root"
paths:
- /bitnami/parse-dashboard
- /opt/bitnami/parse-dashboard
- /opt/bitnami/parse-dashboard/tmp
- /opt/bitnami/parse-dashboard/logs
root_dir: /opt/bitnami
+20 -4
View File
@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -77,9 +78,24 @@
"url": "{VIB_ENV_PACKAGES_JSON_URL}",
"path": "/{VIB_ENV_PATH}",
"authn": {
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
}
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "parse-dashboard/goss/goss.yaml",
"vars_file": "parse-dashboard/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-parse-dashboard"
}
}
}
}
+17 -1
View File
@@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -46,6 +47,21 @@
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "parse-dashboard/goss/goss.yaml",
"vars_file": "parse-dashboard/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-parse-dashboard"
}
}
}
}
]
}