[bitnami/mongodb] Add MongoDB container VIB tests (#27806)

* [bitnami/mongodb] Add MongoDB container VIB tests

Signed-off-by: Michiel <michield@vmware.com>
This commit is contained in:
Michiel
2023-03-28 16:34:02 +02:00
committed by GitHub
parent 1791a26ba0
commit 226e987734
5 changed files with 93 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
gossfile:
# Goss tests exclusive to the current container
../../mongodb/goss/mongodb.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-app-version.yaml: {}
../../common/goss/templates/check-broken-symlinks.yaml: {}
../../common/goss/templates/check-ca-certs.yaml: {}
../../common/goss/templates/check-binaries.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,17 @@
file:
/opt/bitnami/mongodb/mongodb_get_source.txt:
mode: "0644"
exists: true
contains:
- This solution ships the official MongoDB Community binaries
/opt/bitnami/mongodb/logs/mongodb.log:
exists: true
filetype: symlink
linked-to: /dev/stdout
/opt/bitnami/mongodb/conf/mongodb.conf:
mode: "0660"
exists: true
contains:
- /port.*27017/
- /pidFilePath.*opt/bitnami/mongodb/tmp/mongodb.pid/
- /path.*/opt/bitnami/mongodb/logs/mongodb.log/

View File

@@ -0,0 +1,27 @@
binaries:
- gosu
- mongod
- mongosh
- render-template
- wait-for-port
- yq
files:
- mode: "0664"
paths:
- /.dbshell
- /.mongoshrc.js
- /.mongorc.js
directories:
- mode: "0775"
paths:
- /bitnami/mongodb
- /bitnami/mongodb/data
- /docker-entrypoint-initdb.d
- /opt/bitnami/mongodb/conf
- /opt/bitnami/mongodb/logs
- /opt/bitnami/mongodb/tmp
- /.mongodb
root_dir: /opt/bitnami
version:
bin_name: mongod
flag: --version

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -32,6 +33,22 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "mongodb/goss/goss.yaml",
"vars_file": "mongodb/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-mongodb"
}
}
}
},
{
"action_id": "trivy",
"params": {

View File

@@ -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/goss/goss.yaml",
"vars_file": "mongodb/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-mongodb"
}
}
}
},
{
"action_id": "trivy",
"params": {