From fc7da95c0d9d6654b91cfe86e3ea7e1f110c0712 Mon Sep 17 00:00:00 2001 From: Miguel Ruiz Date: Wed, 19 Apr 2023 10:25:08 +0200 Subject: [PATCH] [bitnami/elasticsearch-exporter] Add VIB tests (#30344) * [bitnami/elasticsearch-exporter] Add VIB tests Signed-off-by: Miguel Ruiz * Add trigger Signed-off-by: Miguel Ruiz * Remove trigger Signed-off-by: Miguel Ruiz --------- Signed-off-by: Miguel Ruiz --- .../goss/elasticsearch-exporter.yaml | 7 ++++++ .vib/elasticsearch-exporter/goss/goss.yaml | 11 +++++++++ .vib/elasticsearch-exporter/goss/vars.yaml | 6 +++++ .vib/elasticsearch-exporter/vib-publish.json | 24 +++++++++++++++---- .vib/elasticsearch-exporter/vib-verify.json | 18 +++++++++++++- 5 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 .vib/elasticsearch-exporter/goss/elasticsearch-exporter.yaml create mode 100644 .vib/elasticsearch-exporter/goss/goss.yaml create mode 100644 .vib/elasticsearch-exporter/goss/vars.yaml diff --git a/.vib/elasticsearch-exporter/goss/elasticsearch-exporter.yaml b/.vib/elasticsearch-exporter/goss/elasticsearch-exporter.yaml new file mode 100644 index 000000000000..0f19eae88fae --- /dev/null +++ b/.vib/elasticsearch-exporter/goss/elasticsearch-exporter.yaml @@ -0,0 +1,7 @@ +command: + check-elasticsearch-exporter: + exec: timeout --preserve-status 5 elasticsearch_exporter + exit-status: 143 + timeout: 8000 + stdout: + - triggering initial cluster info call diff --git a/.vib/elasticsearch-exporter/goss/goss.yaml b/.vib/elasticsearch-exporter/goss/goss.yaml new file mode 100644 index 000000000000..cb3480ea4d27 --- /dev/null +++ b/.vib/elasticsearch-exporter/goss/goss.yaml @@ -0,0 +1,11 @@ +gossfile: + # Goss tests exclusive to the current container + ../../elasticsearch-exporter/goss/elasticsearch-exporter.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-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/elasticsearch-exporter/goss/vars.yaml b/.vib/elasticsearch-exporter/goss/vars.yaml new file mode 100644 index 000000000000..07e9608473f0 --- /dev/null +++ b/.vib/elasticsearch-exporter/goss/vars.yaml @@ -0,0 +1,6 @@ +binaries: + - elasticsearch_exporter +root_dir: /opt/bitnami +version: + bin_name: elasticsearch_exporter + flag: --version diff --git a/.vib/elasticsearch-exporter/vib-publish.json b/.vib/elasticsearch-exporter/vib-publish.json index 8b6fe8eab4e6..a3c8c26b8fbd 100644 --- a/.vib/elasticsearch-exporter/vib-publish.json +++ b/.vib/elasticsearch-exporter/vib-publish.json @@ -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": "elasticsearch-exporter/goss/goss.yaml", + "vars_file": "elasticsearch-exporter/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-elasticsearch-exporter" + } + } + } + }, { "action_id": "trivy", "params": { @@ -77,9 +93,9 @@ "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}" + } } } } diff --git a/.vib/elasticsearch-exporter/vib-verify.json b/.vib/elasticsearch-exporter/vib-verify.json index a34e8aee9161..2ef7da8aa71f 100644 --- a/.vib/elasticsearch-exporter/vib-verify.json +++ b/.vib/elasticsearch-exporter/vib-verify.json @@ -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": "elasticsearch-exporter/goss/goss.yaml", + "vars_file": "elasticsearch-exporter/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-elasticsearch-exporter" + } + } + } + }, { "action_id": "trivy", "params": {