Skip to content

Commit

Permalink
[bitnami/tomcat-jdk] Add tests for tomcat-jdk (#46946)
Browse files Browse the repository at this point in the history
* [bitnami/tomcat-jdk] Add tests for tomcat-jdk

Signed-off-by: David Gomez <dgomezleon@vmware.com>

* [bitnami/tomcat-jdk] Apply feedback

Signed-off-by: David Gomez <dgomezleon@vmware.com>

---------

Signed-off-by: David Gomez <dgomezleon@vmware.com>
  • Loading branch information
dgomezleon authored Sep 1, 2023
1 parent fe763b3 commit dd43899
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .vib/tomcat-jdk-11/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

gossfile:
# Goss tests exclusive to the current container
../../tomcat-jdk-11/goss/tomcat-jdk-11.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-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
28 changes: 28 additions & 0 deletions .vib/tomcat-jdk-11/goss/tomcat-jdk-11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

file:
/opt/bitnami/apache-tomcat:
exists: true
filetype: symlink
linked-to: tomcat
/opt/bitnami/tomcat/webapps:
exists: true
filetype: symlink
linked-to: /bitnami/tomcat/webapps
/app:
exists: true
filetype: symlink
linked-to: /bitnami/tomcat/webapps
command:
check-app-version:
exec: version.sh
exit-status: 0
stdout:
- {{ .Env.APP_VERSION }}
group:
tomcat:
exists: true
user:
tomcat:
exists: true
22 changes: 22 additions & 0 deletions .vib/tomcat-jdk-11/goss/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
binaries:
- java
- render-template
directories:
- mode: "0775"
paths:
- /bitnami/tomcat/webapps
- /opt/bitnami/tomcat
- /opt/bitnami/tomcat/lib
- /opt/bitnami/tomcat/temp
- /opt/bitnami/tomcat/logs
- /opt/bitnami/tomcat/conf
- /opt/bitnami/tomcat/work
- /opt/bitnami/tomcat/webapps_default
files:
- mode: "0664"
paths:
- /opt/bitnami/tomcat/bin/setenv.sh
- mode: "0755"
paths:
- /opt/bitnami/tomcat/bin/version.sh
root_dir: /opt/bitnami
73 changes: 73 additions & 0 deletions .vib/tomcat-jdk-11/vib-verify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
"actions": [
{
"action_id": "container-image-package",
"params": {
"application": {
"details": {
"name": "{VIB_ENV_CONTAINER}",
"tag": "{VIB_ENV_TAG}"
}
},
"architectures": [
"linux/amd64",
"linux/arm64"
]
}
},
{
"action_id": "container-image-lint",
"params": {
"threshold": "error"
}
}
]
},
"verify": {
"actions": [
{
"action_id": "trivy",
"params": {
"threshold": "CRITICAL",
"vuln_type": [
"OS"
]
}
},
{
"action_id": "grype",
"params": {
"threshold": "CRITICAL",
"package_type": [
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "tomcat-jdk-11/goss/goss.yaml",
"vars_file": "tomcat-jdk-11/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-tomcat-jdk-11"
}
}
}
}
]
}
}
}
15 changes: 15 additions & 0 deletions .vib/tomcat-jdk-17/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

gossfile:
# Goss tests exclusive to the current container
../../tomcat-jdk-17/goss/tomcat-jdk-17.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-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}
28 changes: 28 additions & 0 deletions .vib/tomcat-jdk-17/goss/tomcat-jdk-17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

file:
/opt/bitnami/apache-tomcat:
exists: true
filetype: symlink
linked-to: tomcat
/opt/bitnami/tomcat/webapps:
exists: true
filetype: symlink
linked-to: /bitnami/tomcat/webapps
/app:
exists: true
filetype: symlink
linked-to: /bitnami/tomcat/webapps
command:
check-app-version:
exec: version.sh
exit-status: 0
stdout:
- {{ .Env.APP_VERSION }}
group:
tomcat:
exists: true
user:
tomcat:
exists: true
22 changes: 22 additions & 0 deletions .vib/tomcat-jdk-17/goss/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
binaries:
- java
- render-template
directories:
- mode: "0775"
paths:
- /bitnami/tomcat/webapps
- /opt/bitnami/tomcat
- /opt/bitnami/tomcat/lib
- /opt/bitnami/tomcat/temp
- /opt/bitnami/tomcat/logs
- /opt/bitnami/tomcat/conf
- /opt/bitnami/tomcat/work
- /opt/bitnami/tomcat/webapps_default
files:
- mode: "0664"
paths:
- /opt/bitnami/tomcat/bin/setenv.sh
- mode: "0755"
paths:
- /opt/bitnami/tomcat/bin/version.sh
root_dir: /opt/bitnami
73 changes: 73 additions & 0 deletions .vib/tomcat-jdk-17/vib-verify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
"actions": [
{
"action_id": "container-image-package",
"params": {
"application": {
"details": {
"name": "{VIB_ENV_CONTAINER}",
"tag": "{VIB_ENV_TAG}"
}
},
"architectures": [
"linux/amd64",
"linux/arm64"
]
}
},
{
"action_id": "container-image-lint",
"params": {
"threshold": "error"
}
}
]
},
"verify": {
"actions": [
{
"action_id": "trivy",
"params": {
"threshold": "CRITICAL",
"vuln_type": [
"OS"
]
}
},
{
"action_id": "grype",
"params": {
"threshold": "CRITICAL",
"package_type": [
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "tomcat-jdk-17/goss/goss.yaml",
"vars_file": "tomcat-jdk-17/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-tomcat-jdk-17"
}
}
}
}
]
}
}
}

0 comments on commit dd43899

Please sign in to comment.