[bitnami/odoo] Add VIB tests (#33619)

Signed-off-by: Marcos Bjoerkelund <marcosbd@vmware.com>
This commit is contained in:
Marcos Bjoerkelund 2023-05-24 17:10:38 +02:00 committed by GitHub
parent 4f18ff733d
commit 54b3d86941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 107 additions and 99 deletions

View File

@ -1,96 +0,0 @@
{
"context": {
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"phases": {
"package": {
"actions": [
{
"action_id": "container-image-package",
"params": {
"application": {
"details": {
"name": "{VIB_ENV_CONTAINER}",
"tag": "{VIB_ENV_TAG}"
}
},
"architectures": [
"linux/amd64"
]
}
},
{
"action_id": "container-image-lint",
"params": {
"threshold": "error"
}
}
]
},
"verify": {
"actions": [
{
"action_id": "trivy",
"params": {
"threshold": "CRITICAL",
"vuln_type": [
"OS"
]
}
},
{
"action_id": "grype",
"params": {
"threshold": "CRITICAL",
"package_type": [
"OS"
]
}
},
{
"action_id": "osspi-application",
"params": {
"additional_packages_file": "osspi-packages-amd64.json",
"scan_type": "BASE_OS",
"osm": {
"associated_bossd_release": "{VIB_ENV_BOSSD_RELEASE_ID}",
"product_name": "main-catalog-{VIB_ENV_CONTAINER}",
"product_version": "{VIB_ENV_APP_VERSION}-{VIB_ENV_OS_FLAVOUR}-container"
},
"resources": {
"url": "{VIB_ENV_PACKAGES_JSON_URL}",
"path": "/{VIB_ENV_PATH}",
"authn": {
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
}
}
}
]
},
"publish": {
"actions": [
{
"action_id": "container-image-publish",
"params": {
"metadata": {
"tags": {VIB_ENV_ROLLING_TAGS}
},
"repository": {
"kind": "OCI",
"url": "{VIB_ENV_REGISTRY_URL}",
"authn": {
"username": "{VIB_ENV_REGISTRY_USERNAME}",
"password": "{VIB_ENV_REGISTRY_PASSWORD}"
}
}
}
}
]
}
}
}

View File

@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@ -32,6 +33,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "odoo/goss/goss.yaml",
"vars_file": "odoo/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-odoo"
}
}
}
},
{
"action_id": "trivy",
"params": {

13
.vib/odoo/goss/goss.yaml Normal file
View File

@ -0,0 +1,13 @@
gossfile:
# Goss tests exclusive to the current container
../../odoo/goss/odoo.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-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

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

@ -0,0 +1,12 @@
command:
check-virtualenv:
exec: bash -c '. /opt/bitnami/odoo/venv/bin/activate; pip install tool; pip uninstall -y tool'
exit-status: 0
stdout:
- /Successfully installed.* tool-/
group:
odoo:
exists: true
user:
odoo:
exists: true

31
.vib/odoo/goss/vars.yaml Normal file
View File

@ -0,0 +1,31 @@
binaries:
- node
- odoo-bin
- psql
- python
- render-template
directories:
- mode: "0775"
paths:
- /bitnami/odoo
- /opt/bitnami/odoo/addons
- /opt/bitnami/odoo/conf
- /opt/bitnami/odoo/data
- /opt/bitnami/odoo/log
- /opt/bitnami/odoo/tmp/pids
files:
- paths:
- /opt/bitnami/odoo/package.json
linked_libraries:
exclude_paths:
# Ignore binaries bundled within Python libs
- .*\/lib\/python[0-9.]*\/site-packages\/.*\.libs\/lib.*\.so\..*
sed_in_place:
exclude_paths:
# Ignore Odoo scripts from upstream
- \/opt\/bitnami\/odoo\/lib\/.*
root_dir: /opt/bitnami
version:
bin_name: odoo
# Convert the version format to the one used by the APP_VERSION environment variable
flag: --version | sed -E 's/([0-9]+\.[0-9]+)-([0-9]+)/\1.\2/'

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