[bitnami/joomla] Add VIB tests (#33366)

* [bitnami/joomla] Add VIB tests

Signed-off-by: Andrés Bono <andresbono@vmware.com>

* Apply suggestions from review

Signed-off-by: Andrés Bono <andresbono@vmware.com>

---------

Signed-off-by: Andrés Bono <andresbono@vmware.com>
This commit is contained in:
Andrés Bono
2023-05-16 14:10:02 +02:00
committed by GitHub
parent e730ad42cf
commit 2923be0c1c
5 changed files with 113 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
gossfile:
# Goss tests exclusive to the current container
../../joomla/goss/joomla.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: {}

View File

@@ -0,0 +1,50 @@
command:
check-app-version:
exec: grep {{ .Env.APP_VERSION }} /opt/bitnami/joomla/administrator/manifests/files/joomla.xml
exit-status: 0
# Placeholders in SQL installation files should have been substituted
sql-placeholders:
exec: grep "#__" /opt/bitnami/joomla/installation/sql/mysql/*.sql | wc -l
exit-status: 0
stdout:
- /^0/
file:
# Joomla! should have been configured based on build-time defaults
/opt/bitnami/joomla/configuration.php:
exists: true
filetype: file
contains:
- "public $db = 'bitnami_joomla'"
# PHP settings should have been configured
/opt/bitnami/php/etc/php.ini:
exists: true
filetype: file
contains:
- "memory_limit = 256M"
# HTTP vhost should have been properly rendered
/opt/bitnami/apache/conf/vhosts/joomla-vhost.conf:
exists: true
filetype: file
contains:
- /DocumentRoot.*/opt/bitnami/joomla/
- "^/administrator$"
# HTTPs vhost should have been properly rendered
/opt/bitnami/apache/conf/vhosts/joomla-https-vhost.conf:
exists: true
filetype: file
contains:
- "SSLEngine on"
- /DocumentRoot.*/opt/bitnami/joomla/
- "^/administrator$"
# RewriteRule should have been inserted in the htaccess file
/opt/bitnami/apache/conf/vhosts/htaccess/joomla-htaccess.conf:
exists: true
filetype: file
contains:
- 'RewriteRule "^administrator$"'
group:
daemon:
exists: true
user:
daemon:
exists: true

View File

@@ -0,0 +1,16 @@
binaries:
- apachectl
- mariadb
- php
- render-template
files:
- paths:
- /opt/bitnami/joomla/.htaccess
directories:
- mode: "0775"
paths:
- /bitnami/joomla
- /opt/bitnami/joomla
- /opt/bitnami/joomla/logs
- /opt/bitnami/joomla/tmp
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": {
@@ -82,6 +83,21 @@
}
}
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "joomla/goss/goss.yaml",
"vars_file": "joomla/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-joomla"
}
}
}
}
]
},

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": "joomla/goss/goss.yaml",
"vars_file": "joomla/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-joomla"
}
}
}
}
]
}