Skip to content

Commit

Permalink
[bitnami/superset] Add VIB tests
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ruiz <[email protected]>
  • Loading branch information
migruiz4 committed Jun 4, 2024
1 parent 52a155b commit a281e83
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .vib/celerybeat-schedule.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'entries', (2048, 531)
'__version__', (512, 15)
'tz', (1024, 4)
'utc_enabled', (1536, 4)
Binary file added .vib/celerybeat-schedule.dat
Binary file not shown.
4 changes: 4 additions & 0 deletions .vib/celerybeat-schedule.dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'entries', (2048, 531)
'__version__', (512, 15)
'tz', (1024, 4)
'utc_enabled', (1536, 4)
14 changes: 14 additions & 0 deletions .vib/superset/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
17 changes: 17 additions & 0 deletions .vib/superset/goss/superset.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
27 changes: 27 additions & 0 deletions .vib/superset/goss/vars.yaml
Original file line number Diff line number Diff line change
@@ -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
75 changes: 75 additions & 0 deletions .vib/superset/vib-verify.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
]
}
}
}

0 comments on commit a281e83

Please sign in to comment.