From a281e834717479f50a28220fc6f43c1722d6a56c Mon Sep 17 00:00:00 2001 From: Miguel Ruiz Date: Tue, 4 Jun 2024 17:08:34 +0200 Subject: [PATCH] [bitnami/superset] Add VIB tests Signed-off-by: Miguel Ruiz --- .vib/celerybeat-schedule.bak | 4 ++ .vib/celerybeat-schedule.dat | Bin 0 -> 2579 bytes .vib/celerybeat-schedule.dir | 4 ++ .vib/superset/goss/goss.yaml | 14 ++++++ .vib/superset/goss/superset.yaml | 17 +++++++ .vib/superset/goss/vars.yaml | 27 +++++++++++ .vib/superset/vib-verify.json | 75 +++++++++++++++++++++++++++++++ 7 files changed, 141 insertions(+) create mode 100644 .vib/celerybeat-schedule.bak create mode 100644 .vib/celerybeat-schedule.dat create mode 100644 .vib/celerybeat-schedule.dir create mode 100644 .vib/superset/goss/goss.yaml create mode 100644 .vib/superset/goss/superset.yaml create mode 100644 .vib/superset/goss/vars.yaml create mode 100644 .vib/superset/vib-verify.json diff --git a/.vib/celerybeat-schedule.bak b/.vib/celerybeat-schedule.bak new file mode 100644 index 0000000000000..d3eb0f8462f36 --- /dev/null +++ b/.vib/celerybeat-schedule.bak @@ -0,0 +1,4 @@ +'entries', (2048, 531) +'__version__', (512, 15) +'tz', (1024, 4) +'utc_enabled', (1536, 4) diff --git a/.vib/celerybeat-schedule.dat b/.vib/celerybeat-schedule.dat new file mode 100644 index 0000000000000000000000000000000000000000..c34bf7ab063b8421c6a4f40c9135379c37f1ce88 GIT binary patch literal 2579 zcmeH}Pj3=I7{-?_g|htvv=$1jt+xCJx2V+^uZ;&KdKhc6dLgikT~b_lmf6IbY_ccf z*-zoe@Z)&U#1G)XnT4fAsTWQp?0cBW%ub%?nK`^aS9Ty3w74Wm7VUK{)>r$wL0fi* zS_tSm<>RH=qz$IL9<4t!nRTgPsbB<*fZl2_%Gw{OGM+#_Rl?sx!Hsf$>Blbw^`_nK zu(sJ(&M9j!W+_E51u5$ZGwFV z2SV_UgS!le1V>te%lg;a&@ZUjs_PxvFzp^PLLtNJNi-j+(r?2SGs18{JVp>U4jmjZWC*hVV}+d1&GGUTDw*hh o40)kYASikYBUUJR;|a>c*bEioF@jJ#c2G5vLsqy?@W5980Ln8owEzGB literal 0 HcmV?d00001 diff --git a/.vib/celerybeat-schedule.dir b/.vib/celerybeat-schedule.dir new file mode 100644 index 0000000000000..d3eb0f8462f36 --- /dev/null +++ b/.vib/celerybeat-schedule.dir @@ -0,0 +1,4 @@ +'entries', (2048, 531) +'__version__', (512, 15) +'tz', (1024, 4) +'utc_enabled', (1536, 4) diff --git a/.vib/superset/goss/goss.yaml b/.vib/superset/goss/goss.yaml new file mode 100644 index 0000000000000..9645561b3b7c2 --- /dev/null +++ b/.vib/superset/goss/goss.yaml @@ -0,0 +1,14 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Goss tests exclusive to the current container + ../../superset/goss/superset.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../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/superset/goss/superset.yaml b/.vib/superset/goss/superset.yaml new file mode 100644 index 0000000000000..dbe9081ede785 --- /dev/null +++ b/.vib/superset/goss/superset.yaml @@ -0,0 +1,17 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +command: + check-app-version: + exec: echo "SECRET_KEY='123456789abcdef'" > /tmp/superset_config.py && SUPERSET_CONFIG_PATH="/tmp/superset_config.py" superset version + exit-status: 0 + stdout: + - "{{ .Env.APP_VERSION }}" + check-subpackages: + # Check python packages that should have been installed + exec: . /opt/bitnami/superset/venv/bin/activate && pip list + exit-status: 0 + stdout: + {{ range $subpackage := .Vars.subpackages }} + - "{{ $subpackage }}" + {{ end }} diff --git a/.vib/superset/goss/vars.yaml b/.vib/superset/goss/vars.yaml new file mode 100644 index 0000000000000..b854e9d533cc4 --- /dev/null +++ b/.vib/superset/goss/vars.yaml @@ -0,0 +1,27 @@ +binaries: + - celery + - gunicorn + - superset + - python + - pip +linked_libraries: + exclude_paths: + # Ignore python venv executable scripts + - /opt/bitnami/superset/venv/.* +directories: + - mode: "0775" + paths: + - /opt/bitnami/superset + - /opt/bitnami/superset/superset_home + - /opt/bitnami/superset/logs + - /opt/bitnami/superset/tmp +root_dir: /opt/bitnami +subpackages: + - celery + - flower + - Flask + - gunicorn + - mysql + - mysqlclient + - psycopg2 + - redis diff --git a/.vib/superset/vib-verify.json b/.vib/superset/vib-verify.json new file mode 100644 index 0000000000000..a12b3357985e6 --- /dev/null +++ b/.vib/superset/vib-verify.json @@ -0,0 +1,75 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "timeout_minutes": 60, + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64", + "linux/arm64" + ], + "timeout_minutes": 50 + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "superset/goss/goss.yaml", + "vars_file": "superset/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-superset" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "LOW", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}