[bitnami/postgresql-repmgr] Add VIB tests (#28652)

* [bitnami/postgresql-repmgr] Add VIB tests

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Fix file check permissions

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Remove VIB trigger

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Remove unused vars

Signed-off-by: FraPazGal <fdepaz@vmware.com>

---------

Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
Francisco de Paz Galan 2023-04-05 12:10:32 +02:00 committed by GitHub
parent 3aa215db4a
commit 3e6db54fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 87 additions and 5 deletions

View File

@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../postgresql-repmgr/goss/postgresql-repmgr.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,10 @@
file:
/opt/bitnami/postgresql/logs/postgresql.log:
exists: true
filetype: symlink
linked-to: /dev/stdout
command:
# Major and Minor versions are often shown as and "x.y" instead of "x.y.0"
check-app-version:
exec: psql --version | grep "$(echo $APP_VERSION | sed -E 's|([0-9]+\.[0-9]+)\.0$|\1|g')"
exit-status: 0

View File

@ -0,0 +1,28 @@
binaries:
- gosu
- psql
- pg_dump
- pg_dumpall
- pg_restore
- repmgr
- repmgrd
directories:
- mode: "0775"
paths:
- /bitnami/postgresql
- /bitnami/postgresql/conf
- /bitnami/postgresql/conf/conf.d
- /opt/bitnami/postgresql/conf
- /opt/bitnami/postgresql/conf/conf.d
- /opt/bitnami/postgresql/tmp
- /opt/bitnami/postgresql/logs
- /opt/bitnami/repmgr/conf
- /opt/bitnami/repmgr/tmp
- /docker-entrypoint-initdb.d
- paths:
- /opt/bitnami/repmgr/events
files:
- mode: "0775"
paths:
- /opt/bitnami/repmgr/events/router.sh
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": {
@ -76,9 +77,24 @@
"url": "{VIB_ENV_PACKAGES_JSON_URL}",
"path": "/{VIB_ENV_PATH}",
"authn": {
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
}
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "postgresql-repmgr/goss/goss.yaml",
"vars_file": "postgresql-repmgr/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-postgresql-repmgr"
}
}
}
}

View File

@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@ -46,6 +47,21 @@
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "postgresql-repmgr/goss/goss.yaml",
"vars_file": "postgresql-repmgr/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-postgresql-repmgr"
}
}
}
}
]
}