From c1a2801b5ea50b1a94e2528f801ecbe055b06820 Mon Sep 17 00:00:00 2001 From: Jose Antonio Carmona Date: Tue, 4 Apr 2023 08:26:05 +0200 Subject: [PATCH] [bitnami/mongodb-sharded] Add VIB tests (#28162) * [bitnami/mongodb-shared] Add VIB tests Signed-off-by: Jose Antonio Carmona * Trigger VIB Signed-off-by: Jose Antonio Carmona * Fix path type Signed-off-by: Jose Antonio Carmona * Revert "Trigger VIB" This reverts commit c166dc9366d90d999ea7e6b998bb49bcf4f4c896. Signed-off-by: Jose Antonio Carmona --------- Signed-off-by: Jose Antonio Carmona --- .vib/mongodb-sharded/goss/goss.yaml | 13 +++++++++ .../mongodb-sharded/goss/mongodb-sharded.yaml | 22 +++++++++++++++ .vib/mongodb-sharded/goss/vars.yaml | 27 +++++++++++++++++++ .vib/mongodb-sharded/vib-publish.json | 18 ++++++++++++- .vib/mongodb-sharded/vib-verify.json | 18 ++++++++++++- 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .vib/mongodb-sharded/goss/goss.yaml create mode 100644 .vib/mongodb-sharded/goss/mongodb-sharded.yaml create mode 100644 .vib/mongodb-sharded/goss/vars.yaml diff --git a/.vib/mongodb-sharded/goss/goss.yaml b/.vib/mongodb-sharded/goss/goss.yaml new file mode 100644 index 000000000000..a47451dc954b --- /dev/null +++ b/.vib/mongodb-sharded/goss/goss.yaml @@ -0,0 +1,13 @@ +gossfile: + # Goss tests exclusive to the current container + ../../mongodb-sharded/goss/mongodb-sharded.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/mongodb-sharded/goss/mongodb-sharded.yaml b/.vib/mongodb-sharded/goss/mongodb-sharded.yaml new file mode 100644 index 000000000000..6ca4630168bd --- /dev/null +++ b/.vib/mongodb-sharded/goss/mongodb-sharded.yaml @@ -0,0 +1,22 @@ +file: + /opt/bitnami/mongodb/mongodb_get_source.txt: + exists: true + contains: + - This solution ships the official MongoDB Community binaries + /opt/bitnami/mongodb/conf/mongodb.conf: + exists: true + filetype: file + mode: "0664" + contains: + - /dbPath.*/bitnami/mongodb/data/db/ + - /pidFilePath.*/opt/bitnami/mongodb/tmp/mongodb.pid/ + /opt/bitnami/mongodb/conf/mongos.conf: + exists: true + filetype: file + mode: "0664" + contains: + - /pidFilePath.*/opt/bitnami/mongodb/tmp/mongodb.pid/ + /opt/bitnami/mongodb/logs/mongodb.log: + exists: true + filetype: symlink + linked-to: /dev/stdout \ No newline at end of file diff --git a/.vib/mongodb-sharded/goss/vars.yaml b/.vib/mongodb-sharded/goss/vars.yaml new file mode 100644 index 000000000000..9bff0498e016 --- /dev/null +++ b/.vib/mongodb-sharded/goss/vars.yaml @@ -0,0 +1,27 @@ +binaries: + - mongod + - mongosh + - yq + - wait-for-port + - render-template + - gosu +files: + - mode: "0664" + paths: + - /.dbshell + - /.mongorc.js + - /.mongoshrc.js +directories: + - mode: "0775" + paths: + - /.mongodb + - /bitnami/mongodb + - /bitnami/mongodb/data + - /opt/bitnami/mongodb/tmp + - /opt/bitnami/mongodb/logs + - /opt/bitnami/mongodb/conf + - /docker-entrypoint-initdb.d +root_dir: /opt/bitnami +version: + bin_name: mongod + flag: --version \ No newline at end of file diff --git a/.vib/mongodb-sharded/vib-publish.json b/.vib/mongodb-sharded/vib-publish.json index f78e8677530a..faf0d37232fe 100644 --- a/.vib/mongodb-sharded/vib-publish.json +++ b/.vib/mongodb-sharded/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -32,6 +33,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "mongodb-sharded/goss/goss.yaml", + "vars_file": "mongodb-sharded/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-mongodb-sharded" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/mongodb-sharded/vib-verify.json b/.vib/mongodb-sharded/vib-verify.json index a34e8aee9161..ac70ada48c98 100644 --- a/.vib/mongodb-sharded/vib-verify.json +++ b/.vib/mongodb-sharded/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": "mongodb-sharded/goss/goss.yaml", + "vars_file": "mongodb-sharded/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-mongodb-sharded" + } + } + } + }, { "action_id": "trivy", "params": {