From 96f92dfdb3037ee2b14776f4414ad89d28fe72a7 Mon Sep 17 00:00:00 2001 From: Michiel Date: Tue, 28 Mar 2023 16:34:21 +0200 Subject: [PATCH] [bitnami/redis] Add VIB tests (#28158) * [bitnami/redis] Add VIB tests Signed-off-by: Michiel --- .vib/redis/goss/goss.yaml | 12 ++++++++++++ .vib/redis/goss/redis.yaml | 27 +++++++++++++++++++++++++++ .vib/redis/goss/vars.yaml | 17 +++++++++++++++++ .vib/redis/vib-publish.json | 18 +++++++++++++++++- .vib/redis/vib-verify.json | 18 +++++++++++++++++- 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 .vib/redis/goss/goss.yaml create mode 100644 .vib/redis/goss/redis.yaml create mode 100644 .vib/redis/goss/vars.yaml diff --git a/.vib/redis/goss/goss.yaml b/.vib/redis/goss/goss.yaml new file mode 100644 index 000000000000..d4f303ca4680 --- /dev/null +++ b/.vib/redis/goss/goss.yaml @@ -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: {} diff --git a/.vib/redis/goss/redis.yaml b/.vib/redis/goss/redis.yaml new file mode 100644 index 000000000000..10778775252f --- /dev/null +++ b/.vib/redis/goss/redis.yaml @@ -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 diff --git a/.vib/redis/goss/vars.yaml b/.vib/redis/goss/vars.yaml new file mode 100644 index 000000000000..2f60f1655200 --- /dev/null +++ b/.vib/redis/goss/vars.yaml @@ -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 diff --git a/.vib/redis/vib-publish.json b/.vib/redis/vib-publish.json index a484d2fc349a..f4ee9b9aafb6 100644 --- a/.vib/redis/vib-publish.json +++ b/.vib/redis/vib-publish.json @@ -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": { diff --git a/.vib/redis/vib-verify.json b/.vib/redis/vib-verify.json index a34e8aee9161..2e2a1520d4f6 100644 --- a/.vib/redis/vib-verify.json +++ b/.vib/redis/vib-verify.json @@ -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": {