[bitnami/node] Add verification tests for NodeJS container (#26064)

* [bitnami/node] Add verification tests for NodeJS container

Signed-off-by: Michiel <michield@vmware.com>
This commit is contained in:
Michiel
2023-03-08 17:15:10 +01:00
committed by GitHub
parent 1eec8d0831
commit 3d7d8f56aa
5 changed files with 79 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
gossfile:
# Goss tests exclusive to the current container
../../node/goss/node.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-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
+14
View File
@@ -0,0 +1,14 @@
command:
# Node can run a simple 'Hello World' program
check-node:
exec: "node -e \"console.log('Hello World')\""
exit-status: 0
stdout:
- Hello World
check-global-modules:
exec: npm list -g
exit-status: 0
stdout:
{{ range $module := .Vars.modules }}
- {{ $module }}
{{ end }}
+19
View File
@@ -0,0 +1,19 @@
binaries:
- node
- npm
- npx
- node-gyp
- python
- yarn
directories:
- mode: "0755"
paths:
- /app
root_dir: /opt/bitnami
modules:
- node-gyp
- npm
- yarn
version:
bin_name: node
flag: --version
+18 -2
View File
@@ -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": "node/goss/goss.yaml",
"vars_file": "node/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-node"
}
}
}
},
{
"action_id": "trivy",
"params": {
@@ -91,4 +107,4 @@
]
}
}
}
}
+17 -1
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": "node/goss/goss.yaml",
"vars_file": "node/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-node"
}
}
}
},
{
"action_id": "trivy",
"params": {