Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/hubble-ui] Add VIB basic tests #67312

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vib/hubble-relay/goss/hubble-relay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ command:
check-app-version:
exec: hubble-relay version | grep "$(echo $APP_VERSION | sed -E 's|([0-9]+\.[0-9]+)\.0$|\1|g')"
exit-status: 0
check-cilium-operator-help:
check-hubble-relay-help:
exec: hubble-relay help
exit-status: 0
stdout:
Expand Down
13 changes: 13 additions & 0 deletions .vib/hubble-ui-backend/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

gossfile:
# Goss tests exclusive to the current container
../../hubble-ui-backend/goss/hubble-ui-backend.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-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
11 changes: 11 additions & 0 deletions .vib/hubble-ui-backend/goss/hubble-ui-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

command:
# This binary doesn't support any 'help' nor 'version' command or flags
# so we just check that it runs
check-hubble-ui-backend:
exec: backend
exit-status: 1
stderr:
- "TLS to hubble-relay is not enabled"
6 changes: 6 additions & 0 deletions .vib/hubble-ui-backend/goss/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
binaries:
- backend
root_dir: /opt/bitnami
directories:
- paths:
- /opt/bitnami/hubble-ui-backend
73 changes: 73 additions & 0 deletions .vib/hubble-ui-backend/vib-verify.json
Original file line number Diff line number Diff line change
@@ -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": "trivy",
"params": {
"threshold": "LOW",
"vuln_type": [
"OS"
]
}
},
{
"action_id": "grype",
"params": {
"threshold": "CRITICAL",
"package_type": [
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "hubble-ui-backend/goss/goss.yaml",
"vars_file": "hubble-ui-backend/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-hubble-ui-backend"
}
}
}
}
]
}
}
}
15 changes: 15 additions & 0 deletions .vib/hubble-ui/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

gossfile:
# Goss tests exclusive to the current container
../../hubble-ui/goss/hubble-ui.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-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
26 changes: 26 additions & 0 deletions .vib/hubble-ui/goss/hubble-ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

file:
/opt/bitnami/nginx/conf/nginx.conf:
exists: true
/opt/bitnami/nginx/logs/access.log:
exists: true
filetype: symlink
linked-to: /dev/stdout
/opt/bitnami/nginx/logs/error.log:
exists: true
filetype: symlink
linked-to: /dev/stderr
/app:
exists: true
filetype: symlink
linked-to: /opt/bitnami/hubble-ui/public
/opt/bitnami/hubble-ui/public/index.html:
exists: true
contents:
- "Hubble UI"
command:
test-config:
exec: nginx -t
exit-status: 0
17 changes: 17 additions & 0 deletions .vib/hubble-ui/goss/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
binaries:
- nginx
- render-template
directories:
- mode: "0775"
paths:
- /opt/bitnami/nginx/conf
- /opt/bitnami/nginx/conf/bitnami
- /opt/bitnami/nginx/conf/server_blocks
- /opt/bitnami/nginx/logs
- /opt/bitnami/nginx/tmp
- paths:
- /certs
- /opt/bitnami/hubble-ui/public
ports:
http: 8080
root_dir: /opt/bitnami
73 changes: 73 additions & 0 deletions .vib/hubble-ui/vib-verify.json
Original file line number Diff line number Diff line change
@@ -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": "hubble-ui/goss/goss.yaml",
"vars_file": "hubble-ui/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-hubble-ui"
}
}
}
},
{
"action_id": "trivy",
"params": {
"threshold": "LOW",
"vuln_type": [
"OS"
]
}
},
{
"action_id": "grype",
"params": {
"threshold": "CRITICAL",
"package_type": [
"OS"
]
}
}
]
}
}
}
Loading