[bitnami/clickhouse] Add VIB tests (#34547)

* [bitnami/clickhouse] Add VIB tests

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

* Modify server check

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

* Fix output pipeline for test

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

* Remove VIB trigger

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

* Apply suggestions and trigger VIB

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

* Remove VIB trigger

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

---------

Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
Francisco de Paz Galan 2023-05-25 13:46:30 +02:00 committed by GitHub
parent 4b02915663
commit 73b8118f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 116 additions and 5 deletions

View File

@ -0,0 +1,39 @@
command:
# Force the exit-status as the timeout's original return varies between 0 and 143.
check-clickhouse-server:
exec: timeout --preserve-status 5 clickhouse-server 2>&1 || true
exit-status: 0
stdout:
- Ready for connections
file:
/var/lib/clickhouse/tmp:
exists: true
filetype: symlink
linked-to: /opt/bitnami/clickhouse/tmp
/opt/bitnami/clickhouse/logs/clickhouse.log:
exists: true
filetype: symlink
linked-to: /dev/stdout
/opt/bitnami/clickhouse/logs/clickhouse_error.log:
exists: true
filetype: symlink
linked-to: /dev/stderr
/opt/bitnami/clickhouse/etc/config.xml:
exists: true
filetype: file
contains:
- /data dir.*\/bitnami\/clickhouse\/data/
- /http_port.*from_env.*CLICKHOUSE_HTTP_PORT/
- "!remote_servers"
- "<console>1</console></logger>"
/opt/bitnami/clickhouse/etc/users.xml:
exists: true
filetype: file
contains:
- /password.*from_env.*CLICKHOUSE_ADMIN_PASSWORD/
group:
clickhouse:
exists: true
user:
clickhouse:
exists: true

View File

@ -0,0 +1,13 @@
gossfile:
# Goss tests exclusive to the current container
../../clickhouse/goss/clickhouse.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-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,27 @@
binaries:
- clickhouse
- clickhouse-client
- clickhouse-local
- clickhouse-server
directories:
- mode: "0775"
owner: clickhouse
group: root
paths:
- /bitnami/clickhouse/data
- /opt/bitnami/clickhouse/etc
- /opt/bitnami/clickhouse/etc/conf.d
- /opt/bitnami/clickhouse/etc/users.d
- /opt/bitnami/clickhouse/logs
- /opt/bitnami/clickhouse/tmp
- /bitnami/clickhouse/etc
- /docker-entrypoint-startdb.d
- /docker-entrypoint-initdb.d
files:
- mode: "0664"
paths:
- /.clickhouse-client-history
root_dir: /opt/bitnami
version:
bin_name: clickhouse-server
flag: --version

View File

@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@ -64,9 +65,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": "clickhouse/goss/goss.yaml",
"vars_file": "clickhouse/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-clickhouse"
}
}
}
}

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": "clickhouse/goss/goss.yaml",
"vars_file": "clickhouse/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-clickhouse"
}
}
}
}
]
}