mirror of
https://github.com/bitnami/containers.git
synced 2026-02-19 05:27:22 +08:00
[bitnami/postgresql] Add postgresql tests (#27833)
* [bitnami/postgres]: Add Posgresql container tests Signed-off-by: Michiel <michield@vmware.com>
This commit is contained in:
12
.vib/postgresql/goss/goss.yaml
Normal file
12
.vib/postgresql/goss/goss.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
gossfile:
|
||||
# Goss tests exclusive to the current container
|
||||
../../postgresql/goss/postgresql.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: {}
|
||||
18
.vib/postgresql/goss/postgresql.yaml
Normal file
18
.vib/postgresql/goss/postgresql.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
command:
|
||||
# If the patch version is "0" the version is shown as "major.minor" without the patch version.
|
||||
# In that case we append .0 to the version to match with APP_VERSION
|
||||
check-version:
|
||||
exec: {{ .Vars.version.bin_name }} {{ .Vars.version.flag }} | awk '{ if (split($NF, ver, ".") == 2) { $NF = $NF ".0" } print }'
|
||||
stdout:
|
||||
- {{ .Env.APP_VERSION }}
|
||||
exit-status: 0
|
||||
file:
|
||||
/opt/bitnami/postgresql/logs/postgresql.log:
|
||||
exists: true
|
||||
filetype: symlink
|
||||
linked-to: /dev/stdout
|
||||
/opt/bitnami/postgresql/conf/postgresql.conf:
|
||||
exists: true
|
||||
mode: "0664"
|
||||
contains:
|
||||
- /^include_dir = 'conf.d'/
|
||||
25
.vib/postgresql/goss/vars.yaml
Normal file
25
.vib/postgresql/goss/vars.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
binaries:
|
||||
- gosu
|
||||
- postgres
|
||||
- psql
|
||||
- pg_dump
|
||||
- pg_dumpall
|
||||
- pg_restore
|
||||
files:
|
||||
- paths:
|
||||
- /opt/bitnami/postgresql/conf/pg_hba.conf
|
||||
directories:
|
||||
- mode: "0775"
|
||||
paths:
|
||||
- /bitnami/postgresql
|
||||
- /bitnami/postgresql/conf
|
||||
- /bitnami/postgresql/conf/conf.d
|
||||
- /docker-entrypoint-initdb.d
|
||||
- /opt/bitnami/postgresql/conf
|
||||
- /opt/bitnami/postgresql/conf/conf.d
|
||||
- /opt/bitnami/postgresql/logs
|
||||
- /opt/bitnami/postgresql/tmp
|
||||
root_dir: /opt/bitnami
|
||||
version:
|
||||
bin_name: postgres
|
||||
flag: --version
|
||||
@@ -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": "postgresql/goss/goss.yaml",
|
||||
"vars_file": "postgresql/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-postgresql"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
|
||||
@@ -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": "postgresql/goss/goss.yaml",
|
||||
"vars_file": "postgresql/goss/vars.yaml",
|
||||
"remote": {
|
||||
"pod": {
|
||||
"workload": "deploy-postgresql"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "trivy",
|
||||
"params": {
|
||||
|
||||
Reference in New Issue
Block a user