From 881235f82c1053b25fe5330109b1deb2a1ac6cf6 Mon Sep 17 00:00:00 2001 From: Francisco de Paz Galan Date: Wed, 5 Apr 2023 12:16:26 +0200 Subject: [PATCH] [bitnami/solr] Add VIB tests (#29022) * [bitnami/solr] Add VIB tests Signed-off-by: FraPazGal * Add VIB triggers Signed-off-by: FraPazGal * Fix sed-in-place test Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Add comments Signed-off-by: FraPazGal --------- Signed-off-by: FraPazGal --- .vib/solr/goss/goss.yaml | 11 +++++++++++ .vib/solr/goss/solr.yaml | 21 +++++++++++++++++++++ .vib/solr/goss/vars.yaml | 15 +++++++++++++++ .vib/solr/vib-publish.json | 24 ++++++++++++++++++++---- .vib/solr/vib-verify.json | 18 +++++++++++++++++- 5 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 .vib/solr/goss/goss.yaml create mode 100644 .vib/solr/goss/solr.yaml create mode 100644 .vib/solr/goss/vars.yaml diff --git a/.vib/solr/goss/goss.yaml b/.vib/solr/goss/goss.yaml new file mode 100644 index 000000000000..64b88a449106 --- /dev/null +++ b/.vib/solr/goss/goss.yaml @@ -0,0 +1,11 @@ +gossfile: + # Goss tests exclusive to the current container + ../../solr/goss/solr.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-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/solr/goss/solr.yaml b/.vib/solr/goss/solr.yaml new file mode 100644 index 000000000000..23bfdacd8dc2 --- /dev/null +++ b/.vib/solr/goss/solr.yaml @@ -0,0 +1,21 @@ +file: + # Check file replacements in binary scripts + /opt/bitnami/solr/bin/solr.in.sh: + exists: true + filetype: file + contains: + - "SOLR_JAVA_HOME=/opt/bitnami/java" + - "SOLR_PID_DIR=/opt/bitnami/solr/tmp" + - "SOLR_LOGS_DIR=/opt/bitnami/solr/logs" +command: + check-app-version: + exec: JAVA_HOME=/opt/bitnami/solr/java /opt/bitnami/solr/bin/solr version + exit-status: 0 + stdout: + - {{ .Env.APP_VERSION }} +group: + solr: + exists: true +user: + solr: + exists: true diff --git a/.vib/solr/goss/vars.yaml b/.vib/solr/goss/vars.yaml new file mode 100644 index 000000000000..1fd9d92b2c99 --- /dev/null +++ b/.vib/solr/goss/vars.yaml @@ -0,0 +1,15 @@ +binaries: + - gosu + - java + - solr +directories: + - mode: "0775" + paths: + - /bitnami/solr + - /opt/bitnami/solr + - /opt/bitnami/solr/tmp + - /opt/bitnami/solr/logs +root_dir: /opt/bitnami +sed_in_place: + exclude_paths: + - /opt/bitnami/solr/bin/install_solr_service.sh diff --git a/.vib/solr/vib-publish.json b/.vib/solr/vib-publish.json index fdedec57153e..d2bbce8098d8 100644 --- a/.vib/solr/vib-publish.json +++ b/.vib/solr/vib-publish.json @@ -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": "solr/goss/goss.yaml", + "vars_file": "solr/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-solr" + } } } } diff --git a/.vib/solr/vib-verify.json b/.vib/solr/vib-verify.json index a34e8aee9161..aab9cd85d68c 100644 --- a/.vib/solr/vib-verify.json +++ b/.vib/solr/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": "solr/goss/goss.yaml", + "vars_file": "solr/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-solr" + } + } + } } ] }