[bitnami/redis] Add VIB tests (#28158)

* [bitnami/redis] Add VIB tests

Signed-off-by: Michiel <michield@vmware.com>
This commit is contained in:
Michiel 2023-03-28 16:34:21 +02:00 committed by GitHub
parent 226e987734
commit 96f92dfdb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 2 deletions

12
.vib/redis/goss/goss.yaml Normal file
View File

@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../redis/goss/redis.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,27 @@
file:
/opt/bitnami/redis/etc/redis.conf:
exists: true
mode: "0664"
contains:
- /port.*6379/
- /dir.*/bitnami/redis/data/
- /pidfile.*/opt/bitnami/redis/tmp/redis.pid/
- daemonize yes
command:
check-redis-server:
exec: redis-server /opt/bitnami/redis/etc/redis.conf && ps aux
exit-status: 0
stdout:
- redis-server 127.0.0.1:6379
check-redis-server-ssl:
exec: ldd /opt/bitnami/redis/bin/redis-server
exit-status: 0
stdout:
- libcrypto.so
- libssl.so
check-redis-cli-ssl:
exec: ldd /opt/bitnami/redis/bin/redis-cli
exit-status: 0
stdout:
- libcrypto.so
- libssl.so

17
.vib/redis/goss/vars.yaml Normal file
View File

@ -0,0 +1,17 @@
binaries:
- gosu
- redis-cli
- redis-server
- wait-for-port
directories:
- mode: "0775"
paths:
- /bitnami
- /bitnami/redis
- /bitnami/redis/data
- /opt/bitnami/redis
- /opt/bitnami/redis/etc
root_dir: /opt/bitnami
version:
bin_name: redis-server
flag: --version

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