[bitnami/suitecrm] Add VIB tests (#33421)

Signed-off-by: Marcos Bjoerkelund <marcosbd@vmware.com>
This commit is contained in:
Marcos Bjoerkelund
2023-05-24 16:27:12 +02:00
committed by GitHub
parent d4f77f0b30
commit 78d685aa05
5 changed files with 124 additions and 2 deletions
+13
View File
@@ -0,0 +1,13 @@
gossfile:
# Goss tests exclusive to the current container
../../suitecrm/goss/suitecrm.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-apache-libphp.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-directories.yaml: {}
../../common/goss/templates/check-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
+48
View File
@@ -0,0 +1,48 @@
command:
check-app-version:
# suitecrm_version.php is located at the root path in SuiteCRM 7.x, but in 8.x it can be found in public/legacy
exec: find /opt/bitnami/suitecrm -maxdepth 3 -type f -name suitecrm_version.php -exec grep -Eo "version = '([0-9.]+)'" {} \;
exit-status: 0
stdout:
- version = '{{ .Env.APP_VERSION }}'
check-enabled-modules:
exec: php -m
exit-status: 0
stdout:
{{ range $module := .Vars.phpmodules }}
- "{{ $module }}"
{{ end }}
file:
/opt/bitnami/php/etc/php.ini:
exists: true
filetype: file
contains:
- post_max_size = 60M
- upload_max_filesize = 128M
/opt/bitnami/suitecrm/node_modules:
exists: false
# Disabling opcache to be able to modify parameters using the system setting panel
/opt/bitnami/php/etc/php.ini:
exists: true
filetype: file
contains:
- opcache.enable = Off
# HTTP vhost should have been properly rendered
/opt/bitnami/apache/conf/vhosts/suitecrm-vhost.conf:
exists: true
filetype: file
contains:
- /DocumentRoot.*/opt/bitnami/suitecrm/
# HTTPS vhost should have been properly rendered
/opt/bitnami/apache/conf/vhosts/suitecrm-https-vhost.conf:
exists: true
filetype: file
contains:
- "SSLEngine on"
- /DocumentRoot.*/opt/bitnami/suitecrm/
group:
daemon:
exists: true
user:
daemon:
exists: true
+29
View File
@@ -0,0 +1,29 @@
binaries:
- apachectl
- mariadb
- php
- render-template
directories:
- mode: "0775"
paths:
- /bitnami/suitecrm
- /opt/bitnami/suitecrm
- /opt/bitnami/suitecrm/tmp
- /opt/bitnami/suitecrm/vendor
files:
- paths:
- /opt/bitnami/suitecrm/composer.json
phpmodules:
# Based on https://docs.suitecrm.com/admin/installation-guide/downloading-installing/#_recommended_installation_pre_requisites
- curl
- json
- mbstring
- mysqli
- pcre
- xml
- zip
- zlib
root_dir: /opt/bitnami
sed_in_place:
exclude_paths:
- \/opt\/bitnami\/suitecrm\/vendor\/.*
+17 -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,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "suitecrm/goss/goss.yaml",
"vars_file": "suitecrm/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-suitecrm"
}
}
}
},
{
"action_id": "trivy",
"params": {
+17 -1
View File
@@ -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": "suitecrm/goss/goss.yaml",
"vars_file": "suitecrm/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-suitecrm"
}
}
}
},
{
"action_id": "trivy",
"params": {