From 8878127c77f60dda388bb5ed51187814c12838c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n=20Garc=C3=ADa?= Date: Mon, 2 Sep 2024 17:20:58 +0200 Subject: [PATCH] [bitnami/zipkin] chore: :construction_worker: :white_check_mark: Add VIB tests (#71761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [bitnami/zipkin] chore: :construction_worker: :white_check_mark: Add VIB tests Signed-off-by: Javier J. Salmerón García * chore: :wrench: Update references Signed-off-by: Javier J. Salmerón García --------- Signed-off-by: Javier J. Salmerón García Signed-off-by: nenych --- .vib/zipkin/goss/goss.yaml | 14 +++++++ .vib/zipkin/goss/vars.yaml | 11 ++++++ .vib/zipkin/goss/zipkin.yaml | 16 ++++++++ .vib/zipkin/vib-verify.json | 73 ++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 .vib/zipkin/goss/goss.yaml create mode 100644 .vib/zipkin/goss/vars.yaml create mode 100644 .vib/zipkin/goss/zipkin.yaml create mode 100644 .vib/zipkin/vib-verify.json diff --git a/.vib/zipkin/goss/goss.yaml b/.vib/zipkin/goss/goss.yaml new file mode 100644 index 0000000000000..34f5c2e71bae1 --- /dev/null +++ b/.vib/zipkin/goss/goss.yaml @@ -0,0 +1,14 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Load scripts from .vib/common/goss/templates + ../../zipkin/goss/zipkin.yaml: {} + ../../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/zipkin/goss/vars.yaml b/.vib/zipkin/goss/vars.yaml new file mode 100644 index 0000000000000..3247d693c0c2e --- /dev/null +++ b/.vib/zipkin/goss/vars.yaml @@ -0,0 +1,11 @@ +binaries: + - java + - start-zipkin +directories: + - paths: + - /opt/bitnami/zipkin +root_dir: /opt/bitnami +# The application does not have a --version flag, but the server logs do show the version +version: + bin_name: timeout + flag: --preserve-status 7 bash -c "cd /opt/bitnami/zipkin; start-zipkin" || true diff --git a/.vib/zipkin/goss/zipkin.yaml b/.vib/zipkin/goss/zipkin.yaml new file mode 100644 index 0000000000000..2aab40b2ac043 --- /dev/null +++ b/.vib/zipkin/goss/zipkin.yaml @@ -0,0 +1,16 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +user: + zipkin: + exists: true + uid: 1001 + gid: 0 +command: + run-zipkin: + # We need a different port to not collide with the version check + exec: export QUERY_PORT=9044; cd /opt/bitnami/zipkin; timeout --preserve-status 12 start-zipkin 2>&1 || true + timeout: 15000 + exit-status: 0 + stdout: + - /Serving HTTP at.*9044/ diff --git a/.vib/zipkin/vib-verify.json b/.vib/zipkin/vib-verify.json new file mode 100644 index 0000000000000..4a272817a7621 --- /dev/null +++ b/.vib/zipkin/vib-verify.json @@ -0,0 +1,73 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64", + "linux/arm64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "zipkin/goss/goss.yaml", + "vars_file": "zipkin/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-zipkin" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "LOW", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}