From 5d56d9d4cdb7cbd43d352641d1229eb9529d1dab Mon Sep 17 00:00:00 2001 From: Francisco de Paz Galan Date: Mon, 17 Apr 2023 17:46:33 +0200 Subject: [PATCH] [bitnami/zookeeper] Add VIB tests (#29193) * [bitnami/zookeeper] Add VIB tests Signed-off-by: FraPazGal * Add VIB triggers Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Apply suggestions and trigger VIB Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Add missing goss template Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal --------- Signed-off-by: FraPazGal --- .vib/zookeeper/goss/goss.yaml | 13 +++++++++++++ .vib/zookeeper/goss/vars.yaml | 19 +++++++++++++++++++ .vib/zookeeper/goss/zookeeper.yaml | 4 ++++ .vib/zookeeper/vib-publish.json | 24 ++++++++++++++++++++---- .vib/zookeeper/vib-verify.json | 18 +++++++++++++++++- 5 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 .vib/zookeeper/goss/goss.yaml create mode 100644 .vib/zookeeper/goss/vars.yaml create mode 100644 .vib/zookeeper/goss/zookeeper.yaml diff --git a/.vib/zookeeper/goss/goss.yaml b/.vib/zookeeper/goss/goss.yaml new file mode 100644 index 000000000000..7010292dd65d --- /dev/null +++ b/.vib/zookeeper/goss/goss.yaml @@ -0,0 +1,13 @@ +gossfile: + # Goss tests exclusive to the current container + ../../zookeeper/goss/zookeeper.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: {} diff --git a/.vib/zookeeper/goss/vars.yaml b/.vib/zookeeper/goss/vars.yaml new file mode 100644 index 000000000000..8dadd9fbe203 --- /dev/null +++ b/.vib/zookeeper/goss/vars.yaml @@ -0,0 +1,19 @@ +binaries: + - gosu + - java + - wait-for-port + - zkServer.sh + - zkCli.sh +directories: + - mode: "0775" + paths: + - /bitnami/zookeeper/data + - /opt/bitnami/zookeeper/conf + - /opt/bitnami/zookeeper/logs +files: + - paths: + - /opt/bitnami/base/functions +root_dir: /opt/bitnami +version: + bin_name: zkServer.sh + flag: version diff --git a/.vib/zookeeper/goss/zookeeper.yaml b/.vib/zookeeper/goss/zookeeper.yaml new file mode 100644 index 000000000000..38bae99aaba1 --- /dev/null +++ b/.vib/zookeeper/goss/zookeeper.yaml @@ -0,0 +1,4 @@ +command: + check-custom-daemon-config: + exec: cat /opt/bitnami/zookeeper/bin/zkServer.sh | grep -q '_ZOO_DAEMON_OUT=$ZOO_LOG_DIR/zookeeper.out' + exit-status: 0 diff --git a/.vib/zookeeper/vib-publish.json b/.vib/zookeeper/vib-publish.json index 8b6fe8eab4e6..e4e42bf67c0d 100644 --- a/.vib/zookeeper/vib-publish.json +++ b/.vib/zookeeper/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -77,9 +78,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": "zookeeper/goss/goss.yaml", + "vars_file": "zookeeper/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-zookeeper" + } } } } diff --git a/.vib/zookeeper/vib-verify.json b/.vib/zookeeper/vib-verify.json index a34e8aee9161..4f55db94016a 100644 --- a/.vib/zookeeper/vib-verify.json +++ b/.vib/zookeeper/vib-verify.json @@ -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": "zookeeper/goss/goss.yaml", + "vars_file": "zookeeper/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-zookeeper" + } + } + } } ] }