[bitnami/fluentd] Add VIB tests (#31115)

* [bitnami/fluentd] Add initial tests

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

* [bitnami/fluentd] Add check for directories and files

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

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

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

* [bitnami/fluentd] Modify check-version test

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

* [bitnami/fluentd] Fix check-no-pem-files test

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

* [bitnami/fluentd] Add check for directories

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

* [bitnami/fluentd] Change format for check gems test

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

* [bitnami/fluentd] Fix gem test

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

* [bitnami/fluentd] Fix check for plugin files

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

* [bitnami/fluentd] 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: corico44 <42420333+corico44@users.noreply.github.com>
Signed-off-by: Cori Avila <42420333+corico44@users.noreply.github.com>
This commit is contained in:
Cori Avila
2023-05-15 16:38:50 +02:00
committed by GitHub
parent ceb03ba1c4
commit 121489e35f
5 changed files with 97 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
command:
check-no-pem-files:
exec: find /opt/bitnami/fluentd -name "*.pem" | grep .
exit-status: 1
check-fluent-plugin-detect-exceptions:
# Ensure that all files have the correct permissions
exec: ls -l /opt/bitnami/fluentd/gems/fluent-plugin-detect-exceptions-*/lib/fluent/plugin/*.rb 2>/dev/null | grep -v ".*-rwxrwxr-x"
exit-status: 1
check-plugins:
exec: gem list --local
exit-status: 0
stdout:
{{ range $gem := .Vars.modules.gems }}
- "{{ $gem }}"
{{ end }}

View File

@@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../fluentd/goss/fluentd.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-app-version.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-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

View File

@@ -0,0 +1,36 @@
binaries:
- fluentd
- ruby
directories:
- mode: "0775"
paths:
- /opt/bitnami/fluentd/gems
- /opt/bitnami/fluentd/specifications
- /opt/bitnami/fluentd/cache
- /opt/bitnami/fluentd/doc
- /opt/bitnami/fluentd/conf
- /opt/bitnami/fluentd/logs
- /opt/bitnami/fluentd/plugins
modules:
gems:
- fluent-plugin-concat
- fluent-plugin-detect-exceptions
- fluent-plugin-elasticsearch
- fluent-plugin-grafana-loki
- fluent-plugin-kafka
- fluent-plugin-kubernetes_metadata_filter
- fluent-plugin-multi-format-parser
- fluent-plugin-prometheus
- fluent-plugin-rewrite-tag-filter
- fluent-plugin-s3
- fluent-plugin-systemd
- fluent-plugin-record-modifier
- oj
- json
- fluentd
- activesupport
- elasticsearch-xpack
version:
bin_name: fluentd
flag: --version
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": {
@@ -33,6 +34,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "fluentd/goss/goss.yaml",
"vars_file": "fluentd/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-fluentd"
}
}
}
},
{
"action_id": "trivy",
"params": {

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": "fluentd/goss/goss.yaml",
"vars_file": "fluentd/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-fluentd"
}
}
}
},
{
"action_id": "trivy",
"params": {