[bitnami/harbor-registryctl] Add VIB tests (#30853)

* [bitnami/harbor-registryctl] Add initial tests

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

* [bitnami/harbor-registryctl] Fix registry binary check and add tests to check harbor_registryctl and registry binaries

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

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

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

* [bitnami/harbor-registryctl] Fix check for /var/lib/registry and /storage directories

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

* [bitnami/harbor-registryctl] Check if swagger binary exists

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

* [bitnami/harbor-registryctl] Delete blank space

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

* [bitnami/harbor-registryctl] Fix check-app-version test

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

* [bitnami/harbor-registryctl] Fix check for swagger binary

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

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

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

---------

Signed-off-by: Cori Avila <amisericordi@vmware.com>
Signed-off-by: corico44 <42420333+corico44@users.noreply.github.com>
This commit is contained in:
Cori Avila
2023-05-12 10:06:44 +02:00
committed by GitHub
parent 1930bcea15
commit f5f17ee489
5 changed files with 89 additions and 2 deletions

View File

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

View File

@@ -0,0 +1,31 @@
group:
harbor:
exists: true
user:
harbor:
exists: true
file:
/var/lib/registry:
exists: true
mode: "0775"
owner: harbor
filetype: directory
/storage:
exists: true
mode: "0775"
owner: harbor
filetype: directory
/opt/bitnami/harbor-registryctl/bin/swagger:
exists: false
command:
# 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
# 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
check-harbor-registryctl-binary:
exec: harbor_registryctl --help
exit-status: 0

View File

@@ -0,0 +1,12 @@
binaries:
- yq
- registry
- harbor_registryctl
directories:
- paths:
- /etc/registry
- /etc/registryctl
version:
bin_name: registry
flag: --version
root_dir: /opt/bitnami