[bitnami/matomo] Add VIB tests (#34382)

* [bitnami/matomo] Add initial tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Add change in docker-compose file to trigger tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Use owner and group from directories template

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Fix check for directories

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Add check for vhost file and add version check

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Add check run and check version

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/matomo] Delete trigger in docker-compose file

Signed-off-by: Cori Avila <42420333+corico44@users.noreply.github.com>

---------

Signed-off-by: Cori Avila <amisericordi@vmware.com>
Signed-off-by: Cori Avila <42420333+corico44@users.noreply.github.com>
This commit is contained in:
Cori Avila
2023-05-25 16:48:13 +02:00
committed by GitHub
parent c98b4dd66f
commit ad12bed8bb
5 changed files with 113 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
gossfile:
# Goss tests exclusive to the current container
../../matomo/goss/matomo.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,44 @@
group:
daemon:
exists: true
user:
daemon:
exists: true
file:
# HTTPs vhost should have been properly rendered
/opt/bitnami/apache/conf/vhosts/matomo-https-vhost.conf:
exists: true
filetype: file
contains:
- "SSLEngine on"
- /DocumentRoot.*/opt/bitnami/matomo/
/opt/bitnami/apache/conf/vhosts/htaccess/matomo-htaccess.conf:
exists: false
/opt/bitnami/php/etc/php.ini:
exists: true
filetype: file
contains:
- "memory_limit = 256M"
- "mysqli.allow_local_infile = 1"
- "extension = maxminddb.so"
/opt/bitnami/matomo/piwik:
exists: false
/opt/bitnami/matomo/How to install Matomo.html:
exists: false
/opt/bitnami/matomo/licenses:
exists: false
/opt/bitnami/matomo/.buildcomplete:
exists: false
command:
# Since it is not done with sudo, the exit code is 1
check-app-version:
exec: php /opt/bitnami/matomo/console --version
exit-status: 1
stdout:
- {{ .Env.APP_VERSION }}
# Since it is not done with sudo, the exit code is 1
check-app-run:
exec: php /opt/bitnami/matomo/console config:get --section=database
exit-status: 1
stdout:
- "Mysql"

View File

@@ -0,0 +1,22 @@
binaries:
- apachectl
- ini-file
- php
- mysql
- render-template
directories:
- mode: "0775"
owner: daemon
group: root
paths:
- /opt/bitnami/matomo
- /opt/bitnami/matomo/tmp
- /opt/bitnami/matomo/misc/
- /opt/bitnami/matomo/misc/user
- /opt/bitnami/matomo/plugins
- /bitnami/matomo
files:
- paths:
- /opt/bitnami/matomo/piwik.js
- /opt/bitnami/matomo/piwik.php
root_dir: /opt/bitnami