[bitnami/harbor-portal] Add VIB tests (#32324)

* [bitnami/harbor-portal] Add initial tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/harbor-portal] Delete harbor binary

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/harbor-portal] Add change in docker-compose file to trigger tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/harbor-portal] Add check for files

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/harbor-portal] Delete trigger in docker-compose file

Signed-off-by: Cori Avila <42420333+corico44@users.noreply.github.com>

---------

Signed-off-by: Cori Avila <amisericordi@vmware.com>
Signed-off-by: Cori Avila <42420333+corico44@users.noreply.github.com>
This commit is contained in:
Cori Avila
2023-05-15 18:44:35 +02:00
committed by GitHub
parent 36958b941c
commit da36f33215
5 changed files with 90 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../harbor-portal/goss/harbor-portal.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: {}

View File

@@ -0,0 +1,28 @@
group:
harbor:
exists: true
user:
harbor:
exists: true
file:
/opt/bitnami/harbor/nginx-conf:
exists: false
/opt/bitnami/nginx/conf:
exists: true
mode: "0775"
owner: harbor
filetype: directory
/opt/bitnami/nginx/conf/nginx.conf:
exists: true
contains:
- "/opt/bitnami/harbor"
- "/opt/bitnami/nginx/conf/mime.types"
command:
# Ensure permissions for Internal TLS
check-permissions-system-certs:
exec: ls -l /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/certs/ca-certificates.crt 2>/dev/null | grep ".*-rw-rw-r--.*harbor"
exit-status: 0
# Ensure a set of directories exist and the non-root user has write privileges to them
check-directories-exist-with-user:
exec: ls -dl /etc/ssl/certs /etc/pki/tls/certs/ 2>/dev/null | grep "drwxrwxr-x.*harbor"
exit-status: 0

View File

@@ -0,0 +1,16 @@
binaries:
- nginx
- render-template
directories:
- paths:
- /opt/bitnami/nginx/client_body_temp
- /opt/bitnami/nginx/proxy_temp
- /opt/bitnami/nginx/fastcgi_temp
- /opt/bitnami/nginx/scgi_temp
- /opt/bitnami/nginx/uwsgi_temp
- /opt/bitnami/nginx/conf
files:
- paths:
- /opt/bitnami/harbor/swagger.yaml
- /opt/bitnami/harbor/swagger.json
root_dir: /opt/bitnami

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